Dynamic Splitting of files



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

Dynamic Splitting of files

Postby ratheesh2011 » Tue Mar 22, 2011 9:14 am

Hi ,

I have a requirement as below.

My input file looks like below

line-1
line-2
line-3
$$$
line-4
line-5
$$$
line-6
line-7
line-8
line-9
$$$
line-10
line-11
line-12
$$$

I have to split this file into multiple files,
FIle-1
----------
line-1
line-2
line-3

FIle-2
----------
line-4
line-5

FIle-3
----------
line-6
line-7
line-8
line-9

FIle-4
----------
line-10
line-11
line-12

The input file can have many sets of records ( here it is 4 sets ) , it can be dynamic. The file has to be splitted by the delimiter '$$$' at the 1st 3 chars.
Please help me to get a solution for this.

Thanks
Ratheesh
ratheesh2011
 
Posts: 2
Joined: Tue Mar 22, 2011 8:56 am
Has thanked: 0 time
Been thanked: 0 time

Re: Dynamic Splitting of files

Postby NicC » Tue Mar 22, 2011 11:04 am

And I suppose there can be up to 2000 output files as per the topic on the other board?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Dynamic Splitting of files

Postby BillyBoyo » Tue Mar 22, 2011 1:17 pm

Nah, 2000? Then read each, and know that you read once and only once, of those and do "something". Just sounds silly. You'll have to make your output more complicated to keep your later inputs manageable. Or do it on Unix/PC so we someone else has to wonder what you are doing...

Do you have a real requirement? If you explain, perhaps we can suggest something. Although perhaps we won't if you're already getting other people to look at this for you (you think!).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Dynamic Splitting of files

Postby enrico-sorichetti » Tue Mar 22, 2011 1:24 pm

the topic looks dangerously like

http://ibmmainframes.com/about53891.html
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Dynamic Splitting of files

Postby BillyBoyo » Tue Mar 22, 2011 1:44 pm

Can I suggest the dataset names?

After your standard high-level stuff, put "HAHA.GOTYOU.STORAGE.TEAM.Vxxxxxx". Where Vxxxxxx is unique, per write if possible in SORT, and should give them a good scare that more are on the way. Make them GDGs as well.

If you want to screw up OPS instead, put them all to tape. Leave them as GDGs if you think the storage people deserve a little something.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Dynamic Splitting of files

Postby Alissa Margulies » Tue Mar 22, 2011 10:28 pm

ratheesh2011 wrote:it can be dynamic. The file has to be splitted by the delimiter '$$$' at the 1st 3 chars.

SyncSort cannot dynamically generate the DD statements required for the output files.
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times

Re: Dynamic Splitting of files

Postby ratheesh2011 » Wed Mar 23, 2011 3:54 am

Thanks for your replies.
Or I want to get my input to be splitted into 2 files as below,

File-1
----------
line-1
line-2
line-3

File-2
-----------
line-4
line-5
$$$
line-6
line-7
line-8
line-9
$$$
line-10
line-11
line-12
$$$

I think we can make possible this by WHEN=GROUP. But I don't know how. Please help me to get this resolved.
ratheesh2011
 
Posts: 2
Joined: Tue Mar 22, 2011 8:56 am
Has thanked: 0 time
Been thanked: 0 time

Re: Dynamic Splitting of files

Postby Alissa Margulies » Mon Apr 04, 2011 10:24 pm

This will split the input into 2 files:
//SORT1  EXEC PGM=SORT
//SORTIN   DD DISP=SHR,DSN=INPUT.FILE.FB80               
//SORTOF01 DD SYSOUT=*
//SORTOF02 DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *                                                 
  INREC IFTHEN=(WHEN=GROUP,END=(1,3,CH,EQ,C'$$$'),PUSH=(81:ID=1))
  SORT FIELDS=COPY                                               
  OUTFIL FILES=01,INCLUDE=(81,1,ZD,EQ,1),BUILD=(1,80)           
  OUTFIL FILES=02,SAVE,BUILD=(1,80)                             
/*       

SORTOF01 contains the following records:
LINE-1
LINE-2
LINE-3
$$$   

SORTOF02 contains the following records:
LINE-4
LINE-5
$$$   
LINE-6
LINE-7
LINE-8
LINE-9
$$$   
LINE-10
LINE-11
LINE-12
$$$   
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post