View previous topic :: View next topic
|
Author |
Message |
Susheel singh
New User
Joined: 25 Jul 2013 Posts: 13 Location: INDIA
|
|
|
|
Hello,
I want to use Return-code variable in my ims-cobol program. Based on some condition in program i need to get return code of 8 for the program and in jcl i need to execute a step, if the step which uses this program returns RC - 8.
I have never used return-code variable please let me know is it i need to define it in WSS or how can i use it?
Anyone can please help!
Thanks |
|
Back to top |
|
|
magesh23586
Active User
Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
RETURN-CODE doesnt requires any declaretions, its a system declared one.
you can directly use it without declartion.
Code: |
Move 8 to return-code.
|
|
|
Back to top |
|
|
Susheel singh
New User
Joined: 25 Jul 2013 Posts: 13 Location: INDIA
|
|
|
|
Thanks magesh...........can u answer some of my questions
Is this step is enough to get return code 8 for the program?
After executing this step program will exit and rest of the code will not execute? |
|
Back to top |
|
|
magesh23586
Active User
Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
Move statement is sufficient to set the return code and rest of the code will get executed.
Regards,
Magesh |
|
Back to top |
|
|
magesh23586
Active User
Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
One suggession, Before you request a query check whether it is already answered in any of the website... Most of the problem might be re-solved and you can find it through google.... |
|
Back to top |
|
|
Susheel singh
New User
Joined: 25 Jul 2013 Posts: 13 Location: INDIA
|
|
|
|
Ok....... thanks magesh! |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
magesh23586 wrote: |
Move statement is sufficient to set the return code and rest of the code will get executed.
Regards,
Magesh |
one would think that setting a return code of 8,
which is not a warning,
but an error,
should be followed by the program stopping - e.g. STOP RUN. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
I think sometimes 8 is used for an error, but one which a program (e.g., a compiler) has made an assumptive "correction," whereas 12 is used for an "unfixable" error and therefore termination. 16 is used for a catastrophic error (e.g., compiler table overflow).
For a program which might issue several return code values not causing termination, I suggest:
1. at each event of interest, set a flag instead, one for each RC level
2. at normal termination, check the flags in descending order to set the highest flagged RC |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Phrzby Phil wrote: |
I think sometimes 8 is used for an error, but one which a program (e.g., a compiler) has made an assumptive "correction," whereas 12 is used for an "unfixable" error and therefore termination. 16 is used for a catastrophic error (e.g., compiler table overflow). |
That's true for among others the PL/I compilers. However, 12 is not unfixable when you're talking about the old PL/I V2.3 compiler. That compiler is able to generate correct code for some programs with multiple S(evere) messages. I've got a PL/I Quine that generates
- 2 pre-processor 'E' messages,
- 8 compiler 'S' messages,
- 10 compiler 'E' messages,
- 6 compiler 'W' messages, and
- 2 compiler 'I' messages
but the resulting load module does what it should do, print its own source. Enterprise PL/I completely chokes on it...
The source?
Code: |
VIEW PRINO.RAHP.TEXT(QUINE326) - 01.00
Command ===>
****** ********************************************************************* Top of Data ******
000001 %dcl z%z='put edit';proc options(main;q=''''put list(m;do i=1,2;z(q)skip;do j=
000002 1to 78c=substr(m(i),j;if c=q z(c;z(c;end;z(q',';dcl(c,q)char,m(2)char(99)init(
000003 '%dcl z%z=''put edit'';proc options(main;q=''''''''put list(m;do i=1,2;z(q)skip;do j=',
000004 '1to 78c=substr(m(i),j;if c=q z(c;z(c;end;z(q'','';dcl(c,q)char,m(2)char(99)init(',
****** ******************************************************************** Bottom of Data **** |
This is an extreme example, in real life no program than compiles with a compiler return code > 4 should ever be allowed to go into production, and IBM should really change its standard compile procedures to cater for this! |
|
Back to top |
|
|
|