Joined: 11 Oct 2007 Posts: 7 Location: Cincinnati, OH
Need to extract parts of 2 different files to create 1 file. All files 800 bytes,
All fields are alphanumeric. InFile1 has only 1 record. InFile2 position 5-20 is unique on each record. So OutFile3 should have same number output records as InFile2. Not sure of how to code a sort/merge to do this.
InFile1
Code:
1234567890123456789012345678901234567890123456789012345678
3210 5569260001718674 6423 Channel St Orange River, DE
InFile2
Code:
1234567890123456789012345678901234567890123456789012345678901
John Smith 5569260001718672 124 Able Drive Cleveland, OH
Edward Jackson5569260001718699 85 Miller St. Cincinnati, OH
Mary Wilson 5569260001718702 8 Fifth St. Boise, ID
Eldon Rogers 5569260001718717 19 Garnett Trail. Kansas City, MO
Needed in File3:
Pos 1-4 Pos 1-4 from File1
Pos 5-20 Pos 16-31 from File2
Pos 21-33 Pos 23-54 from File1
OutFile3
Code:
123456789012345678901234567890123456789012345678901
321055692600017186726423 Channel St Orange River, DE
321055692600017186996423 Channel St Orange River, DE
321055692600017187026423 Channel St Orange River, DE
321055692600017187176423 Channel St Orange River, DE
Joined: 11 Oct 2007 Posts: 7 Location: Cincinnati, OH
Frank - sorry - does this make any more sense?
InFile1
3210 5569260001718674 6423 Channel St Orange River, DE
InFile2
John Smith 5569260001718672 124 Able Drive Cleveland, OH
Edward Jackson 5569260001718699 85 Miller St. Cincinnati, OH
Mary Wilson 5569260001718702 8 Fifth St. Boise, ID
Eldon Rogers 5569260001718717 19 Garnett Trail. Kansas City, MO
OutFile3
321055692600017186726423 Channel St Orange River, DE
321055692600017186996423 Channel St Orange River, DE
321055692600017187026423 Channel St Orange River, DE
321055692600017187176423 Channel St Orange River, DE
Pos 1-4 in Outfile3 should equal Pos 1-4 in File1
Pos 5-20(16 bytes) in OutFile3 should equal Pos 18 for 16 bytes from File2
Pos 21-55 (34 bytes) in OutFile3 should equal Pos 23-57 (34 bytes) from File1
The recfm for InFile1 & InFile2 is FB
The recfm for OutFile3 is FB, Lrecl=800