Page 1 of 3

usage of JOBRC parameter

PostPosted: Sun May 20, 2012 11:37 pm
by ibmmf4u
Hi everyone,

My requirement here is to set the maxcc of the job. we are currently using z/OS 1.13R in our shop. I heard that this can be done by JOBRC parameter which got introduced in 1.13R .

I tried using the JOBRC Parameter in the below code as follows but i got an error stating verb JOBRC is unkown.

//xxxxxxxx JOB (xxxx,xxxxxx,,,xxxxx),'JOBRC USAGE',CLASS=H,
//   NOTIFY=&SYSUID,REGION=16M,MSGCLASS=U                 
//STEP010  EXEC PGM=IEFBR14                               
//STEP020  EXEC PGM=IEBGENER                             
//SYSOUT   DD   SYSOUT=*                                 
//SYSPRINT DD   SYSOUT=*                                 
// IF (STEP010.RC = 0 | STEP020.RC = 0) THEN             
//JOBRC=STEP010                                                 
// ENDIF                                                 


Pasted below is the error message which is encountered. I even tried it using in the job card but sill facing the same problem.

VERB "JOBRC" IS UNKNOWN


//xxxxxxxx JOB (xxxx,xxxxxx,,,xxxxx),'JOBRC USAGE',CLASS=H,
//   NOTIFY=&SYSUID,REGION=16M,MSGCLASS=U,JOBRC=STEP010               


 - NOTIFY=XXXXXXXX,REGION=16M,MSGCLASS=U,JOBRC=STEP010
UNKNOWN KEYWORD "JOBRC" SPECIFIED IN OPERAND OF "JOB"



Can someone kindly let me know on how to use the JOBRC keyword and make the above piece of code work as per my requirement.

Re: usage of JOBRC parameter

PostPosted: Mon May 21, 2012 1:24 am
by NicC
Try reading the manual. Does it say that JOBRC goes on the job card? You cannot just make up the syntax as YOU want it - it must be as per the manual. As the INTERPRETER wants it.

By the way - why do this? Suppose a non-zero return code really IS an error? This will just hide it and screw your processing up.

Re: usage of JOBRC parameter

PostPosted: Mon May 21, 2012 5:03 am
by steve-myers
  • JOBRC is available only with z/OS 1.13 and later.
  • It is a JOB statement parameter, as you would discover when you RTFM. You cannot code it as you have shown.

Re: usage of JOBRC parameter

PostPosted: Mon May 21, 2012 8:08 am
by dick scherrer
Hello,

Suggest you post what you are trying to accomplish (in sentence form rather than code).

In addition to the problem syntax, i don't understand why someone wants you to do this. . . :?

Re: usage of JOBRC parameter

PostPosted: Mon May 21, 2012 8:41 pm
by ibmmf4u
Hi All,

Thanks for your valuable replies. As Dick mentioned i shall explain my requirement .

We will be normally FTP'ing files to a destination server daily. Its done with the help of a proc, which consists of three steps where all the steps will be trying to FTP the file in case of a failure of other.

If step010 FTP's the file successfully then the remaining steps will be flushed out as the subsequent steps will only execute upon the return code of the previous steps. Let me put an sample piece of code as an example here.

//STEP010 EXEC PGM=FTPPROG
//*** FTP STATEMENTS****
// IF  STEP010.RC > O THEN
//**** WHERE IF THE STEP010 FAILS IT EXECUTES THE STEP020****
//STEP020 EXEC PGM=FTPPROG
//****FTP STATEMENTS***
// IF STEP020.RC > O THEN
//****IF THE STEP020 FAILS THEN IT EXECUTES STEP030****
//STEP030 EXEC PGM=FTPPROG
//****FTP STATEMENTS***
// ENDIF
// ENDIF


All this is been done with the help of a proc and the same proc is been used by several jobs with a change in the control cards.

Now if any of the steps is failed while FTP'ing the file and if it went fine in the next step then am getting paged since the job picks up the maximum return code. In short the job is abended even if the file was successfully sent to destination either in second or third attempt.

