View previous topic :: View next topic
|
Author |
Message |
PORYES
New User
Joined: 04 Apr 2007 Posts: 38 Location: Chennai
|
|
|
|
Hello,
I want to split my input file into multiple o/p files.
Input file has thousands of records.
I want to split in to 15000 record in to one O/P1 and other 15000 to O/P2 and so on.. But before splitting the file I want to check the last record is NOT "A" at first position.
I/P contains
A 2013
1234
B 21222
-
0 11221 TOTAL AMPUNT 2110.22
A12 2013
2235
B 41222
0 1111TOTAL AMPUNT 543.22
A02 2013
My outout should be
O/P1
A 2013
1234
B 21222
-
0 11221 TOTAL AMPUNT 2110.22
O/P2
A12 2013
2235
B 41222
0 1111TOTAL AMPUNT 543.22
O/P3
A02 2013
record format - FBA
lrecl-133
Can anyone suggest me how to acheive this using sort, icetool
thanks! |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
Back to top |
|
|
PORYES
New User
Joined: 04 Apr 2007 Posts: 38 Location: Chennai
|
|
|
|
Hi Bill,
I'm not not clear that will satisfy my requirement.
My input has thousands of records...
For eg:
Input
A 2013
1234
B 21222
blanks
-
A 2013
1234
B 21222
o
blanks
A 2013
1234
B 21222
And want to split each out put should have 15000, while splitting It has to split the before record "A". While checking the condition the output doesn't have exactly 15000. but it should close to 15000, ie 14990 to 15100. The last output file should contain the rest of the records.. But the first record should start with "A"
Hope its clear.. Any help is appreciated.. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well, how about becoming clear whether it will satisfy your requirement? What is it specifically which makes you think it won't?
"Split a file but keeping groups together" seems to be what you want. |
|
Back to top |
|
|
PORYES
New User
Joined: 04 Apr 2007 Posts: 38 Location: Chennai
|
|
|
|
I want the first 15000 records in OUT1 but the last record shouldn't be "A" record. Next 15000 in OUT2 but the first record should be "A" record. |
|
Back to top |
|
|
PORYES
New User
Joined: 04 Apr 2007 Posts: 38 Location: Chennai
|
|
|
|
Ran using the sort card and I'm getting the below error.
OPTION COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(134:SEQNUM,8,ZD)),
IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,5),PUSH=(144:139,4))
*
OUTFIL FILES=01,INCLUDE=(144,4,ZD,EQ,00),BUILD=(1,133)
OUTFIL FILES=02,INCLUDE=(144,4,ZD,EQ,01),BUILD=(1,133)
OUTFIL FILES=OV,SAVE,BUILD=(1,133)
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Any help |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Please post the entire body of SYSOUT messages in Code tags. |
|
Back to top |
|
|
PORYES
New User
Joined: 04 Apr 2007 Posts: 38 Location: Chennai
|
|
|
|
Here is the entire jcl
Code: |
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=my.dataset.name,DISP=SHR
//SORTOF01 DD SYSOUT=*
//SORTOF02 DD SYSOUT=*
//SORTOFOV DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(134:SEQNUM,10,ZD)),
IFTHEN=(WHEN=GROUP,BEGIN=(1,5),PUSH=(144:139,4))
OUTFIL FILES=01,INCLUDE=(144,4,ZD,EQ,00),BUILD=(1,133)
OUTFIL FILES=02,INCLUDE=(144,4,ZD,EQ,01),BUILD=(1,133)
OUTFIL FILES=OV,SAVE,BUILD=(1,133) |
error is
Code: |
WER251A INCLUDE/OMIT INVALID FORMAT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
and the version is SYNCSORT 1.4.0.
Pls let me know if any additional details required.
Code'd |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I can't see anything wrong with either of the INCLUDEs, but your BEGIN is malformed. You have taken a DFSORT KEYBEGIN and chopped off the word KEY, I think.
SyncSort doesn't have KEYBEGIN. If you need to emulate it, look at SEQNUM with RESTART= |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
I think there is another error you are not showing.
Gerry |
|
Back to top |
|
|
PORYES
New User
Joined: 04 Apr 2007 Posts: 38 Location: Chennai
|
|
|
|
Is there a way I can extract multiple blocks,
ie 1 st record to 15000, and check the last record before write? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Yes. You've made a start.
You make a sequence number for each record.
You make a GROUP using BEGIN= with the value "A". For this you PUSH the sequence number on to each record of the group.
You use the PUSHed sequence number in the OUTFILs for selection.
If the 15,000th is an A, all records of that group will have the PUSHed sequence number as 15000. |
|
Back to top |
|
|
|