Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Extract set of records matching on acct number

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Extract set of records matching on acct number
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: 2409
Location: Hampshire, UK

PostPosted: Mon Mar 06, 2017 3:16 pm    Post subject:
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: 7312
Location: Inside the Matrix

PostPosted: Mon Mar 06, 2017 3:46 pm    Post subject: Reply to: Extract set of records matching on acct number
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Group selective VB records - Trailer ... Premnath_TJ DFSORT/ICETOOL 12 Sun Sep 13, 2020 3:38 am
This topic is locked: you cannot edit posts or make replies. SORT the records based on the second ... Ramsee SYNCSORT 1 Wed Aug 19, 2020 3:01 pm
No new posts to Insert Rows from File1 to File 2 ... Arun_Tupili DFSORT/ICETOOL 1 Thu Aug 13, 2020 6:22 pm
No new posts CA Sysview - JCL or Rexx - Read or Ex... Jasi CA Products 4 Wed Aug 05, 2020 9:19 pm
No new posts Retrieve multiple records with metaco... Jose Juan J CA Products 0 Sat Jul 25, 2020 1:36 am

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us