View previous topic :: View next topic
|
Author |
Message |
bhaskar_kanteti
Active User
Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
|
|
|
|
Hi,
I have two input files like given below. I need to extract all R* set of records that match on account number in first R record of R01. The problem here is input file 1 is not sorted on account number order.
Input File 1:
- Each account will have set of R* records starting with R01 and ending with R99. Both R01 and R99 will be there for every account.
- Account number will be in R01 record only (sample acct 6623).
- R01 records with account number is not in account number order.
Code: |
R01 ABC 6623 100.00 X
R35 MD X
R22 BP X
R61 OPTION X
R48 AP X
R99 X
R01 XYZ 1143 150.00 X
R35 MD X
R74 ADD X
R61 OPTION X
R99 X
R01 DEF 2344 090.00 X
R22 BP X
R54 CELL X
R74 ADD X
R99 X
R01 AAA 3452 125.00 X
R74 ADD X
R61 OPTION X
R99 X
R01 DDD 4398 120.00 X
R22 BP X
R54 CELL X
R61 OPTION X
R35 MD X
R48 AP X
R74 ADD X
R99 X
|
Input File 2:
Only account numbers with sorted order.
I should extract all R* records from Input File 1 that matches in Input File 2.
Please let me know how to get this output. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Are your input data sets (they are not files) FB or VB or something else? The solution is different depending on the RECFM. You should also specify the LRECL. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You need a JOINKEYs, but you don't have a key on each record. So you make one in JNF1CNTL, with WHEN=GROUP. Extended the records temporarily. As Nicc indicated, how you do that exactly depends on whether your file contains fixed- or variable-length records. |
|
Back to top |
|
|
bhaskar_kanteti
Active User
Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
|
|
|
|
Hi Nic,
My input file 1 is VB (LRECL 1004 bytes) and input file 2 is FB (80 bytes).
Hi Bill,
Let me try your suggestion. |
|
Back to top |
|
|
|