Posted: Tue Nov 11, 2025 10:51 am Post subject: Merging records from two datasets based Primary and secondar
Requirement is to match from file1 and file2
Matching criteria for File1 field1 positions 1-5,field2 16-20, field3 positions 21-24
if no match found with field1 positions 1-5, we have to match with 11-15
Joined: 26 Nov 2002 Posts: 12397 Topics: 75 Location: San Jose
Posted: Tue Nov 11, 2025 11:39 am Post subject:
Suchay,
You have been member for a long time and you still miss providing the basic information like what are the DCB properties of the input files? Are we supposed to figure out looking at your control cards?
Suchay wrote:
if no match found with field1 positions 1-5, we have to match with 11-15
The position 11 has strings that do NOT match your requirements.
Also what happens when there is match on BOTH fields ?
Suchay wrote:
Currently i am using two sorts, Please advise if it can be done with one sort card
What is this fascination with 1 step process? If you are so concerned about the one step processing, sit down and write a programmer in the language of your choice. _________________ Kolusu
www.linkedin.com/in/kolusu
Also what happens when there is match on BOTH fields ?
Just curious
Quote:
What is this fascination with 1 step process? If you are so concerned about the one step processing, sit down and write a programmer in the language of your choice.
Joined: 26 Nov 2002 Posts: 12397 Topics: 75 Location: San Jose
Posted: Wed Nov 12, 2025 7:54 am Post subject:
Suchay,
Sigh ! You still did not provide the DCB properties of the input file.
Assuming your input file-1 has LRECL=80, RECFM=FB, here is an untested DFSORT solution. The trick is to put the key at common position either from position 1 or position 16. In order to do that we just concatenate file-1 twice but separate them with an identifier. Here I used the string "HEAD" to distinguish the files. So using When=Group, we number the files and we use that Id number to pick the key from position from 1 or 16
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