| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| meghna Beginner
 
 
 Joined: 24 Jul 2003
 Posts: 4
 Topics: 3
 
 
 | 
			
				|  Posted: Thu Jul 24, 2003 7:24 am    Post subject: Is it possible to force Return COde passed by Cbl pgm 2 jcl? |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| ofer71 Intermediate
 
 
 Joined: 12 Feb 2003
 Posts: 358
 Topics: 4
 Location: Israel
 
 | 
			
				|  Posted: Thu Jul 24, 2003 8:06 am    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| Cogito-Ergo-Sum Advanced
 
 
 Joined: 15 Dec 2002
 Posts: 637
 Topics: 43
 Location: Bengaluru, INDIA
 
 | 
			
				|  Posted: Thu Jul 24, 2003 8:17 am    Post subject: |   |  
				| 
 |  
				| Meghana, Is the 'previous step' a COBOL program? If yes, then Ofer's solution is the best.
 
 Also, Ofer, note her second question.
 Isn't the answer to this 'No'? 	  | Quote: |  	  | Can I have a cobol pgm wherein I can determine what RC it passes?
 | 
 _________________
 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 |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Thu Jul 24, 2003 8:33 am    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| ofer71 Intermediate
 
 
 Joined: 12 Feb 2003
 Posts: 358
 Topics: 4
 Location: Israel
 
 | 
			
				|  Posted: Thu Jul 24, 2003 10:57 am    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| Cogito-Ergo-Sum Advanced
 
 
 Joined: 15 Dec 2002
 Posts: 637
 Topics: 43
 Location: Bengaluru, INDIA
 
 | 
			
				|  Posted: Thu Jul 24, 2003 10:47 pm    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| Dibakar Advanced
 
  
 Joined: 02 Dec 2002
 Posts: 702
 Topics: 64
 Location: USA
 
 | 
			
				|  Posted: Fri Jul 25, 2003 8:08 am    Post subject: |   |  
				| 
 |  
				| Let me guess ... RETURN-CODE will initially contain RC of prev step. |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |