Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
I want to sort above two files and write it to File2
in the following layout
It appears from your example that you are NOT sorting - you're just copying Data1 after Data2 and keeping the Header2 and Footer2 records.
You need to show a better example of your actual input records and what you want for output. Give the RECFM and LRECL of the input files. Give the starting position, length and format of all relevant fields.
Is there something in the headers and footers that identify them (e.g. 'H' in position 1 for header and 'T' in position 1 for footer)?
Do you actually want to sort on some field in the data records, or do you just want to copy them in their original order with the Data1 records after the Data2 records?
Thanks a lot for the response.
I am Extremely sorry if my description regarding the problem was not apt.
You are right, as i want to do a copy operation between two files.I put in the DFSORT Forum as i thought Sort utility will be best used for the purpose.
Header records are identified by Low-values after postion 5 and header records are identified by High-values after 5th Postion in the Record of 100 LRECL.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assume by "low values after position 5", you mean X'00' in position 6, and that by "high values after 5th position", you mean X'FF' in position 6. If not, change the OMIT conditions appropriately. //OUT must be a MOD data set or SYSOUT=*.