February 08, 2009, 02:14 PM
hjDateCvt not working after upgrade 7.6.7 from 5.3
I have an input file and am using DATECVT to extract month, day and year
CREATE_MONTH etc. no longer returns correct data after upgrade.
Any help
DEFINE FILE RS_NET_ALL
CREATE_MONTH/M = DATECVT(CREATE_DATE, 'MDYY', 'M');
CREATE_DAY/D= DATECVT (CREATE_DATE , 'MDYY', 'D' );
CREATE_YEAR/YY = DATECVT (CREATE_DATE, 'MDYY', 'YY');
CREATE_MYY/MYY = DATECVT (CREATE_DATE, 'MDYY', 'MYY');
February 08, 2009, 03:07 PM
FrankDutchI wonder if this worked before the upgrade.
As far as I know DATECVT converts p.e. I8YYMD to YYMD so
NEWDATE/YYMD=DATECVT('&LETTING','A6MDY','YYMD');
Once you have converted it to a smartdate the next step might be
CREATEMONTH/M=NEWDATE;
etc
February 09, 2009, 02:05 AM
Tony AAccording to documentation the syntax is correct, so call it in and raise a case with tech support on InfoResponse, after first double checking to make sure that your input file isn't the cause.
T
February 09, 2009, 04:10 AM
FrankDutch[Tony is right, and for me this works, but to be honest I found some strange thing too
The field LSTDAT is a smartdate field formatted DMYY.
As you can see it does not matter what format I give in the input field for this formula.
But in this case also the formula
NEWD/D=LSTDAT would give me the correct result.
DEFINE FILE CLIFON
CREATE_MONTH/M = DATECVT(LSTDAT, 'MDYY', 'M');
CREATE_DAY/D= DATECVT (LSTDAT , 'DMYY', 'D' );
CREATE_YEAR/YY = DATECVT (LSTDAT, 'MDYY', 'YY');
CREATE_MYY/MYY = DATECVT (LSTDAT, 'YYMD', 'MYY');
END
TABLE FILE CLIFON
PRINT
STOCKID
LSTDAT
CREATE_MONTH
CREATE_DAY
CREATE_YEAR
CREATE_MYY
gives me this
STOCKID LSTDAT CREATE_MONTH CREATE_DAY CREATE_YEAR CREATE_MYY
302630 11/04/2008 04 11 2008 04/2008
924000 27/01/2009 01 27 2009 01/2009