midrange.com code scratchpad
Name:
OMIT and NOPASS in call chain
Scriptlanguage:
Plain Text
Tabwidth:
4
Date:
03/13/2011 09:13:21 am
IP:
Logged
Description:
Example showing how *OMIT is passed on a call chain. Specifically showing how the runtime does not check to see if a parm is passed before passing it on.
Code:
  1.      d proc1           pr
  2.      d parm1                          1a
  3.      d parm2                          1a   options(*omit : *nopass)
  4.      d parm3                          1a   options(*omit : *nopass)
  5.  
  6.      d proc2           pr
  7.      d parm1                          1a
  8.      d parm2                          1a   options(*omit : *nopass)
  9.      d parm3                          1a   options(*omit : *nopass)
  10.  
  11.      d var1            s              1a   inz('A')
  12.      d var2            s              1a   inz('B')
  13.      d var3            s              1a   inz('C')
  14.  
  15.       /free
  16.  
  17.        proc1(var1 : *omit : var3);
  18.        proc1(var1 : var2);
  19.        proc1(var1);
  20.  
  21.        *inlr = *on;
  22.        return;
  23.  
  24.       /end-free
  25.       **********************************************************************************************
  26.      p proc1           b
  27.      d proc1           pi
  28.      d parm1                          1a
  29.      d parm2                          1a   options(*omit : *nopass)
  30.      d parm3                          1a   options(*omit : *nopass)
  31.  
  32.       /free
  33.  
  34.        proc2(parm1 : parm2 : parm3);
  35.  
  36.        return;
  37.  
  38.       /end-free
  39.      p proc1           e
  40.       **********************************************************************************************
  41.      p proc2           b
  42.      d proc2           pi
  43.      d parm1                          1a
  44.      d parm2                          1a   options(*omit : *nopass)
  45.      d parm3                          1a   options(*omit : *nopass)
  46.  
  47.       /free
  48.  
  49.        return;
  50.  
  51.       /end-free
  52.      p proc2           e 
© 2004-2019 by midrange.com generated in 0.007s valid xhtml & css