Syncsort - split records into different files by groups



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Syncsort - split records into different files by groups

Postby bodhi » Sat Mar 28, 2009 11:46 am

Hi is it possible to copy the data until the condition matched. My requirment is that I need to split the data into three different files based on header or trailer condition.File always have 3 header and 3 trailer.

e.g
input file

HEADER 1234
ram
shyam
TRAILER02
HEADER 1234
tom
jack
TRAILER02
HEADER 1234
rohit
bodhi
TRAILER02

output files
file 1

HEADER 1234
ram
shyam
TRAILER02

file 2

HEADER 1234
tom
jack
TRAILER02

file 3

HEADER 1234
rohit
bodhi
TRAILER02

It is possible to do so in sort? Please let me know if you need more clarification.


Thanks
Bodhi
bodhi
 
Posts: 52
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Syncsort - split records into different files by groups

Postby dick scherrer » Sat Mar 28, 2009 8:37 pm

Hello,

Which release of Syncsort is used on your system?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Syncsort - split records into different files by groups

Postby bodhi » Sat Mar 28, 2009 9:37 pm

Hello,

I am using SYNCSORT FOR Z/OS 1.2.2.3R.

Thanks
Bodhi
bodhi
 
Posts: 52
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Syncsort - split records into different files by groups

Postby dick scherrer » Sat Mar 28, 2009 9:57 pm

Hello,

I believe what you want to use is WHEN=GROUP, but you would need to have the current Syncsort release installed (1.3.x).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Syncsort - split records into different files by groups

Postby bodhi » Sat Mar 28, 2009 10:11 pm

Hi Dick,

Thank you for the information.WHEN=GROUP is i know which is not working with this release.Apart form this option is there is any other way to split the file.

Regards
Bodhi
bodhi
 
Posts: 52
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Syncsort - split records into different files by groups

Postby dick scherrer » Sun Mar 29, 2009 3:27 am

Hello,

WHEN=GROUP is i know which is not working with this release
Possibly the current release could be installed?

Apart form this option is there is any other way to split the file.
If it was my requirement and i couldn't get the current release installed now, i'd write code to do what was needed. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Syncsort - split records into different files by groups

Postby arcvns » Wed May 13, 2009 12:23 am

Hello,

Here's a SyncSort 1.2 job which should work for you. I cant test this now.
I have assumed an input/output LRECL=80. You might need to modify it as per your requirement.

//STEP1    EXEC PGM=SORT
//SYSOUT     DD SYSOUT=*
//SORTIN     DD DSN=Input file
//OUT1       DD DSN=Output file1
//OUT2       DD DSN=Output file2
//OUT3       DD DSN=Output file3
//SYSIN      DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(1,6,CH,EQ,C'HEADER'),OVERLAY=(89:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,
        OVERLAY=(97:SEQNUM,8,ZD,89:81,8,ZD,SUB,97,8,ZD,M11,LENGTH=8))
  SORT FIELDS=COPY
  OUTFIL FNAMES=OUT1,INCLUDE=(89,8,ZD,EQ,1),BUILD=(1,80)
  OUTFIL FNAMES=OUT2,INCLUDE=(89,8,ZD,EQ,2),BUILD=(1,80)
  OUTFIL FNAMES=OUT3,SAVE,BUILD=(1,80)
/*

Post back if you come across any issues. Good luck :)
Arun
User avatar
arcvns
 
Posts: 55
Joined: Sat Feb 28, 2009 12:36 am
Location: India
Has thanked: 0 time
Been thanked: 0 time

Re: Syncsort - split records into different files by groups

Postby dick scherrer » Wed May 13, 2009 12:45 am

Hi Arun,

Welcome to the forum :)

Good to "see" you. . .

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Syncsort - split records into different files by groups

Postby arcvns » Wed May 13, 2009 6:18 pm

Thanks Dick. :D
Arun
User avatar
arcvns
 
Posts: 55
Joined: Sat Feb 28, 2009 12:36 am
Location: India
Has thanked: 0 time
Been thanked: 0 time

Re: Syncsort - split records into different files by groups

Postby bodhi » Thu Jun 11, 2009 6:19 pm

Thank you Arun,

It is working fine .

Bodhi.
bodhi
 
Posts: 52
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post