migusd
New User
Joined: 08 Aug 2014 Posts: 44 Location: USA
|
|
|
|
Hello guys,
I just haven't understand how to manage dates in SYNCSORT
Can someone help me understand it ?
I am comparing a date in the record with yesterday's date in the system
If they are different I need the record in the output file and set RC=4
So here is the code
Code: |
INREC BUILD=(FEMA,COM,HDAT,BLK,HTIM,BLK,DATE1(/)-1)
SORT FIELDS=COPY,STOPAFT=1
OUTFIL INCLUDE=(HDAT,LT,25,10,CH),BUILD=(1,24),VTOF,
NULLOFL=RC0
DATA DICTIONARY SYMBOLS SUBSTITUTED :
INREC BUILD=(1,4,C',',6,10,C' ',17,8,C' ',DATE1(/)-1)
SORT FIELDS=COPY,STOPAFT=1
OUTFIL INCLUDE=(6,10,CH,LT,25,10,CH),BUILD=(1,34),VTOF,NULLOFL=RC4
|
So, I couldn't get the desired results. I force the output including both dates.
here is the output file
Code: |
FEMA,11/13/2017 20:21:232017/11/16
|
So the comparing failed because of the date format being different.
I was looking at the manual and I saw Y2W meaning 2 digits for years.
So I tried Y4W. I believe it accepted it. but not Y4W-1
Code: |
INREC BUILD=(1,4,C',',6,10,C' ',17,8,Y4W(/)-1)
*
|
So, how can I get yesterday's date in MM/DD/YYYY so I can compare it?
Also, is that the correct way of forcing RC=4 when condition is met?
Thank you |
|