I have a date field on a file with format YYYYY/MM/DD.
I know plenty has been written in the subject, but I can't find the answer
that I need.
I am comparing using DATE1 and is not producing anything.
Same for other Date Constants.
Is there a way to create a Date Constant that I can use in the compare?
Can someone point me in the right directions using Dictionary?
this is something I tried to do for some other purposes without success...
thanks a lot..
I feel you pointed me in the right direction... but still I am not able to solve my issue.
Is it possible to assign the HDATE variable to a specific location of the input file, so I can compare it against yesterday date?
That is at the same time as reformatting the date the way you showed me I still need to point HDATE to pos 11,10 so I can compare it with yesterday date.
What I need (I believe) is something like:
So, is it possible to have in SYMNAMES something like
I tried with no luck...
My apologies to the late response, Magesh
I had trouble trying to make work using overlay. I need to read a little bit more on overlay to understand it.
So, I used Findrep and I was able to change the '/' for '-'. So now, dates looks normal...
Still not able to make the yesterday's date comparison work.
So, is there something I am missing on INCLUDE condition?
000009 INREC IFTHEN=(WHEN=(11,1,CH,EQ,C'2'),
000018 INCLUDE COND=(RDAT,EQ,&DATE1(-)-1)
000020 SORT FIELDS=COPY
000024 DATA DICTIONARY SYMBOLS SUBSTITUTED :
000025 INREC IFTHEN=(WHEN=(11,1,CH,EQ,C'2'),FINDREP=(INOUT=(C'/',C'-'),STARTPOS=15,ENDP
000028 INCLUDE COND=(11,10,CH,EQ,&DATE1(-)-1)
000029 SORT FIELDS=COPY
000030 WER813I INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED
000031 WER276B SYSDIAG= 79900, 9995502, 9995502, 19652725
000032 WER164B 10,840K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
000033 WER164B 0 BYTES RESERVE REQUESTED, 2,429,440 BYTES USED
000034 WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
000035 WER108I SORTIN : RECFM=FB ; LRECL= 510; BLKSIZE= 27540
000036 WER073I SORTIN : DSNAME=XN1U.XNESAGE.REPORT.D01
000037 WER257I INREC RECORD LENGTH = 510
000038 WER110I SORTOUT : RECFM=FB ; LRECL= 510; BLKSIZE= 27540
000039 WER074I SORTOUT : DSNAME=XN1U.XNEREPT.MQ.DAILY
000040 WER410B 9,812K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16-MEGABYTE LINE,
000041 WER410B 0 BYTES RESERVE REQUESTED, 2,277,888 BYTES USED
000042 WER055I INSERT 0, DELETE 535
000043 WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
000044 WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
000045 WER416B SORTIN : EXCP'S=1,UNIT=3390,DEV=28BD,CHP=(3031323334353637,1),VOL=9SDMMI
000046 WER416B SORTOUT : EXCP'S=0,UNIT=3390,DEV=16B1,CHP=(3031323334353637,1),VOL=9SDS#V
000047 WER416B TOTAL OF 1 EXCP'S ISSUED FOR COPYING
000048 WER054I RCD IN 535, OUT 0
000049 WER169I RELEASE 2.1 BATCH 0539 TPF LEVEL 4.1
All I had to do was to follow your instructions...
I did as you suggested... added date1 at the end of the build statement.
To my surprise yesterday's date at the end of the record had the same 2017/09/25 format as the one I was initially comparing against.
So, I just had to get rid of the FINDREP I used to replace the /.
Comparing dates in the same format gave me the results I wanted!
Not sure what dates I was comparing initially.
I suspect the date was fine, but I had incorrect the start of the field.