IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

compare two files and compute values for matched records..


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
alakshmipathi

New User


Joined: 24 Apr 2008
Posts: 7
Location: chennai

PostPosted: Wed Mar 25, 2009 6:36 pm
Reply with quote

I have two input files for different LRECL..

File 1: Lrecl = 80
layout:

A1 A2 A3
----------
aa 2345 4567
bb 1111 1000

File 2: LRECL = 90

B1 B2 B3
----------
aa 1000 2000
cc 2000 3000

Output file should be:
-------------------------
field1 field2 field3
A1 A2+A3+B2 B3

that is for above example,

output would be:
aa 7912 2000

Is it possible to do this using SYNCTOOL??

all records in both the input files will be unique there not be any duplicates.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Mar 25, 2009 7:15 pm
Reply with quote

alakshmipathi,

You can achieve this using the below SyncSort JOIN application.
Code:
//STEP01   EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTJNF1 DD DSN= Input-1                                           
//SORTJNF2 DD DSN= Input-2                                           
//SORTOUT  DD DSN= Output file                                       
//SYSIN    DD *                                                     
  JOINKEYS FILE=F1,FIELDS=(1,2,A)                                   
  JOINKEYS FILE=F2,FIELDS=(1,2,A)                                   
  REFORMAT FIELDS=(F1:1,12,F2:3,10)                                 
  INREC FIELDS=(1,3,4,4,ZD,ADD,9,4,ZD,ADD,14,4,ZD,M11,LENGTH=4,18,5)
  SORT FIELDS=COPY
Note: I assumed the numeric field as a displayable-4 byte field as shown in your example. You might need to increase the LENGTH parameter value if you're expecting the sum to go beyond 4 digits.
Back to top
View user's profile Send private message
alakshmipathi

New User


Joined: 24 Apr 2008
Posts: 7
Location: chennai

PostPosted: Wed Mar 25, 2009 7:22 pm
Reply with quote

Arun,

Thanks for the solution. I'm aware of the join keys, but I'm interested to know whether there is any possibility using SYNCTOOL as here they want me to do using SYNCTOOL instead of Join keys.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Mar 25, 2009 8:24 pm
Reply with quote

alakshmipathi wrote:
any possibility using SYNCTOOL as here they want me to do using SYNCTOOL instead of Join keys.
Really? First time heard on this forum to appraoch on such things from other way round . . . icon_smile.gif
Back to top
View user's profile Send private message
alakshmipathi

New User


Joined: 24 Apr 2008
Posts: 7
Location: chennai

PostPosted: Wed Mar 25, 2009 8:29 pm
Reply with quote

May be..

but Join keys take more CPU time when compared to CObol comparison, I just wanted to know there is any solution using SYNCTOOL that would take lesser time than Join keys.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Mar 25, 2009 8:48 pm
Reply with quote

alakshmipathi wrote:
but Join keys take more CPU time when compared to CObol comparison, I just wanted to know there is any solution using SYNCTOOL that would take lesser time than Join keys.
I'd guess that SORT with JOINKEYS does just about what SYNCTOOL (if it can) does under the covers.....
I'm still waiting for a PDF documenting SYNCTOOL......
Back to top
View user's profile Send private message
alakshmipathi

New User


Joined: 24 Apr 2008
Posts: 7
Location: chennai

PostPosted: Wed Mar 25, 2009 8:54 pm
Reply with quote

CICS Guy wrote:
I'd guess that SORT with JOINKEYS does just about what SYNCTOOL (if it can) does under the covers.....


I just want to confirm whether Synctool takes same time/ more / lesser time than Joinkeys.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Mar 25, 2009 9:12 pm
Reply with quote

alakshmipathi wrote:
I just want to confirm whether Synctool takes same time/ more / lesser time than Joinkeys.
No matter how you do it, SORT/JOINKEYS, SYNCTOOL or COBOL, the inputs will each have to be sorted by the mutual keys.......
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Mar 25, 2009 11:08 pm
Reply with quote

Quote:
I just want to confirm whether Synctool takes same time/ more / lesser time than Joinkeys.
alakshmipathi,

I am not sure what you're trying to compare here. You can do the JOIN operation in SYNCTOOL also with exactly the same control card. Are you looking for a SYNCTOOL/SPLICE solution?
Back to top
View user's profile Send private message
alakshmipathi

New User


Joined: 24 Apr 2008
Posts: 7
Location: chennai

PostPosted: Thu Mar 26, 2009 11:17 am
Reply with quote

yes Arun !!!
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Mar 27, 2009 12:10 am
Reply with quote

Huh, Thanks for 'revealing' this at least now. icon_lol.gif

IMHO, your requirement might require multiple data passes if you go for a SYNCTOOL/SPLICE solution. I wonder why you have been asked to go for a SPLICE solution given that you already have SyncSort JOIN. I would suggest doing a volume test for both the approaches and convince your managers.
Back to top
View user's profile Send private message
alakshmipathi

New User


Joined: 24 Apr 2008
Posts: 7
Location: chennai

PostPosted: Fri Mar 27, 2009 11:12 am
Reply with quote

let me check !! anyways thanks !!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top