View previous topic :: View next topic
|
Author |
Message |
subbu1522
New User
Joined: 11 Sep 2008 Posts: 29 Location: USA
|
|
|
|
I have the input file as shown below.
Code: |
20100819HEADER 045213004260 00001650N
20100819120019904521300435900015001 LJ12315973641002
20100819162049204521300498000327101 KR12919753700002
20100819162049104521300498000327101 KR12919753700002
20100819HEADER 045513010260 99911705}
20100819153648104551301027523153502 AO62281263154002
20100819082817304551301027525277401 AO22280773857002
20100819082111204551301027525277401 AO22280773857002
|
RECFM=FB, LRECL=1000
Output file should be
Code: |
20100819HEADER 045213004260 00001650N
20100819120019904521300435900015001 LJ12315973641002
20100819162049204521300498000327101 KR12919753700002
20100819HEADER 045513010260 99911705}
20100819153648104551301027523153502 AO62281263154002
20100819082817304551301027525277401 AO22280773857002
|
There are many headers, In this case only 2 Headers I'm giving. The duplicates only within one header. Header record should not be considered in the sorting criteria.
Thanks,
S1522
I cleaned up this topic so S1522 can start over from the beginning and ask for a proper Syncsort solution.-Kevin. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
S1522, we're going to start this one over. I've cleaned up all of the information that's not relevant since you have Syncsort. Could you please post what release of the product you have so Alissa can provide you with a working solution that's compatible? |
|
Back to top |
|
|
subbu1522
New User
Joined: 11 Sep 2008 Posts: 29 Location: USA
|
|
|
|
Hi Kevin,
Code: |
SYNCSORT FOR Z/OS 1.3.0.0R
|
I have this release of the syncsort.
Thanks,
Subbu. |
|
Back to top |
|
|
Alexis Sebastian
New User
Joined: 04 Mar 2010 Posts: 38 Location: DC
|
|
|
|
Hi Subbu,
Is there any particular key field for the records within the Header reocord?
Since it seems to be the entire record itself as duplicate. |
|
Back to top |
|
|
subbu1522
New User
Joined: 11 Sep 2008 Posts: 29 Location: USA
|
|
|
|
Hi Alex,
Below is the sort criteria.
Code: |
SORT FIELDS=(20,3,CH,A,23,13,CH,A)
|
|
|
Back to top |
|
|
subbu1522
New User
Joined: 11 Sep 2008 Posts: 29 Location: USA
|
|
|
|
Could you please help me on this?
I have the input file as shown below.
RECFM=FB, LRECL=1000
Code: |
20100819HEADER 045213004260 00001650N
20100819120019904521300435900015001 LJ12315973641002
20100819162049204521300498000327101 KR12919753700002
20100819162049104521300498000327101 KR12919753700002
20100819HEADER 045513010260 99911705}
20100819153648104551301027523153502 AO62281263154002
20100819082817304551301027525277401 AO22280773857002
20100819082111204551301027525277401 AO22280773857002
|
Output file should be
Code: |
20100819HEADER 045213004260 00001650N
20100819120019904521300435900015001 LJ12315973641002
20100819162049204521300498000327101 KR12919753700002
20100819HEADER 045513010260 99911705}
20100819153648104551301027523153502 AO62281263154002
20100819082817304551301027525277401 AO22280773857002
|
I have the release given below:
Code: |
SYNCSORT FOR Z/OS 1.3.0.0R
|
The sort criteria given below.
Code: |
SORT FIELDS=(20,3,CH,A,23,13,CH,A)
|
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
can the headers be duplicate. ie. is each header unique ?
Gerry |
|
Back to top |
|
|
venkatesh83be
New User
Joined: 10 Aug 2009 Posts: 12 Location: Chennai
|
|
|
|
Did u use "sum fields=none" to remove duplicates.... |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
It appears that the records are already in sorted order. If this is true, then here are the SyncSort for z/OS control statements that will produce the requested output:
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,SECTIONS=(20,16,
TRAILER3=(1,200,201,200,401,200,601,200,801,200))
/* |
|
|
Back to top |
|
|
subbu1522
New User
Joined: 11 Sep 2008 Posts: 29 Location: USA
|
|
|
|
Hi Alissa,
This is working but it is getting the last record of the detail if there are any duplicates in detail.
How could I get the 1st record of the detail if there are any duplicates in detail.
Example :
Code: |
20100819HEADER 045213004260 00001650N
20100819120019904521300435900015001 LJ12315973641002
20100819162049204521300498000327101 KR12919753700002
20100819162049104521300498000327101 KR12919753700002
20100819HEADER 045513010260 99911705}
20100819153648104551301027523153502 AO62281263154002
20100819082817304551301027525277401 AO22280773857002
20100819082111204551301027525277401 AO22280773857002
|
CURRENT OUPUT
Code: |
20100819HEADER 045213004260 00001650N
20100819120019904521300435900015001 LJ12315973641002
20100819162049104521300498000327101 KR12919753700002
20100819HEADER 045513010260 99911705}
20100819153648104551301027523153502 AO62281263154002
20100819082111204551301027525277401 AO22280773857002
|
OUTPUT should be
Code: |
20100819HEADER 045213004260 00001650N
20100819120019904521300435900015001 LJ12315973641002
20100819162049204521300498000327101 KR12919753700002
20100819HEADER 045513010260 99911705}
20100819153648104551301027523153502 AO62281263154002
20100819082817304551301027525277401 AO22280773857002
|
Please help me.
Thanks in advance! |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
subbu1522,
Quote: |
This is working but it is getting the last record of the detail if there are any duplicates in detail. |
I don't have Syncsort but just throwing out something. Try to use HEADER3 instead of TRAILER3 and see if that works.
Thanks, |
|
Back to top |
|
|
subbu1522
New User
Joined: 11 Sep 2008 Posts: 29 Location: USA
|
|
|
|
I have verified and using the below sort. The Header record is also considered in the SORT. in my case the HEADER records should not be considered in the SORT.
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,SECTIONS=(20,16,
TRAILER3=(1,200,201,200,401,200,601,200,801,200))
/*
|
Please help me. |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
subbu1522 wrote: |
Hi Alissa,
This is working but it is getting the last record of the detail if there are any duplicates in detail.
How could I get the 1st record of the detail if there are any duplicates in detail.
|
Here is a SyncSort for z/OS job that should give you the requested output:
Code: |
//SORT1 EXEC PGM=SORT
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD *
20100819HEADER 045213004260 00001650N
20100819120019904521300435900015001 LJ12315973641002
20100819162049204521300498000327101 KR12919753700002
20100819162049104521300498000327101 KR12919753700002
20100819HEADER 045513010260 99911705}
20100819153648104551301027523153502 AO62281263154002
20100819082817304551301027525277401 AO22280773857002
20100819082111204551301027525277401 AO22280773857002
//SYSIN DD *
SORT FIELDS=COPY
OUTREC OVERLAY=(1001:SEQNUM,1,ZD,RESTART=(20,16))
OUTFIL INCLUDE=(1001,1,ZD,EQ,1),BUILD=(1,1000)
/* |
|
|
Back to top |
|
|
subbu1522
New User
Joined: 11 Sep 2008 Posts: 29 Location: USA
|
|
|
|
Hi Alissa,
I am getting the same problem by using the code you have suggested.
Header record is considered in the sort criteria. One of the HEADER record got deleted while writing to output.
HEADER record will have a word HEADER in the record (Pos 9-14) and it should not be considered in the sort criteria.
Thanks,
Subbu. |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Try changing the OUTFIL statement as follows:
Code: |
OUTFIL INCLUDE=(1001,1,ZD,EQ,1,OR,9,6,CH,EQ,C'HEADER'),
BUILD=(1,1000) |
|
|
Back to top |
|
|
|