Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 2 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am

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