Posted: Mon Mar 21, 2011 8:11 am Post subject: Help on DFSORT
Hi,
I have a requirement where i have two input files of different LRECL.
The output file must have the content of input files as follows
1: 43 content of file1 for first 43 bytes
44:10 content of file2 for the next 10 bytes
54: 6 content file1 for next 6 bytes
60: 9 content of file2 for the next 9 bytes
The content of file1 there after
Please suggest a sort card suggestible for this requirement
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Mon Mar 21, 2011 10:10 am Post subject:
Veera333,
Is there a key to match the 2 files or is it like creating an output record from picking the contents from 1st record of file 1 with the 1st record of file 2 and 2nd record of file 1 with 2nd record of file 2 and so on...?
Please provide the following details.
1. what is the LRECL and RECFM Of both input and output files.
2. Show us a sample of inputs and desired outputs. _________________ Kolusu
www.linkedin.com/in/kolusu
There is no matching key. Both the files are sequential and LREC = 1300 for file 1 and LRECL= 500 for file2.
Small correction in my question, i should not create a new output file.I should replace first record content of file1 to first record of file2 in certain positions and second record content of file1 to second record of file2 and so on.
The file1 field from postions 44 to 53 must be replaced with first 10 bytes of file2
The file1 field from postions 60 to 68 must be replaced with field that is loacted at postion 12 to 20 from file2
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Tue Mar 22, 2011 11:24 am Post subject:
Veera333 wrote:
Small correction in my question, i should not create a new output file.I should replace first record content of file1
Veera333,
It is NOT advisable to overwrite the same input which is used as input. Create a temp dataset with the desired output and then copy it back to the input in another step. The following DFSORT JCL will show you how to create the temp file with the contents from both files.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum