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
 

 

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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
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 Matching and unmatching records scdinesh DFSORT/ICETOOL 11 Tue Feb 07, 2017 12:41 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm


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