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
 

 

Matching File A vs File B, to keep data from file B.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
relur197

New User


Joined: 31 Jul 2008
Posts: 18
Location: Massachusetts

PostPosted: Wed Nov 26, 2008 12:42 am    Post subject: Matching File A vs File B, to keep data from file B.
Reply with quote

Hi Folks,

I have this jcl:

Code:
//STEP9      EXEC DISKSORT                                   
//SORTMSG    DD SYSOUT=R                                     
//SORTIN     DD DSN=FILE A,DISP=SHR
//           DD DSN=FILE B,DISP=SHR
//SORTOUT    DD SYSOUT=R                                     
//SORTXSUM   DD DSN=FILE C,DISP=SHR
//SYSIN      DD *                                             
 SORT FIELDS=(1,8,CH,A)                                       
 SUM FIELDS=NONE,XSUM                                         
/*                                                           
//                                                           


This is working as intented and is doing what it needs to be done it is taking and comparing the first 8 characters of both datasets by character in ascending order, if there are any duplicates found. Export them to a certain dsn. Now imagine if there was data on FILE B that was needed and FILE A is just used for the first 8 characters on each record.

Right now I am getting "most" of the data I need but some records are outputting to FILE C with just the first 8 characters.

Any suggestions?
Back to top
View user's profile Send private message

Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Nov 26, 2008 1:10 am    Post subject:
Reply with quote

Which SORT utility are you running?
Back to top
View user's profile Send private message
relur197

New User


Joined: 31 Jul 2008
Posts: 18
Location: Massachusetts

PostPosted: Wed Nov 26, 2008 1:11 am    Post subject:
Reply with quote

SyncSort
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Nov 26, 2008 1:15 am    Post subject:
Reply with quote

You can probably use the JOIN feature, but before I can provide you with the control statements, I need a little more information. For starters, the RECFM and LRECL would be helpful. Also, can you provide some sample data for your 2 input files and what you want included in your output? For example, do you only want records from File A in the output?
Back to top
View user's profile Send private message
relur197

New User


Joined: 31 Jul 2008
Posts: 18
Location: Massachusetts

PostPosted: Wed Nov 26, 2008 1:22 am    Post subject: Reply to: Matching File A vs File B, to keep data from file
Reply with quote

This is the output from my current sort.

The LRECL of each is 80.
The RECFM is Fixed Block.

This is "FILE C"

Code:


ACVRUAL4                      0.29
ACVRUAL7                      1.09
ACVRUBKP                      26.73
ACVRULC1                           
ACVRULC2                      0.69
ACVRULC3                           
ACVRULC4                      0.35
ACVRULC5                           
ACVRULC7                      2.1 
ACVRULC8                           
ACVRURPA                      0.35
ACVRURPB                           
ACVRURP1                      0.15
ACVRURP2                           
ACVRURP3                      0.37
ACVRURP4                           
ACVRUVNA                      0.38
ACVRUVNB                           
ACVRUVNC                      0.65
ACVRUVND                           
ACVRUVNE                      0.56
ACVRUVNF                           
ACVRUVNG                      0.35
ACVRUVNZ                           
ACVRUVN1                      1.18
ACVRUVN2                           



This is "FILE A"

Code:


ACVRUAL1               
ACVRUAL2               
ACVRUAL4               
ACVRUAL6               
ACVRUAL7               
ACVRUAL8               
ACVRUBKP               
ACVRULC1               
ACVRULC2               
ACVRULC3               
ACVRULC4               
ACVRULC5               
ACVRULC6               
ACVRULC7               
ACVRULC8               
ACVRURPA               
ACVRURPB               
ACVRURP1               
ACVRURP2               
ACVRURP3               
ACVRURP4               
ACVRUVNA               
ACVRUVNB               
ACVRUVNC               
ACVRUVND               
ACVRUVNE               



This is "FILE B"

Code:


ACF40                         5.41
ACVRUAL4                      0.29
ACVRUAL7                      1.09
ACVRUBKP                      26.73
ACVRULC1                      1.1 
ACVRULC2                      0.69
ACVRULC3                      0.89
ACVRULC4                      0.35
ACVRULC5                      0.02
ACVRULC7                      2.1 
ACVRULC8                      0.19
ACVRURPA                      0.35
ACVRURPB                      0.34
ACVRURP1                      0.15
ACVRURP2                      0.2 
ACVRURP3                      0.37
ACVRURP4                      0.32
ACVRUVNA                      0.38
ACVRUVNB                      0.37
ACVRUVNC                      0.65
ACVRUVND                      0.37
ACVRUVNE                      0.56
ACVRUVNF                      0.37
ACVRUVNG                      0.35
ACVRUVNZ                      0.03
ACVRUVN1                      1.18



Right now, what you can see happening in FILE C is that when it is performing the check for the duplicate it is getting "one than the other" with the decimal number.

Yes, what I cant figure out is to have only the records from this case "FILE B" to be included in "FILE C". Maybe taking the route of checking for duplicate as matching was a bad idea...
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Wed Nov 26, 2008 1:40 am    Post subject:
Reply with quote

relur197,

If you have Syncsort for z/OS 1.2 or above, you can easily do this using the JOIN feature as Alissa pointed out. Which version are you using? You can find this info on the top of the SYSOUT.
Back to top
View user's profile Send private message
relur197

New User


Joined: 31 Jul 2008
Posts: 18
Location: Massachusetts

PostPosted: Wed Nov 26, 2008 1:42 am    Post subject:
Reply with quote

SYNCSORT FOR Z/OS 1.3.0.2R
Back to top
View user's profile Send private message
relur197

New User


Joined: 31 Jul 2008
Posts: 18
Location: Massachusetts

PostPosted: Wed Nov 26, 2008 1:42 am    Post subject:
Reply with quote

Darnit, I can't edit my post. Anyway, I am looking into the join control statement now. I will return with anything I have found. Thanks
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Nov 26, 2008 1:46 am    Post subject:
Reply with quote

Try this JCL instead:

Code:
//STEP   EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTJNF1 DD DSN=FILE.A,DISP=SHR
//SORTJNF2 DD DSN=FILE.B,DISP=SHR
//SORTOUT  DD DSN=FILE.C,...
//SYSIN    DD *                                             
   JOINKEYS FILE=F1,FIELDS=(1,8,A)                               
   JOINKEYS FILE=F2,FIELDS=(1,8,A)
   REFORMAT FIELDS=(F2:1,80)
   SORT FIELDS=COPY
/*                                                           
Back to top
View user's profile Send private message
relur197

New User


Joined: 31 Jul 2008
Posts: 18
Location: Massachusetts

PostPosted: Wed Nov 26, 2008 2:24 am    Post subject:
Reply with quote

I can't thank you enough alissa.

Enjoy the holiday arcvns and alissa.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm


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