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
 

 

SYNCSORT Compare date in 2 files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sivatechdrive

Active User


Joined: 17 Oct 2004
Posts: 190
Location: hyderabad

PostPosted: Sat Jan 10, 2009 4:23 pm    Post subject: SYNCSORT Compare date in 2 files
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: 2276
Location: @my desk

PostPosted: Sat Jan 10, 2009 8:58 pm    Post subject:
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

Senior Member


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

PostPosted: Sat Jan 10, 2009 9:25 pm    Post subject: Re: SYNCSORT Compare date in 2 files
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: 190
Location: hyderabad

PostPosted: Mon Jan 12, 2009 8:09 am    Post subject:
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: 2276
Location: @my desk

PostPosted: Mon Jan 12, 2009 10:35 am    Post subject:
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    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 member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm


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