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
 
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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us