View previous topic :: View next topic
|
Author |
Message |
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Dear Expert,
I am facing the problem, while receiving the Return-code from COBOL to JCL.
Here is my JCL,
1) In the first step it is executing one COBOL-DB2 program.
In the program I have written a statement
MOVE 100 TO RETURN-CODE
2) In the second step I am trying to create a new file by comparing the return-code from first step.
Please correct If I am doing wrong, I couldn't locate the actual problem with the return-code.
I did nothing more than the MOVE statement towards a return-code. Everything else is a normal program logic.
There are no conditions for this move statement.
//JOB1000D JOB 0,CLASS=X,MSGCLASS=0,NOTIFY=&SYSUID
//SETVAR SET ID=TT,BNK=R,TLQ=
//JCLLIB JCLLIB ORDER=(TTTT.SYST.PROCLIB)
//*
//JSTEP010 EXEC PROC-NAME
//*
//JSTEP020 EXEC PGM=IEFBR14,COND=(100,NE)
//SYSOUT DD SYSOUT=*
//SYSUT1 DD DSN=TTTT.KUMAR.SAMPLE.FILE6,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(5,1)),RECFM=FB,LRECL=446,
// BLKSIZE=27652,DSORG=PS, |
|
Back to top |
|
|
ramvishwa Warnings : 2 New User
Joined: 18 Dec 2006 Posts: 18 Location: bangalore
|
|
|
|
What is the actual error or problem your are facing.
Thnx
Ramvishwa |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Ramvishwa,
The second step id getting bypassed instead of getting executed.
I want the second step to be executed when the return-code of the first step is 100. |
|
Back to top |
|
|
ramvishwa Warnings : 2 New User
Joined: 18 Dec 2006 Posts: 18 Location: bangalore
|
|
|
|
Hi M K K,
Sorry i dont find any mistake in your process. But i need some more clarifications. How many steps you have in your Procedure. If I am not wrong, there is only one step in which you have a COBOL-DB2 program. If that is the case just give the condition in another way. Hope it will work
//JOB1000D JOB 0,CLASS=X,MSGCLASS=0,NOTIFY=&SYSUID
//SETVAR SET ID=TT,BNK=R,TLQ=
//JCLLIB JCLLIB ORDER=(TTTT.SYST.PROCLIB)
//*
//JSTEP010 EXEC PROC-NAME
//*
// IF JSTEP010.RC EQ 100 THEN
//JSTEP020 EXEC PGM=IEFBR14,COND=(100,NE)
//SYSOUT DD SYSOUT=*
//SYSUT1 DD DSN=TTTT.KUMAR.SAMPLE.FILE6,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(5,1)),RECFM=FB,LRECL=446,
// BLKSIZE=27652,DSORG=PS,
// ENDIF. |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
ramvishwa,
I have totally 35 steps in the Procedure. |
|
Back to top |
|
|
ramvishwa Warnings : 2 New User
Joined: 18 Dec 2006 Posts: 18 Location: bangalore
|
|
|
|
Hi M M K,
It meanse that you have 35 steps inside the procedure. Are you sure that you are checking each and individual steps's return code inside the procedure. If that is the case you can check as specified.
//JOB1000D JOB 0,CLASS=X,MSGCLASS=0,NOTIFY=&SYSUID
//SETVAR SET ID=TT,BNK=R,TLQ=
//JCLLIB JCLLIB ORDER=(TTTT.SYST.PROCLIB)
//*
//JSTEP010 EXEC PROC-NAME
//*
// IF JSTEP010.PSTEP035.RC EQ 100 THEN
//JSTEP020 EXEC PGM=IEFBR14,COND=(100,NE)
//SYSOUT DD SYSOUT=*
//SYSUT1 DD DSN=TTTT.KUMAR.SAMPLE.FILE6,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(5,1)),RECFM=FB,LRECL=446,
// BLKSIZE=27652,DSORG=PS,
// ENDIF.
Thnx
Ramvishwa |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Did you actually get RC 100 from your program ? |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi expat,
I think COND is the only way to check that.
Please let me know if there is any other way to check the same. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
What was the RC that was shown in the JESLOG when you ran your program ? |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi Expact,
Here is the JESLOG
TTY1000D JSTEP010 STEP270 SORT 0000
TTY1000D STEP275 @SPWARN SPWARN FLUSHED
TTY1000D JSTEP010 STEP350 IKJEFT1B 0100
TTY1000D STEP355 @SPWARN SPWARN U0222
TTY1000D JSTEP020 IEFBR14 FLUSHED
@SPWARN is a Procedure which calls Assembler program SPWARN,
which pushes an ABEND AFTER BAD COMPLETION OF PREVIOUS STEP.
This is being included after all the steps in the JOB in the production.
Can you suggest the possible solution here. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
You got what You asked for..
I guess that SPWARN abends for a not 0 return code
and that' exactly what it did |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Your condition code checking is working perfectly well, exactly as it should be doing.
May I suggest that you take a read through the JCL reference manual, paying attention to how COND= is designed to work. |
|
Back to top |
|
|
|