Page 1 of 1

Compare date value DD.MM.YYYY to current date

PostPosted: Tue Jan 19, 2016 6:28 pm
by loki
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!

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

PostPosted: Tue Jan 19, 2016 7:19 pm
by BillyBoyo
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.

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

PostPosted: Tue Jan 19, 2016 7:32 pm
by loki
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                 

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

PostPosted: Tue Jan 19, 2016 7:50 pm
by BillyBoyo
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.