Combining 'N' number of files



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

Combining 'N' number of files

Postby lal » Fri Sep 11, 2009 10:00 am

Hi Friends,
I have 'N' number of files as shown below of LRECL=80 and RECFM=FB

USERID.FILENAME1.FILE
USERID.FILENAME2.FILE
USERID.FILENAME3.FILE
....
....

I have to combine the contents of all these files into one file 'USERID.COMBINED.FILE'. Everyday I have to combine 'N' number of files into a single file.

Can you please suggest a way to do this.

Thanks,
lal
lal
 
Posts: 24
Joined: Thu Aug 13, 2009 10:06 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Combining 'N' number of files

 

Re: Combining 'N' number of files

Postby MrSpock » Fri Sep 11, 2009 3:55 pm

You need to concatenate all of the required input datasets to the one SORTIN DD. What's the issue?
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: Combining 'N' number of files

Postby lal » Fri Sep 11, 2009 7:07 pm

Hi MrSpock,
I guess I was not clear. We have 'N' number of these files 'USERID.FILENAME*.FILE' created by some other process. So we have to manually do 3.4 and get the list of these files and merge them into one file.

So is there any automated process to merge these files.

Thanks,
lal
lal
 
Posts: 24
Joined: Thu Aug 13, 2009 10:06 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Combining 'N' number of files

Postby MrSpock » Fri Sep 11, 2009 9:10 pm

See this previous topic for an example of a technique you can take advantage of. Unless you want to handle this programatically and use some dynamic allocation techniques, you'll need to create the dataset list, format it into proper JCL DD statements, and pass all of that into a second job that will actually use those DD statements.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: Combining 'N' number of files

Postby dick scherrer » Sat Sep 12, 2009 1:01 am

Hello,

So is there any automated process to merge these files.
Merge has a specific meaning. A merge may be done with data that is in a common sequence.

Your requirement does not sound like a merge - it sounds like you simply want to create one file containing all of the data from multiple files in no particular sequence.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Combining 'N' number of files

Postby lal » Sat Sep 12, 2009 2:38 am

MrSpock,
The link you provided was useful and I followed the same approach of building entire SORTIN with the DSN names in a separate step and later included that member in my step to copy the contents of all the DSN's into one combined file.

Dick Scherrer,
I agree with your statement, it's not an merge but just copy of the files.

Thanks,
lal
lal
 
Posts: 24
Joined: Thu Aug 13, 2009 10:06 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Combining 'N' number of files

Postby dick scherrer » Sat Sep 12, 2009 2:55 am

Good to hear it is working - thanks for letting us know :)

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

Re: Combining 'N' number of files

Postby lal » Tue Sep 15, 2009 1:10 am

Hi,
In my earlier reply I mentioned that "I followed the approach of building entire SORTIN with the DSN names in a separate job and later included that member in the different job to copy the contents of all the DSN's into one combined file."

So is there anyway I can build the dynamic SORTIN in the same job.

Thanks,
lal
lal
 
Posts: 24
Joined: Thu Aug 13, 2009 10:06 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Combining 'N' number of files

Postby dick scherrer » Tue Sep 15, 2009 1:20 am

Hello,

Not really as the jcl is parsed when the job starts and is not modified thereafter.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Combining 'N' number of files

Postby lal » Tue Sep 15, 2009 7:56 pm

Thanks Dick Scherrer for the response

Thanks,
lal
lal
 
Posts: 24
Joined: Thu Aug 13, 2009 10:06 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post