MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passing RETURN CODE from COBOL to JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
rkdivvela
Beginner


Joined: 26 Mar 2004
Posts: 4
Topics: 3

PostPosted: Thu Apr 08, 2004 5:16 am    Post subject: Passing RETURN CODE from COBOL to JCL Reply with quote

1). I am setting a Return Code in COBOL program. I want that return code to be passed to JCL and execute some steps.

I tried to move return code into COBOL's RETURN CODE and tested, but no luck.

How does it can be done.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Thu Apr 08, 2004 5:39 am    Post subject: Reply with quote

rkdivvela,

The following sample pgm shows the setting of return code

Code:

WORKING-STORAGE SECTION.                                 
                                                         
01 A                      PIC S9(5) COMP-3 VALUE 0.       
01 B                      PIC S9(5) COMP-3 VALUE 1.       
                                                         
PROCEDURE DIVISION.                                       
                                                         
    IF A < B                                             
       MOVE 16 TO RETURN-CODE                             
       DISPLAY 'THE RETURN-CODE IS:' RETURN-CODE         
    ELSE                                                 
       MOVE 0  TO RETURN-CODE                             
       DISPLAY 'THE RETURN-CODE IS:' RETURN-CODE         
    END-IF.                                               
                                                         
    GOBACK.                                               



Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rkdivvela
Beginner


Joined: 26 Mar 2004
Posts: 4
Topics: 3

PostPosted: Fri Apr 09, 2004 9:46 pm    Post subject: Reply with quote

Kolusu,

I have coded the same way in my program. When I sumbit the JCL, the RETURN-CODE is not being passed to the JCL. Is there any special mechanism required to get this Return Code ?

Thank You
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Mon Apr 12, 2004 8:36 am    Post subject: Reply with quote

rkdivvela,

You need to give us more details when you say that it is not working. Please post the JCL and your requirement clearly.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group