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

Return code 16 with PLISRTD


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

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Mon Jan 05, 2009 2:58 pm
Reply with quote

Hi,

I am using PLISRTD sort in my PL/I program to sort an input file and write the output in the SPOOL.

Logic I used:
Input procedure - will read a file into an array.
Output procedure - will print the output in SPOOL.

I referred the following site,
publib.boulder.ibm.com/infocenter/pdthelp/v1r1/index.jsp?topic=/com.ibm.entpli6.doc/sort-yyy.htm
for the syntax and usage of PLISRTD. However I am getting return code of 16 which am unable to debug. Please help me to understand where the problem is. My code below -

I = 0;
CALL PLISRTD ('SORT FIELDS=(19,6,CH,D)',
'RECORD TYPE=F, LENGTH=(100)',
1048576,
RETCODE,
GET_INPUT,
PRINT_OUTPUT);

SELECT(RETCODE);
WHEN(0) PUT SKIP EDIT
('SORT COMPLETE RETURN_CODE 0') (A);
WHEN(20) PUT SKIP EDIT
('SORT MESSAGE DATASET MISSING ') (A);
OTHER PUT SKIP EDIT
('INVALID RETURN_CODE = ', RETCODE) (A,F(2));
END /* SELECT */;
CALL PLIRETC(RETCODE);
PUT SKIP LIST('END OF PLISORT');

GET_INPUT: PROC RETURNS(CHAR(100));

DCL INFIELD(50) CHAR(100);
I = I + 1;
ON ENDFILE(SFILE) BEGIN;
PUT SKIP LIST('END OF FILE');
CALL PLIRETC(8);
GOTO STOP_READ;
END;
READ FILE(SFILE) INTO (INFIELD(I));
DO;
PUT SKIP LIST(INFIELD(I));
PUT SKIP LIST('GET_INPUT REACHED');
CALL PLIRETC(12);
RETURN(INFIELD(I));
END;

STOP_READ:
END GET_INPUT;

PRINT_OUTPUT: PROC(INREC);

DCL INREC CHAR(100);
PUT SKIP LIST (INREC);
PUT SKIP LIST('PRINT_OUTPUT REACHED');
CALL PLIRETC(4);

END PRINT_OUTPUT;
Back to top
View user's profile Send private message
km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Mon Jan 05, 2009 3:05 pm
Reply with quote

The site mentioned above may not open properly. I actually searched in
publib.boulder.ibm.com/infocenter/pdthelp/v1r1/topic/com.ibm.entpli.doc_3.7/ibma1mst342.htm

This is correct URL.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Mon Jan 05, 2009 3:10 pm
Reply with quote

Hi Mohamed,

Please post the complete error info along with mentioning RC 16.
Back to top
View user's profile Send private message
km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Mon Jan 05, 2009 3:29 pm
Reply with quote

Hi Gnanas,

I am not getting any error message in the spool. As per the code i only get the following in spool -

CTRL BEFORE PLISRT
INVALID RETURN_CODE = 16
END OF PLISORT

Or do you want me to look into JESSYSMSG or look for any error message. Am not able to find any useful clue from the spool.
Please advise.

Regards
Mohamed
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Tue Jan 06, 2009 2:29 pm
Reply with quote

Hi Mohamed,

Why do you use an array, ie, INFIELD(50) in GET_INPUT procedure?

It ran fine while coding with out that array.

I think there is no need to use that array.

Please let me know what you are looking for.
Back to top
View user's profile Send private message
km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Wed Jan 07, 2009 9:48 am
Reply with quote

Dear Gnanas,

As per our discussions thru PMs it worked fine now after following your advise. Thanks a ton for reviewing my code and all the help/support. Highly appreciated.

Cheers
Mohamed
Back to top
View user's profile Send private message
km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Wed Jan 07, 2009 10:43 am
Reply with quote

Hi all,

This post is to make all forum members aware of what the problem i faced and how it was solved.

The changes i made to my code posted above are -

1. Removing a space between 'RECORD TYPE=FB and LENGTH=(100)',

2. Removing of array from 'INFIELD' variable.

It ended fine after these changes.

Cheers..
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jan 07, 2009 11:30 am
Reply with quote

Good to hear it is working icon_smile.gif

Thank you for posting the solution - it will help someone else some other time.


Hi Gnanas,

Thanks for the extra effort icon_smile.gif

d
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top