Page 1 of 1

files fusion

PostPosted: Fri Feb 18, 2011 12:31 am
by pulcinella
Hello.

I have a process that one is he executes all the weekdays and generates several files with the date of the day.
(FILE1.F110103 FILE2. F110104 FILE3. F110105 FILE4. F110107.... The 6th was festive and it was not generated)

I need to do a sort who gathers all these files last day of the week bearing in mind the date in which they were executed and fuses them in the only one

It might do a process with parameters, across the CONTROL - M, which verifies the dates but, I know that exist a utility that allows to take all the files that start by a certain cualificador and fuses them ((in example FILE*.)

I used it but I don't remember know Might you help me or say me that utility or command is?

Thank you very much

Re: files fusion

PostPosted: Fri Feb 18, 2011 1:49 am
by NicC
The term is 'MERGE' not fusion. Do you just want the files as one file with the records in the same sequence as they are in the original files or do you want them sorted? If you want them sorted the just concatenate them on your SORTIN DD statement otherwise just concaenate them on your SYSUT1 statement into IEBGENER.

Re: files fusion

PostPosted: Fri Feb 18, 2011 2:17 am
by Frank Yaeger
pulcinella,

I know that exist a utility that allows to take all the files that start by a certain qualifier and fuses them ((in example FILE*.)


I can't help you with that. But I can clarify DFSORT terminology.

A MERGE requires sorted files as input; it produces a "merged" file as output. It uses SORTINnn DD statements for the input files.

A SORT does not require sorted files as input; it produces a "sorted" file as output. It uses a SORTIN DD statement for the input file (can contain concatenated files).

A COPY does not require sorted files as input; it produces an "unsorted" file as output. It uses a SORTIN DD statement for the input file (can contain concatenated files).

A JOIN "joins" two files on a key.

Re: files fusion

PostPosted: Fri Feb 18, 2011 2:21 am
by dick scherrer
Hello,

Or use your sort to copy them as a concatenated SORTIN collection of files. To do this or use IEBGENER, each dataset name would need to be specified in the jcl.

If you want to use a wildcard (FILE*) regular JCL will not do this. ADRDSSU does this, but the output is not a single, usable file. It is a "backup file".

One easy to do what you want is to do a listcat and create the needed concatenation from the dataset names returned by the listcat.

Re: files fusion

PostPosted: Fri Feb 18, 2011 4:38 am
by pulcinella
I think that I don't explain.

I know (because I used it by JCL but I don't remember) that I can SORT (not MERGE excuse me) several files in spite of all that do not know am going to have. In only one step one I could do the sort without knowing the number of files of entry that it was going to have. If I do not remember badly it was done by means of a first qualifiers and was ending in a script "-". I didn't use many DD statement; I only used one DD statement which includes an undetermined number of files. Only I can said that was similar at LISTCAT command.

I try to remember as I did.

Thanks and excuse me

Re: files fusion

PostPosted: Fri Feb 18, 2011 8:37 am
by dick scherrer
Hello,

One way to do this is to specify the gdg base of a generation dataset. If the base is specified on a dd statement, all of the generations are read as a single file.

Another is if your organization has some home-written or purchased utility that offers this functionality.

If this is something that would be useful, you could implement your own by generating the needed input concatenation dd and using this as inpout to the run.

Good luck :)

Re: files fusion

PostPosted: Mon Feb 21, 2011 6:17 pm
by pulcinella
Thank you for your answer.

Possibly had a utility that did that. Try to find out.
Meanwhile I would be useful to know if I can do a sort with several DD without knowing whether or not a file.
I mean, if I do a SORT and one of the files did not exist I think I would give an error. How I can solve this without having to check if the file exists or not? "I can use the ICETOOL or another utility to do the check for me?. No need to tell me the exact code, just tell me the command or manual where I can read it.
Best regards and excuse me
Pulcinella

Re: files fusion

PostPosted: Tue Feb 22, 2011 1:18 am
by dick scherrer
Hello,

I mean, if I do a SORT and one of the files did not exist I think I would give an error.
Yes, if you specify a dataset name on a dd statement as input and the dataset does not exist, there will be a jcl error and the job flushed. . .

No need to tell me the exact code, just tell me the command or manual where I can read it
As i mentioned before:
One easy to do what you want is to do a listcat and create the needed concatenation from the dataset names returned by the listcat.