Search code examples
jcl

In a JCL proc, how to test whether a parameter was not set by the caller?


I want to provide default values for parameters in a proc, and for such I want to know how to test whether the EXEC call defined the expected parameters or not.


Solution

  • Found out the right way to do this:

    //MYPROC  PROC  MYPAR=999
    //*       [your proc code]
    //        PEND
    

    If the calling EXEC does not set MYPAR to something (nor nullifies it), it will default to 999 as specified.

    Reference: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.ieab600/iea3b6_Examples_of_the_PROC_statement.htm