IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Extract set of records matching on acct number


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 123
Location: Hyderabad

PostPosted: Mon Mar 06, 2017 7:19 am
Reply with quote

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.

Code:

1143
4398
6623


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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Mar 06, 2017 3:16 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Mar 06, 2017 3:46 pm
Reply with quote

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
View user's profile Send private message
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 123
Location: Hyderabad

PostPosted: Mon Mar 06, 2017 7:01 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
Search our Forums:

Back to Top