Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
How do you set the return code from the program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions
Author Message
ravindra reddy

New User


Joined: 21 Jan 2008
Posts: 7
Location: banglore

PostPosted: Thu Apr 17, 2008 10:49 am    Post subject: How do you set the return code from the program
Reply with quote

How do you set the return code from the program?
Back to top
View user's profile Send private message
References
PostPosted: Thu Apr 17, 2008 10:49 am    Post subject: Re: How do you set the return code from the program Reply with quote

dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 7455
Location: 221 B Baker St

PostPosted: Thu Apr 17, 2008 11:06 am    Post subject:
Reply with quote

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
View user's profile Send private message
ravindra reddy

New User


Joined: 21 Jan 2008
Posts: 7
Location: banglore

PostPosted: Thu Apr 17, 2008 11:37 am    Post subject:
Reply with quote

But what is that RETURN-CODE whether it is register or what?
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 298
Location: Bang,iflex

PostPosted: Thu Apr 17, 2008 11:42 am    Post subject:
Reply with quote

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
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 168
Location: At my Desk

PostPosted: Thu Apr 17, 2008 12:12 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj D.

Senior Member


Joined: 22 Apr 2006
Posts: 1638
Location: Mumbai, India

PostPosted: Thu Apr 17, 2008 12:47 pm    Post subject:
Reply with quote

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... icon_smile.gif and other info is above I hope.
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 168
Location: At my Desk

PostPosted: Thu Apr 17, 2008 1:05 pm    Post subject:
Reply with quote

Thanks Anuj icon_biggrin.gif
Back to top
View user's profile Send private message
Anuj D.

Senior Member


Joined: 22 Apr 2006
Posts: 1638
Location: Mumbai, India

PostPosted: Thu Apr 17, 2008 1:31 pm    Post subject:
Reply with quote

Pleasure is all mine.. icon_wink.gif
Back to top
View user's profile Send private message
ravindra reddy

New User


Joined: 21 Jan 2008
Posts: 7
Location: banglore

PostPosted: Thu Apr 17, 2008 2:33 pm    Post subject:
Reply with quote

Thanks to all icon_smile.gif
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions All times are GMT + 6 Hours
Page 1 of 1