IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Return-code from COBOL to JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Mon Feb 25, 2008 12:56 pm
Reply with quote

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
View user's profile Send private message
ramvishwa
Warnings : 2

New User


Joined: 18 Dec 2006
Posts: 18
Location: bangalore

PostPosted: Mon Feb 25, 2008 1:09 pm
Reply with quote

What is the actual error or problem your are facing.

Thnx
Ramvishwa
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Mon Feb 25, 2008 1:12 pm
Reply with quote

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
View user's profile Send private message
ramvishwa
Warnings : 2

New User


Joined: 18 Dec 2006
Posts: 18
Location: bangalore

PostPosted: Mon Feb 25, 2008 1:38 pm
Reply with quote

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
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Mon Feb 25, 2008 1:47 pm
Reply with quote

ramvishwa,

I have totally 35 steps in the Procedure.
Back to top
View user's profile Send private message
ramvishwa
Warnings : 2

New User


Joined: 18 Dec 2006
Posts: 18
Location: bangalore

PostPosted: Mon Feb 25, 2008 3:00 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Feb 25, 2008 3:15 pm
Reply with quote

Did you actually get RC 100 from your program ?
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Mon Feb 25, 2008 3:51 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Feb 25, 2008 4:12 pm
Reply with quote

What was the RC that was shown in the JESLOG when you ran your program ?
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Mon Feb 25, 2008 5:20 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Feb 25, 2008 5:36 pm
Reply with quote

You got what You asked for..
I guess that SPWARN abends for a not 0 return code
and that' exactly what it did icon_biggrin.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Feb 25, 2008 5:38 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts run rexx code with jcl CLIST & REXX 15
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Compile rexx code with jcl CLIST & REXX 6
Search our Forums:

Back to Top