Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
IBM Mainframe Forum 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

Senior Member

Joined: 01 Sep 2006
Posts: 2136
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:
retcode = 4;
put data(retcode)
Call PLIRETC(retcode);

3. PROG1 tries to retrieve the return 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


Senior Member

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

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,

%do skip;   


%if 1 = 2 %then %do;


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 Difference between GE and GB return c... Poha Eater IMS DB/DC 8 Fri Jul 12, 2019 12:59 pm
No new posts Call DB2 user defined function from C... Ziko13 DB2 5 Thu Mar 14, 2019 4:46 pm
No new posts How to resolve sqlcode of CALL ATTACH... maxsubrat DB2 3 Fri Feb 22, 2019 11:54 am
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

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