Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Return code 16 with PLISRTD

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Return code 16 with PLISRTD
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,
http://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    Post subject: Reply to: Return code 16 with PLISRTD
Reply with quote

The site mentioned above may not open properly. I actually searched in
http://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: 788
Location: Chennai, India

PostPosted: Mon Jan 05, 2009 3:10 pm    Post subject:
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    Post subject:
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: 788
Location: Chennai, India

PostPosted: Tue Jan 06, 2009 2:29 pm    Post subject:
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    Post subject: It's done..
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    Post subject:
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

Site Director


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

PostPosted: Wed Jan 07, 2009 11:30 am    Post subject: Reply to: Return code 16 with PLISRTD
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    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 Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us