CA Workload Automation ESP Edition

Expand all | Collapse all

uss process spawns multiple same named steps - how to ccchk?

Jump to Best Answer
  • 1.  uss process spawns multiple same named steps - how to ccchk?

    Posted 02-04-2020 05:02 PM
    Hello Forum,  running ESP v11.4: overview is we wish to run a shell script located in the uss via jcl like:
    // PARM='SH /u/a#biega/ X
    // %USSFILE
    We want to code a CCCHK statement so that if this RUNSHELL step gets a 0, fail the job;  if it exits with > 0 (ie finds files to count, never expected to exceed six in the particular uss dir we are checking against)
    the script is short, just counts # of files in a uss directory and does an ls -lp to list them out.
    We want the job to fail if the script finds NO files in the uss and thus exits with a 0
    (conversely, if say it found 6 files, it would exit with a 6 and the cc should be 6 and that's all good)
    Problem:  I'm not fluent in uss/bpxbatch but when we run the job (ie run the script via bpxbatch)
    we see in the job's JESMSGLG  TWO steps, both with the name *OMVSEX even though we have no steps in our jcl named *OMVSEX

    So, obviously bpxbatch-uss stuffs both of them there.  When our dir has six files we see in our jesmsglg
    So the second *OMVSEX step is reflecting the fact the found six files and did an exit 6

    but no idea where that 1st *omvsex step comes from but the fact that we have TWO identical step names, one of which
    always returns zero, the other the # of files,
    How would one code a CCCHK statement for step *OMVSEX when there are two of them with the same name??

    thanks in advance if anyone has a solution


  • 2.  RE: uss process spawns multiple same named steps - how to ccchk?
    Best Answer

    Posted 02-05-2020 03:00 PM
    Hi Mike,

    If it's the only step in the JCL, you may consider NOT use STEP. And set JOBRC=LASTRC on the JOB card, so that the JOB return code will be from the last step.

    Hope this helps,