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
 
compare two files and compute values for matched records..

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: compare two files and compute values for matched records..
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: 2285
Location: @my desk

PostPosted: Wed Mar 25, 2009 7:15 pm    Post subject:
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    Post subject: Reply to: compare two files and compute values for matched r
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

Senior Member


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

PostPosted: Wed Mar 25, 2009 8:24 pm    Post subject: Re: Reply to: compare two files and compute values for match
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    Post subject: Reply to: compare two files and compute values for matched r
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: 2150
Location: At my coffee table

PostPosted: Wed Mar 25, 2009 8:48 pm    Post subject: Re: Reply to: compare two files and compute values for match
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    Post subject: Re: Reply to: compare two files and compute values for match
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: 2150
Location: At my coffee table

PostPosted: Wed Mar 25, 2009 9:12 pm    Post subject: Re: Reply to: compare two files and compute values for match
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: 2285
Location: @my desk

PostPosted: Wed Mar 25, 2009 11:08 pm    Post subject:
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    Post subject: Reply to: compare two files and compute values for matched r
Reply with quote

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

Moderator


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

PostPosted: Fri Mar 27, 2009 12:10 am    Post subject:
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    Post subject: Reply to: compare two files and compute values for matched r
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    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 Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 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