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

SYNCSORT Compare date in 2 files


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

Active User


Joined: 17 Oct 2004
Posts: 191
Location: hyderabad

PostPosted: Sat Jan 10, 2009 4:23 pm
Reply with quote

HI All,

I have a reqirement and the details are given below.plz help me on how to proceed

FILEA will have header and detail records (header also has date)
FileB also has header and detail records (header also has date)

Need to compare the dates in both the files (header record) and write the maximum to the OUtput File.

Thanks
Prasad
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Sat Jan 10, 2009 8:58 pm
Reply with quote

Prasad,

Post a few sample records from both the files. What about the input/output file attributes-RECFM/LRECL?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Sat Jan 10, 2009 9:25 pm
Reply with quote

sivatechdrive wrote:
Need to compare the dates in both the files (header record) and write the maximum to the OUtput File.
What does "Maximum" refer to in relation of date(s) ?
Back to top
View user's profile Send private message
sivatechdrive

Active User


Joined: 17 Oct 2004
Posts: 191
Location: hyderabad

PostPosted: Mon Jan 12, 2009 8:09 am
Reply with quote

HI.,

The input files are of Fixed format and LRECL = 110.

The Header and data records in file1
00000020081031
001 ABC
003 DEF
007 IJK
The Header record in file2
00000020081231
002 LMN
005 OPQ
008 RST

The Expected Output file
(the date in the header should be maximum among the 2 input files
i.e 20081231 (input file2) is > 20081031 (input file1) hence file2 header is choosen )

00000020081231
001 ABC
002 LMN
003 DEF
005 OPQ
007 IJK
008 RST


Thanks
Prasad
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Mon Jan 12, 2009 10:35 am
Reply with quote

Prasad,

Can the header be identified by the one starting with 5 '0's?
Do you have unique keys ( position 1,3 ? ) in both the files?
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
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 Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top