IBM Security Z Security

 View Only
  • 1.  system symbols, JCL symbols and CARLa

    IBM Champion
    Posted Thu January 07, 2021 07:04 AM
    Edited by Rob van Hoboken Thu January 07, 2021 09:49 AM

    If you run zSecure on many LPARs you may have wondered how to generate CARLa commands containing the system name.  For example, to put the local system name into a qualifier of input or output dsnames.  Previously, I would have told you to use a hybrid of JCL DD and CARLa ALLOC commands like the sample in SCKRSAMP(C2PJCOND):

    // SET PREFIX=C2PACMON.&SYSNAME
    // SET MONTH=2012
    //CKRCARLA EXEC PGM=CKRCARLA,REGION=200M
    //STEPLIB  DD DISP=SHR,DSN=&CPREFIX..SCKRLOAD
    //C2PACMON DD DSN=&PREFIX..M&MONTH,
    //         DISP=(NEW,CATLG),VOL=SER=&VOLSER.,
    //         SPACE=(CYL,(1,1)),
    //         RECFM=VB,LRECL=584,BLKSIZE=27998
    //SYSPRINT DD SYSOUT=*
    //SYSIN    DD DATA,DLM=##
    ALLOC TYPE=ACCESS DSNPREF=C2PACMON.IPO1.D2012
    ALLOC TYPE=OUTPUT DD=C2PACMON
    INCLUDE DD=SC2PSAMP MEMBER=C2PAMCON
    ##
    //SC2PSAMP DD DISP=SHR,DSN=&C2PACPRM
    //         DD DISP=SHR,DSN=&CPREFIX..SCKRCARL
     

    But you can see that some parameters only work well in a CARLa command and cannot simply substitute.

    On the other hand, the JCL EXPORT command in combination with the SYMBOLS keyword on the DD statement makes JCL symbols available in in-stream data sets, so this is what my new monthly consolidation job would look like:

    //JCLLIB JCLLIB ORDER=(IBMSEC.ZSECURE.CKRPARM,
    // SYS1.SCKRPROC)
    // INCLUDE MEMBER=C2R$PARM
    //*
    // EXPORT SYMLIST=(PREFIX,YEAR,MONTH)
    //*
    // SET PREFIX=C2PACMON.&SYSNAME
    // SET YEAR=20
    // SET MONTH=12
    //*
    //* Consolidation of daily file(s) into a single monthly file
    //*
    //CKRCARLA EXEC C2RC,CONFIG=C2R$VOID,REGION=64M
    //SYSIN DD DATA,DLM=##,SYMBOLS=JCLONLY

    ALLOC TYPE=ACCESS DSNPREF=&PREFIX..D&YEAR.&MONTH
    ALLOC TYPE=OUTPUT DD=C2PACMON DSN=&PREFIX..M&YEAR.&MONTH,
          NEW MB_PRIM=10 MB_SEC=10
    INCLUDE DD=SC2PSAMP MEMBER=C2PAMCON

    ##
    //SC2PSAMP DD DISP=SHR,DSN=&C2PACPRM
    //         DD DISP=SHR,DSN=&CPREFIX..SCKRCARL


    The & symbols are substituted by the JCL convertor because I added the SYMBOLS=JCLONLY keyword.  The variables available for substitution are listed in the EXPORT command that must precede assignment (SET) of each symbol.   And CARLa knows how to allocate (new) data sets.

    SYMBOLS keyword
    EXPORT command


    If you want to use system symbols in your CARLa command, you should decide where the substitution has to happen: on the system where the JCL is converted or on the system where the job eventually runs.  When you have chose, you can replace the SYMBOLS=JCLONLY keyword with SYMBOLS=CNVTSYS or with SYMBOLS=EXECSYS, resp.

    ------------------------------
    Rob van Hoboken
    ------------------------------


  • 2.  RE: system symbols, JCL symbols and CARLa

    Posted Fri January 08, 2021 05:26 AM
    A couple of usage notes:

    You'll need to enable this functionality for the relevant batch job classes:
    $TJOBCLASS(x), SYSSYM=ALLOW
    and update your JES2 parmlib entries to match.

    You can use this with any symbols defined in IEASYMxx.
    There's also a set of Dynamic System Symbols documented in the MVS Initialization and Tuning Reference. You could use these to avoid manually setting Year and Month in the above example.

    ------------------------------
    Peter Buckley
    ------------------------------



  • 3.  RE: system symbols, JCL symbols and CARLa

    IBM Champion
    Posted Fri January 08, 2021 05:48 AM
    Edited by Rob van Hoboken Fri January 08, 2021 05:48 AM
    Excellent point about SYSSYM=ALLOW.

    Regarding the YEAR and MONTH values, the monthly consolidation job is supposed to run at (one of) the first day(s) of the new month, consolidating the data sets from the previous month, as illustrated by reference to December last year in my sample.

    zSecure users (and others) who need automated command generation with more control over existing/missing data sets, previous day, month, year values, etc. can look at the configurable command generator in the zSecure Knowledge Center.

    ------------------------------
    Rob van Hoboken
    ------------------------------


  • 4.  RE: system symbols, JCL symbols and CARLa

    Posted Fri January 08, 2021 11:08 AM
    Thanks Rob, 
    My simple solution to the above involved IEBGENERing SET commands for dates into a PDSE member on successful completion of one month's job, and INCLUDEing it on the next month's run.

    I've not spotted DATAGEN before. I'll be sure to add it to my box of tricks, and see what else it can do for me.

    ------------------------------
    Peter Buckley
    ------------------------------