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

Difference of fields for matched records using Syncsort


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

New User


Joined: 21 Mar 2007
Posts: 66
Location: Chennai, Tamilnadu, India

PostPosted: Wed Jun 09, 2010 4:47 pm
Reply with quote

Hi All icon_smile.gif,

I have two files of LRECL=80 & RECFM=FB as below...

Field 1 -> X(5) -> Key Field
Field 2 -> Z9(9).9(2)
Field 3 -> Z9(9).9(2)

Example:
Code:
File 1:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
AAAAA 123456789.12       789.12

File 2:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
AAAAA       789.12 123456789.12

Expected Output:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
AAAAA 123456000.00 123456000.00


Logic:
1. Match Key Field (Field 1) of File 1 & File 2,
2. For matched records, overlay difference of Fields 2 & 3 in output

Thanks in advance!

Regards,
Ramanan R
Back to top
View user's profile Send private message
anshul_gugnani

New User


Joined: 02 Nov 2009
Posts: 73
Location: Mumbai

PostPosted: Wed Jun 09, 2010 6:19 pm
Reply with quote

Hi,

The following sortcard will give you the desired result -

Code:
JOINKEYS  FILES=F1,FIELDS=(01,05,A)                             
JOINKEYS  FILES=F2,FIELDS=(01,05,A)                             
REFORMAT FIELDS=(F1:01,05,F1:06,11,F1:17,11,F2:06,11,F2:17,11) 
OPTION COPY                                                     
OUTFIL BUILD=(1:1,5,06:06,11,ZD,SUB,17,11,ZD,M11,LENGTH=11,     
          17:28,11,ZD,SUB,39,11,ZD,M11,LENGTH=11)               


Hope this Helps. icon_smile.gif

Thanks,
Anshul,
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 Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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 Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top