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: 2214
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
Warnings : 1

Senior Member


Joined: 07 Feb 2009
Posts: 1241
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 Call Natural program with rexx CLIST & REXX 2
No new posts CALL statement in COBOL for VSE COBOL Programming 3
No new posts Need example for CALL 'ISRSUPC' in COBOL COBOL Programming 2
No new posts trigger enter key automatically call ... CICS 17
No new posts Call a transaction simulator froma st... IMS DB/DC 0
Search our Forums:

Back to Top