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 

Is it possible to force Return COde passed by Cbl pgm 2 jcl?

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


Joined: 24 Jul 2003
Posts: 4
Topics: 3

PostPosted: Thu Jul 24, 2003 7:24 am    Post subject: Is it possible to force Return COde passed by Cbl pgm 2 jcl? Reply with quote

I have a step in my jcl which has the foll cond parameter:
cond=(4,ge,prevstepr RC)

Can I force the RC passed by the prev step. Can I have a cobol pgm
wherein I can determine what RC it passes?

Thanks,
`Meghna
Back to top
View user's profile Send private message Send e-mail
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Thu Jul 24, 2003 8:06 am    Post subject: Reply with quote

Hi

Yes, You can. Look at this link from IBM's COBOL Language Reference.

O.
________
[URL=http://www.honda-wiki.org/wiki/Honda_Pilot_(ATV)]Pilot (ATV)[/URL]


Last edited by ofer71 on Sat Feb 05, 2011 10:59 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Jul 24, 2003 8:17 am    Post subject: Reply with quote

Meghana,
Is the 'previous step' a COBOL program? If yes, then Ofer's solution is the best.

Also, Ofer, note her second question.
Quote:
Can I have a cobol pgm
wherein I can determine what RC it passes?
Isn't the answer to this 'No'?
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Jul 24, 2003 8:33 am    Post subject: Reply with quote

Meghna,
The following cobol pgm can set the return code to 12 or 0 depending on the logic. Assume this pgm runs as step1, and if you still want to reset the return code then you can use IDCAMS to set the MAXCC/LASTCC to the value you want
Code:

IDENTIFICATION DIVISION.                           
PROGRAM-ID.    RCTEST                             
DATE-COMPILED.                                     
ENVIRONMENT DIVISION.                             
CONFIGURATION SECTION.                             
INPUT-OUTPUT SECTION.                             
DATA DIVISION.                                     
WORKING-STORAGE SECTION.                           
                                                   
01 A   PIC 9(1) VALUE 0.                   
01 B   PIC 9(1) VALUE 1.                   
                                                   
PROCEDURE DIVISION.                               
                                                   
    IF A < B                                       
       MOVE 12 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.                                       


Code:

//RCTEST     IF    (STEP1.RC = 12)   THEN 
//STEP2      EXEC PGM=IDCAMS               
//SYSPRINT   DD  SYSOUT=*                 
//SYSIN      DD *                         
  SET MAXCC = 4                           
//*                                       
//ENDTEST    ENDIF                         
//*   


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Thu Jul 24, 2003 10:57 am    Post subject: Reply with quote

Cogito

I think there is a way from within COBOL pgm to determine the previous steps RC's.

This chould be done via JSCB & FSCT (I think).

Ofer
________
video reviews


Last edited by ofer71 on Sat Feb 05, 2011 10:59 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Jul 24, 2003 10:47 pm    Post subject: Reply with quote

Ofer,
That is new to me!

Let me guess. Is it that COBOL asks some "service" that actually gets the previous RC?
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 699
Topics: 63
Location: USA

PostPosted: Fri Jul 25, 2003 8:08 am    Post subject: Reply with quote

Let me guess ... RETURN-CODE will initially contain RC of prev step.
Back to top
View user's profile Send private message Send e-mail
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