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
 

 

Date Comparison MM/DD/CCYY format

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

New User


Joined: 02 Mar 2007
Posts: 34
Location: somewhere in the middle

PostPosted: Wed Jun 23, 2010 7:09 am    Post subject: Date Comparison MM/DD/CCYY format
Reply with quote

I have searched and read threads and can't find any answer specific to my problem.

Is there any way I can compare two dates in MM/DD/CCYY format without breaking it to MMDDCCYY?

I need to compare the two dates and if one is greater than the other I would use the one which ever is higher.

I thought something like this would do the trick.
sample: (51,10,CH,GT,24,10,CH)

Is there any additional parameters that would not require me to remove the slashes first and compare.but if I really need to remove it..how do I do it in a simple way and the output would still has the '/'.

here is my current sort card
Code:
   JOINKEYS FILES=F1,FIELDS=(1,23,A)                             
   JOINKEYS FILES=F2,FIELDS=(1,23,A)                             
   JOIN UNPAIRED,F2                                               
   REFORMAT FIELDS=(F2:1,50,F1:25,10)                             
   SORT FIELDS=COPY                                               
   OUTREC IFTHEN=(WHEN=(50,1,CH,EQ,C'P',AND,51,10,CH,GT,24,10,CH),
          BUILD=(1,19,24,10,51,10,50,1,20,4)),                   
          IFTHEN=(WHEN=NONE,BUILD=(1,19,24,20,50,1,20,4))


when reformatted the position of the dates would be 24 & 51 respectively
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jun 23, 2010 8:46 am    Post subject:
Reply with quote

Hello,

The problem is not the slashes but rather the order of the date fields. . .

Comparing 11231990 to 01152009 or comparing 11/23/1990 to 01/15/2009 will never give the correct answer even with the slashes removed.

If i understand, your comparison needs to be ccyymmdd in order to work. Once the dates are in the proper order, it won't matter if there are slashes or not.

Possibly, there is something i misunderstand. . .
Back to top
View user's profile Send private message
Michael Angelo Pagala

New User


Joined: 02 Mar 2007
Posts: 34
Location: somewhere in the middle

PostPosted: Wed Jun 23, 2010 9:22 am    Post subject:
Reply with quote

so if I formatted it like what you have said, the slashes won't matter and I can compare it directly?

I will try that and check the results.

thanks for that info!


oh just a thought..is there any additional parameter that will convert it to CCYY/MM/DD without resorting to manually repositioning the date fields.
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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am


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