Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Return-code from COBOL to JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Return-code from COBOL to JCL
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    Post subject: Reply to: Return-code from COBOL to JCL
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    Post subject: hi
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    Post subject: Reply to: Return-code from COBOL to JCL
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    Post subject: hi
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    Post subject: Reply to: Return-code from COBOL to JCL
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: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 25, 2008 3:15 pm    Post subject:
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    Post subject: hi
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: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 25, 2008 4:12 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Mon Feb 25, 2008 5:36 pm    Post subject: Reply to: Return-code from COBOL to JCL
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: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 25, 2008 5:38 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts CA Workload Automation event code help vinu78 CA Products 10 Wed Mar 01, 2017 10:05 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us