MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

calling DFSORT from a PLI program

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
mfuser
Banned


Joined: 01 Mar 2005
Posts: 105
Topics: 58

PostPosted: Wed Jun 14, 2006 8:20 am    Post subject: calling DFSORT from a PLI program Reply with quote

Members,

I am trying to call DFSORT from a PLI program and i am unable to get my desired results:

I am getting my program getting successfully compiled but when i run the program i am unable to get desired output.
I am passing INCLUDE CONDITION in SORTCNTL statement and in the program specifying the SORT conditions,Record statement as well Maximum Storage size also.

My Code:
[code:1:b527796c2f]
/*PROGRAM TO SORT USING PLI */
/*********************************************************************/
/* PROGRAM NAME : SORTPGM */
/* DESCRIPTION : PROGRAM TO SORT */
/* INPUT : INPUT DATASET */
/* OUTPUT : OUTPUT DATASET */
/*********************************************************************/
SORTPGM:PROCEDURE OPTIONS(MAIN);
DCL INP FILE INPUT RECORD,
OUT FILE OUTPUT RECORD;
DCL 1 MASTER_RECORD,
5 BTITLE CHAR(75),
5 LASTNAME CHAR(15),
5 FIRSTNAME CHAR(15),
5 PUBLISHER CHAR(04),
5 DEPT CHAR(05),
5 NUMBER CHAR(05),
5 CNAME CHAR(25),
5 ILNAME CHAR(15),
5 IINITIAL CHAR(02),
5 NUMSTOCK BIN FIXED(31),
5 NUMSOLD BIN FIXED(31),
5 PRICE BIN FIXED(31);
DCL 1 MASTER_OUT_RECORD CHAR(173) INIT(' ');
OPEN FILE(INP) INPUT,
FILE(OUT) OUTPUT;
DCL RETURN_CODE FIXED BIN(31,0);
DCL MAXSTOR FIXED BIN(31,0);
UNSPEC(MAXSTOR)='00000000'B||UNSPEC('MAX');
DCL IN_EOF BIT(1) INIT('0'B);
ON ENDFILE(INP) IN_EOF = '1'B;
READ FILE(INP) INTO(MASTER_RECORD);
DO WHILE (
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Wed Jun 14, 2006 8:34 am    Post subject: Reply with quote

Quote:

ICE067I K INVALID PARAMETER IN JCL EXEC PARM OR INVOKED PARM LIST
ICE000I I - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 12:20 ON TUE JUN
INCLUDE COND=(110,4,EQ,C'ENGL')
ICE146I J END OF STATEMENTS FROM SORTCNTL - PARAMETER LIST STATEMENTS FOLLOW
SORT FIELDS=(1,75,CH,A)
RECORD TYPE=F,LENGTH=(173)
OPTION MAINSIZE=MAX,SORTDD=SORT
ICE018A 3 INVALID FORMAT
ICE052I J END OF DFSORT
SORT FAILED

mfuser,

You are NOT passing the format of the data on the include statement. Your include statement should be
Quote:

INCLUDE COND=(110,4,CH,EQ,C'ENGL')


Fix that and re-run your program

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mfuser
Banned


Joined: 01 Mar 2005
Posts: 105
Topics: 58

PostPosted: Wed Jun 14, 2006 1:39 pm    Post subject: Reply with quote

Kolusu,

Thanks for your reply and i am learning a lot from your replies.But i am unable to get any data in my output dataset.As i had mentioned earlier i am not coding a proper write statement :
Code:

OUTPUT:PROCEDURE;                             
   WRITE FILE(OUT) FROM(MASTER_OUT_RECORD);
END;                                           

MASTER_OUT_RECORD is not getting populated any values as a result it will be blanks only.How can i form my output record after calling CALL PLISRTA i mean what would be the move statement like.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Jun 14, 2006 2:28 pm    Post subject: Reply with quote

I'm not a PL/I programmer, but as I understand it, PLISRTA reads all of the records from SORTIN, sorts them, and writes all of the sorted records to SORTOUT. I don't think you can mix READ and WRITE statements with the use of PLISRTA as you're trying to do.

Perhaps the following documentation will help you understand the various PLISRTx routines and how they are used:

http://publib.boulder.ibm.com/infocenter/pdthelp/v1r1/index.jsp?topic=/com.ibm.entpli3.doc/ibma1mst290.htm
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Wed Jun 14, 2006 2:54 pm    Post subject: Reply with quote

Frank,

You are correct in your wordings that PLISRTA reads in the SORTIN Dataset and produces SORTOUT Dataset and we should not be coding any file concepts as Mfuser is doing so in the pgm.

Mfuser try this code:
[code:1:8f23e01f4e]
/*PROGRAM TO SORT USING PLI */
/*********************************************************************/
/* PROGRAM NAME : SORTPGM */
/* DESCRIPTION : PROGRAM TO SORT */
/* INPUT : INPUT DATASET */
/* OUTPUT : OUTPUT DATASET */
/*********************************************************************/
SORTPGM:PROCEDURE OPTIONS(MAIN);
DCL 1 MASTER_RECORD,
5 BTITLE CHAR(75),
5 LASTNAME CHAR(15),
5 FIRSTNAME CHAR(15),
5 PUBLISHER CHAR(04),
5 DEPT CHAR(05),
5 NUMBER CHAR(05),
5 CNAME CHAR(25),
5 ILNAME CHAR(15),
5 IINITIAL CHAR(02),
5 NUMSTOCK BIN FIXED(31),
5 NUMSOLD BIN FIXED(31),
5 PRICE BIN FIXED(31);
DCL RETURN_CODE FIXED BIN(31,0);
DCL MAXSTOR FIXED BIN(31,0);
UNSPEC(MAXSTOR)='00000000'B||UNSPEC('MAX');
CALL PLISRTA(' SORT FIELDS=(1,75,CH,A) ',
' RECORD TYPE=F,LENGTH=(173) ',
MAXSTOR,
RETURN_CODE);
IF RETURN_CODE
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Wed Jun 14, 2006 3:04 pm    Post subject: Reply with quote

Frank and shekhar have already provided the answer. I suggest that you go thru this link which explains in detail with examples of invoking sort via PLI

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/C2714572/12.1.4?DT=20020918091353

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group