How to check the return code of PROC

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
vijay_10b
Member
Posts: 9
Joined: Tue Sep 04, 2012 4:41 pm

How to check the return code of PROC

Post by vijay_10b » Mon Feb 03, 2014 8:34 pm

Hi,

I have a JCL which has 7 steps, Step 3 execute a proc (which checks the given file is empty or not). step4 is executed with COND=(4,EQ).....now i'm getting error "JCP0516E INVALID REFERBACK 'STEP3' DETECTED" in the step7 while testing the Step 3 RC

structure of program
//AAAAA JOB (00030000,1111,,,),'AAAAAAAA',
// NOTIFY=AAAAAA,MSGCLASS=X,CLASS=A
//PROC JCLLIB ORDER=(XXXX.XXXX.JCL)
:
:
//Step1 exec pgm=sort
:
:
//Step3 exec TEST,dsname=bbbb.bbbb.bbb
:
//STEP4 EXEC PGM=SORT,COND=(4,EQ)
:
:
//STEP7 EXEC PGM=SORT,COND=(4,EQ,STEP3)
:
:


Proc structure
//TEST PROC
//PS010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//FILE12 DD DSN=&DSNAME,DISP=SHR
//SYSIN DD *
PRINT INFILE(FILE12) COUNT(001)

I tested the following options too but still getting same error
COND=(4,EQ,STEP3.TEST) and COND=(4,EQ,STEP3.PS010)

Can any one guide me

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Mon Feb 03, 2014 9:34 pm

You need to post the expanded JCL from the problem execution - along with All of the diagnostic info presented.
Have a good one

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Mon Feb 03, 2014 10:25 pm

Step03 is not executing a step but a procedure. Procedures do not have return codes but the steps within do. You need to adjust your condition to specify the step within the procedure. Look in the manual as to how to do that because it is not quite the same as referring to a step outside of the procedure.
Regards
Nic

vijay_10b
Member
Posts: 9
Joined: Tue Sep 04, 2012 4:41 pm

Post by vijay_10b » Tue Feb 04, 2014 4:36 pm

Thank you NIC

COND=(4,EQ,STEP3.PS010) worked (*stepname.procstepname)

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Tue Feb 04, 2014 8:05 pm

Good find and feedback!
Regards
Nic

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others