ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Why exactly we should use *INZSR

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why exactly we should use *INZSR

    Hi,

    m using *InzSr for initializing my klists/data areas. but m not sure what difference it makes to code things in InzSr.
    this is what I got about InzSr
    "The initialization subroutine allows you to process calculation specifications before 1P output."

    Could someone please explain.

    Thanks

  • #2
    Re: Why exactly we should use *INZSR

    An *INZSR ist executed only the at the first call at your program.
    If your program ends with *LR = *ON, *INZSR is called each time you call your program.
    In this way you may use the *INZSR subroutine to initialize some variables for example by calling other programs that will return the appropriate information.
    If your program ends with Return (instead of *LR = *ON), *INZSR is executed only at the first call, for all sub-subsequent calls (within the same job and activation group) *INZSR is NOT executed.
    When initializing variables in the *INZSR, it is only excuted the first time, for all subsequent calls, the loaded value will not be overridden. In this way initializing variables within the *INZSR makes only sense for "constant" variables, i.e. values that are not changed as long as the activation group/job (where the program is running) is active.

    Birgitta

    Comment


    • #3
      Re: Why exactly we should use *INZSR

      thanks Birgitta

      Comment


      • #4
        Re: Why exactly we should use *INZSR

        Hi

        LP Zdenko

        Comment

        Working...
        X