Focal Point
[CLOSED] converting a6ymd from 20 century to 19 century

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2837084026

May 23, 2012, 10:55 AM
paulux99
[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.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
May 25, 2012, 03:41 AM
<JG>
quote:
20 century to 19 century

1899 was the last year of the 19th Century.

One assumes you mean 21st to 20th.

The default for DEFCENT is 19 i.e. 20th century, why change it unless you need dates more than 112 years ago.

Post the full modify and we may have a chance of helping.