IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

using CALL PLIRETC(somevalu)


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed May 09, 2018 10:25 pm
Reply with quote

My return code is somehow being lost. I added PUT statements to both the caller and the called program. The called program sets the return code correctly, but the caller does not get it.

1. PROG1 calls PROG2
2. PROG2 is a MAIN and ends with something like this:
Code:
dcl RETCODE BIN FIXED(31) INIT(0);
retcode = 4;
put data(retcode)
Call PLIRETC(retcode);

3. PROG1 tries to retrieve the return code
Code:
dcl rc   bin fixed(31);
rc = pliretv();
put data(rc);


The called program sets RC=4 but the caller sees RC=0. Is there a trick to doing this?
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Wed May 09, 2018 10:38 pm
Reply with quote

You're doing everything according to the Language Reference, so I'm puzzled. Try bringing both the caller and callee down to the minimum, by using, if your version of the compiler already supports it,

Code:
%do skip;   


%end;

or,
Code:
%if 1 = 2 %then %do;


%end;

if it doesn't, to comment out everything except the PLIRETC/V statements in either.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Call program, directly from panel CLIST & REXX 9
No new posts Batch call online program, EXCI task ... CICS 3
No new posts CSQBGET - Call giving completion code... COBOL Programming 3
No new posts CICS DPL call CICS 6
Search our Forums:

Back to Top