Hi all,
I have a requirement to create match and no match files using sort.
I achieved using 3 steps. Can this be simplified further?. Just want to hear it out. All are having FB/80.
Req:
Step 1:
Input File 1 - FB/80 : Keys (1,10)
Input File 2 - FB/80 : Keys (5,10)
Output
1. No match File 1 - FB/80
2. No match File 2 (Not required)
3. Match file.
Step 2 :
Input : No match file 1
Output file 1 : contains indicator (27th posistion) - I
Output file 2 : contains indicator (27th posistion) - U
Step 3:
Input : Match file
Output file 1 : contains indicator (27th posistion) - I
Output file 2 : contains indicator (27th posistion) - U
Can these files can be created in first step itself?.
Joined: 15 Aug 2015 Posts: 1134 Location: Bamberg, Germany
Task 1: Make use of JOINKEYS, JOIN UNPAIRED and REFORMAT in a good way
Task 2: Use the Join Indicator from 1) to include what's needed for your OUTFIL datasets
It's less than 24 lines of code to achieve your requirement in a single step.
Thanks for your suggestions!. So it's basically OUTFIL with extra INCLUDE condition for me to produce extra files. All 5 Outputs produced in single step successfully.
@ Sergeyken,
I never expected this answer from a senior person like you.
Joined: 15 Aug 2015 Posts: 1134 Location: Bamberg, Germany
JOIN UNPAIRED,F1 is enough as you put F2 to DUMMY anyway. This also can be used to reduce your REFORMAT statement. REFORMAT FIELDS=(F1:1,80,?) is sufficient for your task. Update the INCLUDE= fields accordingly.