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
 
Fetch columns upon matching keys in files with duplicates.

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

New User


Joined: 08 Jul 2006
Posts: 28
Location: Singapore

PostPosted: Thu May 20, 2010 10:07 pm    Post subject: Fetch columns upon matching keys in files with duplicates.
Reply with quote

Hi All,

I have a requirement where i need to find out all the

FileA: ( VB file, 255 bytes ,column in Char format)
Code:
112191
119112
119911
121538
121587

FileB: ( VSAM file, 255, Column A , S9(6) comp-3, and column B - S9(11) Comp-3 , so both are in PD formats)

Code:
Column A  Column B
0112191 11121910030
0112191 11121910057
0112191 11121910066
0112191 11121910075
0112191 11121914312
0112196 11121960001
0119112 11191122300
0119112 11191122301
0119112 11191124317


My output should look like: Whenever Coumn A from fileA matches with that of fileB fetch all data from FileB.

Code:
0112191 11121910030
0112191 11121910057
0112191 11121910066
0112191 11121910075
0112191 11121914312
0119112 11191122300
0119112 11191122301
0119112 11191124317


I had tried with this,..but there is no output and the belwow shows the data frm TEMP file.

Code:
//FILEA    DD  DSN=VSAM FILEA,DISP=SHR
//FILEB    DD  DSN=VB FILEB,DISP=SHR
//TEMP     DD  DSN=&&TEMP,UNIT=SYSDA,DISP=(MOD,PASS),
//             SPACE=(TRK,(15,5),RLSE)
//OUTFILE  DD  DSN=OUTPUTFILE VB,DISP=SHR
//TOOLIN   DD  *
COPY FROM(FILEB) TO(TEMP) USING(CTL2)
COPY FROM(FILEA) TO(TEMP) USING(CTL1) VSAMTYPE(V)
SPLICE FROM(TEMP) TO(OUTFILE) ON(8,6,CH)  -
      WITHALL  WITH(5,1) WITH(7,30) USING(CTL3)
//CTL1CNTL DD *
           INREC BUILD=(1,4,5:C'VV',10,4,PD,ZD,X,14,6,PD,ZD)
//CTL2CNTL DD *
           INREC BUILD=(1,4,5:C'BB',7:5)
//CTL3CNTL DD *
           OPTION COPY
           OUTFIL FNAMES=OUTFILE,INCLUDE=(5,2,CH,EQ,C'VV'),
                  BUILD=(1,4,5:7)


Data in TEMP file shows like this:

BB 112191 11121910030
BB 119112 11191122301
BB 119911 11199112311
BB 121538 11215380008
BB 121587 11215872302
BB 121590 11215904327
BB 122231 11222312300
BB 126665 11266650017
BB 126793 11267930013
BB 127096 11270960107
BB 127383 11273832300
BB 129132 11291322304
BB 131008 11310080019
VV0112191 11121910030
VV0112191 11121910057
VV0112191 11121910066
VV0112191 11121910075
VV0112191 11121914312
VV0112196 11121960001
VV0119112 11191122300
VV0119112 11191122301
VV0119112 11191124317

Please let me know if any more info is required.
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu May 20, 2010 10:40 pm    Post subject: Reply to: Fetch columns upon matching keys in files with dup
Reply with quote

malayajena,

If your intention is to extract only FILEB duplicate records then you can eliminate the dups from fileA and then splice to extract the duplicates.

use the following control cards


Code:

//FILEA    DD DSN=Your char match field file,DISP=SHR
//FILEB    DD DSN=your pd match field file,DISP=SHR
//TEMP     DD DSN=&&TEMP,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE) 
//OUTFILE  DD SYSOUT=* 
//TOOLIN   DD  *                                                       
 SORT FROM(FILEA) TO(TEMP) USING(CTL1) VSAMTYPE(V)                             
 COPY FROM(FILEB) TO(TEMP) USING(CTL2)                                 
 SPLICE FROM(TEMP) TO(OUTFILE) ON(7,6,CH)  -                           
      WITHALL  WITH(5,1) WITH(7,30) USING(CTL3)                       
//CTL1CNTL DD *                                                       
  INREC BUILD=(1,4,5:C'BB',7:5,6,C'FILEA',263:X)                       
  SORT FIELDS=(7,6,CH,A)                                               
  SUM FIELDS=NONE                                                     
//CTL2CNTL DD *                                                       
  INREC BUILD=(1,4,5:C'VV',10,4,PD,ZD,LENGTH=6,5)                     
//CTL3CNTL DD *                                                       
  OUTFIL FNAMES=OUTFILE,BUILD=(1,4,13),INCLUDE=(5,2,CH,EQ,C'VB')       
//*
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 Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm

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