Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
using CALL PLIRETC(somevalu)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Pedro

Senior Member


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

PostPosted: Wed May 09, 2018 10:25 pm    Post subject: using CALL PLIRETC(somevalu)
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: 1117
Location: Oostende, Belgium

PostPosted: Wed May 09, 2018 10:38 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Can we call QMF proc from REXX ? batu544 CLIST & REXX 6 Fri Aug 03, 2018 11:03 am
No new posts Call COBOL or PLI with a click from w... vaibhav gs All Other Mainframe Topics 1 Mon Apr 16, 2018 7:29 pm
No new posts Print call stack in Mainframe C DIPANKAR SAHA ABENDS & Debugging 2 Thu Mar 15, 2018 2:58 pm
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us