[CLOSED] converting a6ymd from 20 century to 19 century
Hello, I have a DATE1 (date field a6ymd) in master file. when SET DEFCENT=20 DEFINE FILE ... DATELG/YYMD = DATE1; END
DATELG displays 20961001 but I need to update/modify DATE1 OR DATELG to 19961001.
can you let me know what is the best course to modify a6ymd date1?This message has been edited. Last edited by: Kerry,
May 23, 2012, 01:07 PM
jimster06
The function DATEADD comes to mind; you could use it to subtract 100 years from DATELG.
jimster06 DevStu WF 7.6.11 W7 HTML, PDF, EXL2K
May 23, 2012, 01:43 PM
paulux99
thanks, I guess the issue I am having is that I need to update DATE1 which is a6ymd (master file) with DATELG/YYMD='19961001'; The modify does not seem to update
what would be the modify coding to update DATE1 which is A6YMD? I have tried: MODIFY FILE .. COMPUTE DATELG/YYMD=; ON MATCH COMPUTE DATE1= DATELG; ON MATCH CONTINUE ON MATCH UPDATE DATE1
DATELG still shows 20961001. It did not modify.
sorry I am not good with date conversion
May 23, 2012, 02:03 PM
Dan Satchell
DEFCENT is usually used in conjunction with YRTHRESH (ex. DEFCENT=19, YRTHRESH=60). But your MODIFY logic may also be part of the problem.
WebFOCUS 7.7.05
May 23, 2012, 02:09 PM
jimster06
Additionally, if the master file describes DATE1 as A6YMD then there is no way that I know of to represent CC, the century, in that field; ie A8YYMD.
jimster06 DevStu WF 7.6.11 W7 HTML, PDF, EXL2K
May 24, 2012, 05:09 PM
George Patton
quote:
MODIFY FILE .. COMPUTE DATELG/YYMD=; ON MATCH COMPUTE DATE1= DATELG; ON MATCH CONTINUE ON MATCH UPDATE DATE1
Is that your whole MODIFY ? You don't show a MATCH field-x before the ON MATCH And you have set DATELG to a null value and subsequently DATE1 to DATELG
It seems to me it should be something like:
MODIFY FILE WHATEVER
FIXFORM keyfield/xx datefield/xx etc.
MATCH keyfield
ON NOMATCH REJECT
ON MATCH UPDATE datefield
DATA ON datafile
END
I've assumed a fixed format data file but it could be a hold file, comma-delimited, etc.