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
 

 

Select only records in FileB

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
erhan

New User


Joined: 27 Sep 2007
Posts: 5
Location: rotterdam

PostPosted: Fri Oct 17, 2008 7:53 pm    Post subject: Select only records in FileB
Reply with quote

Hi,

I want select only records in FileB if the accountnumber in FileA existst in FileB.

FileB: FB, reclen 354. Accountnbr in positions 23 to 29 as PD. Key is first 17 chars.
FileA: FB, reclen 15. Accountnbr in positions 1 to 11 as ZD.

FileA:
<accountnbr1><text>
<accountnbr3><text>

FileB:
<key1><data1a><accountnbr1><data1b>
<key2><data2a><accountnbr2><data2b>
<key3><data3a><accountnbr3><data3b>
<key4><data4a><accountnbr4><data4b>
<key5><data5a><accountnbr5><data5b>

Sortout:
<key1><data1a><accountnbr1><data1b>
<key3><data3a><accountnbr3><data3b>
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Oct 17, 2008 11:36 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed there are no duplicate account numbers within fileA, or within fileB. If there are, show an example of input and output for that (it will require a different solution).

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//FILEA DD DSN=... input fileA (FB/15)
//FILEB DD DSN=... input fileB (FB/354)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/354)
//TOOLIN DD *
COPY FROM(FILEB) TO(T1)
COPY FROM(FILEA) TO(T1) USING(CTL1)
SELECT FROM(T1) TO(OUT) ON(23,7,PD) FIRSTDUP
/*
//CTL1CNTL DD *
  INREC BUILD=(23:1,11,ZD,TO=PD,LENGTH=7,354:X)
/*
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
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 Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
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