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
 

 

Syncsort - Exclude headers from sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
subbu1522

New User


Joined: 11 Sep 2008
Posts: 29
Location: USA

PostPosted: Fri Aug 20, 2010 4:24 pm    Post subject: Syncsort - Exclude headers from sort
Reply with quote

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
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Aug 27, 2010 5:56 am    Post subject: Reply to: Syncsort - Exclude headers from sort
Reply with quote

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
View user's profile Send private message
subbu1522

New User


Joined: 11 Sep 2008
Posts: 29
Location: USA

PostPosted: Fri Aug 27, 2010 8:26 am    Post subject:
Reply with quote

Hi Kevin,

Code:
SYNCSORT FOR Z/OS  1.3.0.0R


I have this release of the syncsort.

Thanks,
Subbu.
Back to top
View user's profile Send private message
Alexis Sebastian

New User


Joined: 04 Mar 2010
Posts: 38
Location: DC

PostPosted: Fri Aug 27, 2010 12:15 pm    Post subject:
Reply with quote

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
View user's profile Send private message
subbu1522

New User


Joined: 11 Sep 2008
Posts: 29
Location: USA

PostPosted: Fri Aug 27, 2010 5:56 pm    Post subject:
Reply with quote

Hi Alex,

Below is the sort criteria.

Code:

  SORT FIELDS=(20,3,CH,A,23,13,CH,A)
Back to top
View user's profile Send private message
subbu1522

New User


Joined: 11 Sep 2008
Posts: 29
Location: USA

PostPosted: Tue Aug 31, 2010 8:07 pm    Post subject: Syncsort - Exclude headers from sort
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Sep 01, 2010 7:32 am    Post subject:
Reply with quote

Hi,

can the headers be duplicate. ie. is each header unique ?


Gerry
Back to top
View user's profile Send private message
venkatesh83be

New User


Joined: 10 Aug 2009
Posts: 12
Location: Chennai

PostPosted: Wed Sep 01, 2010 7:54 am    Post subject: Reply to: Syncsort - Exclude headers from sort
Reply with quote

Did u use "sum fields=none" to remove duplicates....
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Thu Sep 02, 2010 2:30 am    Post subject:
Reply with quote

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
View user's profile Send private message
subbu1522

New User


Joined: 11 Sep 2008
Posts: 29
Location: USA

PostPosted: Tue Sep 14, 2010 9:24 pm    Post subject:
Reply with quote

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
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Tue Sep 14, 2010 11:26 pm    Post subject:
Reply with quote

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
View user's profile Send private message
subbu1522

New User


Joined: 11 Sep 2008
Posts: 29
Location: USA

PostPosted: Wed Sep 15, 2010 12:34 am    Post subject:
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Sep 15, 2010 2:41 am    Post subject:
Reply with quote

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
View user's profile Send private message
subbu1522

New User


Joined: 11 Sep 2008
Posts: 29
Location: USA

PostPosted: Wed Sep 15, 2010 6:34 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Sep 15, 2010 8:49 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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