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
 

 

Difference of fields for matched records using Syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Difference of fields for matched records using Syncsort
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    Post subject:
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    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 Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
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 DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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