Hence we came up with the idea of setting the MAXCC to zero, if its successfull in one of the three steps by doing an IF-condition at bottom as shown below.

// IF ( STEP010.RC =0 | STEP020.RC =0 | STEP030.RC =0) THEN
//*** SET MAXCC TO ZERO****
//*** WHICH I THOUGHT CAN BE DONE WITH JOBRC PARAMETER***
// ENDIF



Can someone kindly help me out in achieving the same.

Thanks in advance!

Re: usage of JOBRC parameter

PostPosted: Mon May 21, 2012 8:53 pm
by Robert Sample
Even if you placed the JOBRC parameter on the JOB statement as is required, it probably would still not meet your needs. The manual says you have three choices for the JOBRC value: MAXRC, LASTRC, or a specific step RC. No IF statements, no setting to zero -- highest, last executed step, or specific step are your only three choices.

Re: usage of JOBRC parameter

PostPosted: Mon May 21, 2012 9:16 pm
by Akatsukami
We are running z/OS V1.12 here, so I cannot test this; but try something like:
//FOO    JOB    JOBRC=(STEP,STEP40)...
//STEP10   EXEC  FTP
//IF1      IF    (STEP10.RC¬=0) THEN
//STEP20   EXEC  FTP
//IF2      IF    (STEP20.RC¬=0) THEN
//STEP30   EXEC  FTP
//ENDIF2   ENDIF
//ENDIF1   ENDIF
//IF3     IF   ((STEP10.RC = 0) | (STEP20.RC = 0) | (STEP30.RC = 0)) THEN
//STEP40   EXEC  PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSIN    DD   *
  SET MAXCC=0
//         ELSE
//STEP40   EXEC  PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSIN   DD   *
  SET MAXCC=16
//ENDIF3   ENDIF

Re: usage of JOBRC parameter

PostPosted: Mon May 21, 2012 9:41 pm
by ibmmf4u
Hi Robert,

Thanks a lot. I have one quick query about the it . please correct me if am wrong.

If i code a Dummy Step over there and have the job accept the LASTRC , will it works.

// IF ( STEP010.RC = 0| STEP020.RC = 0| STEP030.RC = 0) THEN
//STEP040 EXEC PGM=IEFBR14
// ENDIF


In this case if it satisfies the condition then STEP040 will execute and return code of zero will be passed as JOBRC can able to pick the return code of any step in the proc.

Please kindly correct me if am wrong.!!!


Hi Akatsukami,

I tried using the IDCAMS , it worked well till the return code of the program is lessthan the one which has been set through IDCAMS.

For ex. if one of the previous step's return code is 16 and the one i.e. coded through SET statement is 10 the job is picking up 16 and the program is abended. where if the previous steps return code is 2 and one i.e coded using SET is 4. it is picking up the one that has been set through IDCAMS as it is the highest. Either ways it is picking up the highest retrun code.

Thanks for your inputs!!

Re: usage of JOBRC parameter

PostPosted: Mon May 21, 2012 11:58 pm
by dick scherrer
Hello,

It has been my experience that if an ftp fails, another attempt as the next step most likely fails also. . .

The cause of the failure should be determined, corrective action should be taken and the transmission re-run once the problem is corrected.

If the environment is so unstable failures happen often and that re-running a few times gets around the problem, i'd be quite concerned - fwiw.

Re: usage of JOBRC parameter

PostPosted: Tue May 22, 2012 2:51 am
by Akatsukami
ibmmf4u wrote:Hi Akatsukami,

I tried using the IDCAMS , it worked well till the return code of the program is lessthan the one which has been set through IDCAMS.

For ex. if one of the previous step's return code is 16 and the one i.e. coded through SET statement is 10 the job is picking up 16 and the program is abended. where if the previous steps return code is 2 and one i.e coded using SET is 4. it is picking up the one that has been set through IDCAMS as it is the highest. Either ways it is picking up the highest retrun code.

Thanks for your inputs!!

And you did code
JOBRC=(STEP,stepname[.procstepname])

on the JOB card, correct?