CALL statement
Use a CALL statement to submit a JCL in one BCL.
Syntax
Note:
//new_stepname CALL
{MEMBER=jcl_name}[,WAIT=value][,COND=((code,op[,stepname])[,(code,op[,stepname])…])] - To change the behavior of the COND clause to the behavior that existed before the 7.0.1.1 release, use the -oldcond option. For details about this option, see Using previous versions of the Remote Build server.
- To enable the comment field continuation feature, use the -strict option. For details about this options, see Editing the RCCRUNM or RCCRUNU member.
- new_stepname
- The name of the call step you are defining.
- jcl_name
- The member name of a PDS or the PS dataset name that is the JCL to be submitted.
- value
- The waiting time (seconds) for the Remote Build server to wait for the JCL to finish running to get its return code. Positive integers and zero are valid. For zero, it means the Remote Build server will not wait and continues to execute the next step.
- code
- The value to test against the return code from a previous step.
- op
- The comparison operator. It can be EQ, NE, LE, GE, LT, or GT.
- stepname
- The name of the step that issues the return code.
Note:
- In the COND clause, you can omit the outer parentheses if you code only one return code test.
- When the value is a positive integer, if the JCL does not finish running in specified seconds, Remote Build will return an error message and terminate the build.
- When the value is a positive integer, Remote Build will append
some JCL statements to the user’s specified JCL, like below, as to
what you can see in the JES log. This is for Remote Build to get the
return code of the JCL and will not affect the JCL’s execution result.
'waitfilename' and '&CCULIB' will be replaced with real value.
For waitfilename, its format is <worker_job_id>.wait. For &CCULIB,
refer to Editing the RCCMVS member.
// IF RC = 0 THEN //CCU0 EXEC PGM=CCUZRET,PARM=’waitfilename 1 0’ //STEPLIB DD DISP=SHR,DSN=&CCULIB // ELSE // IF RC = 4 THEN //CCU4 EXEC PGM=CCUZRET,PARM='waitfilename 1 4’ //STEPLIB DD DISP=SHR,DSN=&CCULIB // ELSE // IF RC = 8 THEN //CCU8 EXEC PGM=CCUZRET,PARM='waitfilename 1 8’ //STEPLIB DD DISP=SHR,DSN=&CCULIB // ELSE // IF RC = 16 THEN //CCU16 EXEC PGM=CCUZRET,PARM='waitfilename 1 16’ //STEPLIB DD DISP=SHR,DSN=&CCULIB // ELSE //CCU20 EXEC PGM=CCUZRET,PARM='waitfilename 1 20’ //STEPLIB DD DISP=SHR,DSN=&CCULIB // ENDIF
- For the CALL step, Remote Build will return 0, 4, 8, or 16 when the specified JCL returns 0, 4, 8 or 16. Remote Build will only return 20 when the specified JCL returns other values.
sample.jcl:
//UPLOAD1 EXEC PGM=IEFBR14 //EZEJCLX DD DSN=&HLQ..&SYSTEM..CNTL,DISP=SHR,RCCEXT=JCL //MYCALL1 CALL MEMBER=&HLQ..&SYSTEM..CNTL(&DEL3),WAIT=20 //MYCALL2 CALL MEMBER=&HLQ..&SYSTEM..CNTL(&DEL4),COND=(0,EQ,MYCALL1) //
Rccbuild command:
rccbuild -h hostname@port -ft sample.jcl -b sample –it delete3.jcl delete4.jcl -v HLQ=<userid> SYSTEM=ES10 DEL3=DELETE3 DEL4=DELETE4 -V -V -V
Result is like below:
*** Success *** RCCI-003 Program Name : 'IEFBR14 '. PARM : ''. RCCI-004 The MVS step 'UPLOAD1' return code is '000000'. RCCI-021 The CALL step 'MYCALL1' return code is '000000' and jobid is 'xxxxxxxx'. Please refer to JES log for details. RCCI-013 Step 'MYCALL2' was not executed because of the COND CODE of step 'MYCALL1'.