Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 120
Location: USA

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: 1753
Location: 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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

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: 120
Location: USA

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 what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts GDG version number PANDU1 JCL & VSAM 4 Sat Mar 04, 2017 8:28 pm
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us