Page 1 of 1

Output records are from which file - How to know?

PostPosted: Mon Jul 06, 2009 8:32 pm
by ranga_subham
Hi,

I have 30 PS files with each file having huge number of records. I need to pull certain records to output file from these 30 input files based on a given criteria. I am able to do it successfully but finding it very difficult to know from which input file these records have come. I tried manual find by opening each file but it is proving very time consuming due to the file size.

Would you please suggest any method using SORT or other utility that gives me a quick solution to this problem :?:

Please help. :? :( :shock:

Thanks.

Re: Output records are from which file - How to know?

PostPosted: Tue Jul 07, 2009 12:09 am
by dick scherrer
Hello,

If you use a separate copy execution for each file, you could append a "file-id" at the beginning or end of each record to identify the file from which the data was pulled.

Re: Output records are from which file - How to know?

PostPosted: Tue Jul 07, 2009 12:35 am
by Alissa Margulies
As Dick had mentioned, if there is no identifying field within the record, then you can pre-process the data sets to add one.
For example, you can use OUTREC to add a corresponding number (01-30) at the end of each record.
//STEP1 EXEC PGM=SORT
//SYSOUT  DD SYSOUT=*
//SORTIN  DD DSN=original.input.file1 (FB/80)
//SORTOUT DD DSN=modified.input.file1 (FB/82)
//SYSIN   DD *
  SORT FIELDS=COPY
  OUTREC OVERLAY=(81:C'01')
/*

For each input data set, change the OVERLAY value (C'02', C'03', ...C'29', C'30').

Re: Output records are from which file - How to know?

PostPosted: Tue Jul 07, 2009 4:12 pm
by ranga_subham
Thank you. So, I will have 30 such steps to apply an identifier on each file. Is not it?

Thanks.

Re: Output records are from which file - How to know?

PostPosted: Tue Jul 07, 2009 7:43 pm
by Alissa Margulies
Yes, that is correct. Unless you can somehow modify the application that created the file originally to include such an identifier...