Posted: Thu May 13, 2004 2:02 am Post subject: Multiple output files in Sort
Hi all,
The requirement is to split an Input in to two different files with 2 different conditions . I have used two SORTOFxx statements(output files)
and 1 SYSIN which contains the following statements....
SYSIN parameters
-------------------
OUTFIL FILES=01
INREC FIELDS=(1:1,4,5:21,5,10:C'0000000001')
SORT FIELDS=(5,5,CH,A)
SUM FIELDS=(10,10,ZD)
OUTREC FIELDS=(1:5,5,25:10,10),CONVERT
OUTFIL FILES=02
INREC FIELDS=(1:1,4,5:240,9,14:C'0000000001')
SORT FIELDS=(5,9,CH,A)
SUM FIELDS=(14,10,ZD)
OUTREC FIELDS=(1:5,5,25:10,10),CONVERT
The Syncsort abending. Its displaying duplicate INREC,SORT,SUM statements!!!
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
Posted: Thu May 13, 2004 3:54 am Post subject:
Well, indeed.
I hope the following is true for Syncsort as I am a DFSORT user.
INREC processes all records before any COPY/SORT processing. OUTFIL is for after SORT processing. So, your OUTFIL statements must follow the INREC and SORT statements. You cannot have duplicate SORT and INREC statements.
I would suggest you to use SYNCTOOL where you can prepare the datasets in two passes. You can use the two sets of OUTFIL statements separately. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Thu May 13, 2004 4:15 am Post subject:
Krismadras,
You cannot use an inrec,sort,sum on outfil statement. You need two seperate steps to achieve the desired results as you want to find counts on 2 different fields. The following Jobs will give you the desired results.
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT VB FILE,
// DISP=SHR
//SORTOUT DD DSN=YOUR OUTPUT COUNT FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y,),RLSE)
//SYSIN DD *
INREC FIELDS=(1:1,4, $ RDW
5:21,5, $ KEY FROM 21 POS FOR LENGTH OF 5
10:C'0000000001') $ CONSTANT OF 1 AT POS 10
SORT FIELDS=(5,5,CH,A) $ SORT ON KEY
SUM FIELDS=(10,10,ZD) $ SUM ON CONSTANT
OUTREC FIELDS=(1:5,5, $ KEY
25:10,10), $ TOTAL COUNT
CONVERT $ CONVERT INPUT VB FILE TO FB FILE
Code:
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT VB FILE,
// DISP=SHR
//SORTOUT DD DSN=YOUR OUTPUT COUNT FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y,),RLSE)
//SYSIN DD *
INREC FIELDS=(1:1,4, $ RDW
5:240,9, $ KEY FROM 240 POS FOR LENGTH OF 9
14:C'0000000001') $ CONSTANT OF 1 AT POS 14
SORT FIELDS=(5,9,CH,A) $ SORT ON KEY
SUM FIELDS=(14,10,ZD) $ SUM ON CONSTANT
OUTREC FIELDS=(1:5,9, $ KEY
25:10,10), $ TOTAL COUNT
CONVERT $ CONVERT INPUT VB FILE TO FB FILE
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Thu May 13, 2004 9:49 am Post subject:
Krismadras,
Quote:
Intially we had the same thought.... but seems to be too lengthy thats why I posted a question for an alternate solution.
Your first post did not mention any thing about alternate solution. your description of the problem when compared to your control cards is quite different. So please follow rule # 4 (Post detailed information on what you're trying to accomplish. Do not make people guess what you mean. This will give you a much better chance of getting a good answer to your question.)
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