View previous topic :: View next topic
|
Author |
Message |
ravindra reddy
New User
Joined: 21 Jan 2008 Posts: 7 Location: banglore
|
|
|
|
How do you set the return code from the program? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
That depends on the programming language.
In COBOL, you would:
Code: |
MOVE nnnn TO RETURN-CODE. |
where nnnn can be from 0 to 4095. |
|
Back to top |
|
|
ravindra reddy
New User
Joined: 21 Jan 2008 Posts: 7 Location: banglore
|
|
|
|
But what is that RETURN-CODE whether it is register or what? |
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
Hi
ravindra reddy wrote: |
But what is that RETURN-CODE whether it is register or what? |
Yes that is register for the return code |
|
Back to top |
|
|
sri_mf
Active User
Joined: 31 Aug 2006 Posts: 218 Location: India
|
|
|
|
vasanthkumarhb wrote: |
Hi
ravindra reddy wrote: |
But what is that RETURN-CODE whether it is register or what? |
Yes that is register for the return code |
Hi vasanth,
i think this return-code concept is used with sub programs.If the program is excuted successfully we will set the return-code and use in in the main program for other process based on this.Correct me if i am wrong and pls provide other info where it can be used. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
sri_mf wrote: |
i think this return-code concept is used with sub programs.If the program is excuted successfully we will set the return-code and use in in the main program for other process based on this. |
Not always, you might like to MOVE one code to RC in one condition & other in some different condition; as in
Code: |
IF EOF-MYFILEIN
DISPLAY ' PROGRAM XX100 ABEND'
DISPLAY ' MY INPUT FILE IS EMPTY '
MOVE +4003 TO ABDCODE
RETURN-CODE
PERFORM 9999-ABEND
ELSE
IF RECORD-CODE OF MY-INP-RECORD NOT = '00'
DISPLAY ' PROGRAM XX100 ABEND'
DISPLAY ' MY INPUT FILE HEADER IS MISSING'
MOVE +4004 TO ABDCODE
RETURN-CODE
PERFORM 9999-ABEND
END-IF
END-IF. |
Quote: |
Correct me if i am wrong and pls provide other info where it can be used. |
..just searching for an adjective... and other info is above I hope. |
|
Back to top |
|
|
sri_mf
Active User
Joined: 31 Aug 2006 Posts: 218 Location: India
|
|
|
|
Thanks Anuj |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Pleasure is all mine.. |
|
Back to top |
|
|
ravindra reddy
New User
Joined: 21 Jan 2008 Posts: 7 Location: banglore
|
|
|
|
Thanks to all |
|
Back to top |
|
|
|