Focal Point
Y2K PROBLEM IN DATETRAN

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

October 08, 2007, 12:48 PM
krishkasi
Y2K PROBLEM IN DATETRAN
Hi All,
I have a written function which converts the date into various formats based on the input parameter.

DEFINE FUNCTION DATEFMT(INDATE/MDYY, FMT/I1)
DATEFMT/A20 = IF FMT EQ 1 THEN DATETRAN(INDATE, '(MDYY)', '(/)', 'EN', 15, 'A15')
ELSE IF FMT EQ 2 THEN DATETRAN(DATECVT(INDATE, 'MDYY', 'DMYY'), '(DMYY)', '(/)', 'EN', 15, 'A15')
ELSE IF FMT EQ 3 THEN DATETRAN(INDATE, '(MDYY)', '(-)', 'EN', 15, 'A15')
ELSE IF FMT EQ 4 THEN DATETRAN(DATECVT(INDATE, 'MDYY', 'DMYY'), '(DMYY)', '(-)', 'EN', 15, 'A15')
ELSE IF FMT EQ 5 THEN DATETRAN(DATECVT(INDATE, 'MDYY', 'DMYY'), '(DMYY)', '(TRD)', 'EN', 20, 'A20')
ELSE IF FMT EQ 6 THEN DATETRAN(DATECVT(INDATE, 'MDYY', 'DMYY'), '(DMYY)', '(Btr)', 'EN', 20, 'A20')
ELSE IF FMT EQ 7 THEN DATETRAN(DATECVT(INDATE, 'MDYY', 'DMYY'), '(DMYY)', '(.)', 'EN', 15, 'A15')
ELSE IF FMT EQ 8 THEN DATETRAN(DATECVT(INDATE, 'MDYY', 'DMYY'), '(DMYY)', '(-dm)', 'EN', 15, 'A15')
ELSE IF FMT EQ 9 THEN DATETRAN(DATECVT(INDATE, 'MDYY', 'YYMD'), '(YYMD)', '(-)', 'EN', 20, 'A20');
END

And am using this function in the proc as follows.

TABLE FILE CAR
PRINT
COMPUTE DUMMY/MDYY = 08152000; AS 'ORIGINAL,DATE,(MM/DD/YYYY)'
COMPUTE DUMMY2/A20=DATEFMT(DUMMY, 2); AS ',,(DD/MM/YYYY)'
COMPUTE DUMMY3/A20=DATEFMT(DUMMY, 3); AS ',,(MM-DD-YYYY)'
COMPUTE DUMMY4/A20=DATEFMT(DUMMY, 4); AS ',,(DD-MM-YYYY)'
COMPUTE DUMMY5/A20=DATEFMT(DUMMY, 5); AS ',,(DD-MONTH-YYYY)'
COMPUTE DUMMY6/A20=DATEFMT(DUMMY, 6); AS ',,(DD Month YYYY)'
COMPUTE DUMMY7/A20=DATEFMT(DUMMY, 7); AS ',,(DD.MM.YYYY)'
COMPUTE DUMMY8/A20=DATEFMT(DUMMY, 8); AS ',,(dD-mM-YYYY)'
COMPUTE DUMMY9/A20=DATEFMT(DUMMY, 9); AS ',,(YYYY-MM-DD)'
BY CAR NOPRINT
WHERE RECORDLIMIT EQ 1
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET STYLE *
TYPE=REPORT, SIZE=6,$
TYPE=REPORT, COLUMN = 'C1', SQUEEZE=0.7,$
TYPE=REPORT, COLUMN = 'C2', SQUEEZE=0.7,$
TYPE=REPORT, COLUMN = 'C3', SQUEEZE=0.7,$
TYPE=REPORT, COLUMN = 'C4', SQUEEZE=0.7,$
TYPE=REPORT, COLUMN = 'C5', SQUEEZE=0.8,$
TYPE=REPORT, COLUMN = 'C6', SQUEEZE=0.8,$
TYPE=REPORT, COLUMN = 'C7', SQUEEZE=0.7,$
TYPE=REPORT, COLUMN = 'C8', SQUEEZE=0.7,$
TYPE=REPORT, COLUMN = 'C9', SQUEEZE=0.7,$
ENDSTYLE
END

Problem is Year part is not properly displayed. it is displayed as -00ΓΈ0.
If the year is other than 2000 it displays the result without any problem.

Can anyone confirm whether I am doing wrong or it is a known problem.

Thanks all in advance.


Regards,
Kasi Krishnan
WF 7.1.4 & WF 7.6.9: Databases - DB2, SQL Server 2000.
OS: Windows & AIX
October 08, 2007, 01:45 PM
Leah
It appears that DATETRAN is the problem, if you define the dates separately DATECVT works, but DATETRAN does not. I would report it to Information Builders. Personally don't use the functions much at all.


Leah
October 08, 2007, 06:38 PM
Darin Lee
I have also run into this problem (quite a while ago)- and it is only for the year 2000. 2001 and further looks correct. check out this additional post:

DATETRAN returns odd characters for year 2000

This message has been edited. Last edited by: Darin Lee,


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
October 08, 2007, 08:23 PM
krishkasi
Thanks Leah, Darin,
I will open up a case and post the updates as soon as I get the updates from tech support.


Regards,
Kasi Krishnan
WF 7.1.4 & WF 7.6.9: Databases - DB2, SQL Server 2000.
OS: Windows & AIX
October 11, 2007, 10:28 AM
Kerry
Hi all,

FYI, this is a known problem and already submitted to programming to fix it.

Hope this helps. Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
October 11, 2007, 10:42 AM
Francis Mariani
My pointless two cents: here we are in 2007 and we're still having Year 2000 issues?!


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server