Compare date value DD.MM.YYYY to current date



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Compare date value DD.MM.YYYY to current date

Postby loki » Tue Jan 19, 2016 6:28 pm

My data contains a character field CH(10) with a date value in the format DD.MM.YYYY
I want to compare that value with the current date. Is there a way to achieve this?

(After som googling) I tried the following code, which gave me an error:

(some code)
451,10,CH,GE,DATE=(DM4.)

JCK2218E INCLUDE (LINE=00006): INVALID POSITION IS SPECIFIED
JCK2202E INCLUDE (LINE=00006): , IS EXPECTED


After some trial and error I noticed that 451,10,CH,GE,DATE1 won't give me an error. But I'm pretty sure, that this won't work(?)

Thank you!
loki
 
Posts: 2
Joined: Tue Jan 19, 2016 6:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare date value DD.MM.YYYY to current date

Postby BillyBoyo » Tue Jan 19, 2016 7:19 pm

Firstly, that's not an "error". That is something spewed out by a JCL-checker, and they are often way out-of-date for Control Cards. Run the step on the machine and post the results if you can't sort it out.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Compare date value DD.MM.YYYY to current date

Postby loki » Tue Jan 19, 2016 7:32 pm

Here is the given error:

SYSIN :                                                       
 SORT FIELDS=COPY                                             
 INCLUDE COND=(015,04,CH,EQ,C'KO',AND,                       
              201,07,PD,NE,0,AND,                             
     005,04,BI,EQ,09,04,BI,AND,                               
     ((437,04,CH,EQ,C'PE,B',OR,437,04,CH,EQ,C'B'),OR,         
     (437,04,CH,EQ,C'PE',AND,451,10,CH,GE,DATE=(DM4.))))     
                                          *                   
WER813I  INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED
WER268A  INCLUDE STATEMENT : SYNTAX ERROR                     
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                 
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                 
loki
 
Posts: 2
Joined: Tue Jan 19, 2016 6:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare date value DD.MM.YYYY to current date

Postby BillyBoyo » Tue Jan 19, 2016 7:50 pm

I think you've been mixing you research with another SORT product.

&DATE1(.) would give you YYYY.MM.DD, but that's not what you want. Read, closely, the INCLUDE/OMIT control statement in you SyncSORT manual where it relates to comparisons to the current date. Ensure that the manual matches your release.

If you can't do it with INCLUDE/OMIT, you can use OUTFIL with INCLUDE=/OMIT=, having reformatted the date in INREC or OUTREC.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post