Focal Point
Date-Time field display

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

October 12, 2006, 11:02 AM
ok_dhs
Date-Time field display
I have a Date-Time field (HYYMDS) in Oracle database. The master file would be something like this:

FILE=newmas, SUFFIX=SQLORA
SEGNAME=ROOT_SEG, SEGTYPE=S0, $
FIELD=FIELD1, ALIAS=FIELD1, USAGE=HYYMDS, ACTUAL=HYYMDS, MISSING=ON, $
FIELD=FIELD2, ALIAS=FIELD2, USAGE=HYYMDS, ACTUAL= HYYMDS, MISSING=ON, $

I want to display FIELD1 without the time portion; something similar to ‘January 1, 1900’ format. To do so, I could either:
1. Strip the date portion off of Date-Time (using HDATE) and then use CHGDAT function to display in MDYYX format OR
2. I could simply change FIELD1 in master file (USAGE= trMDYY, ACTUAL=DATE).
For FIELD2 I want to display both date and time and display should look like ‘January 1, 1900 9:37AM’ format. This is where I run into problems. I could not find any function that would take an ‘HYYMDS’ field and display it in ‘January 1, 1900 8:37AM’ format. Only thing I could find was either ‘HYYMDSA’ or ‘HYYMDA’. I welcome any suggestion to get this resolved. Thanks in advance.
Mike


Prod: WebFOCUS 7.1.3 on Linux Kernel-2.6.5 zSeries 64bit/Apache Tomcat/5.0.28 JAVA version 1.4.2_11 server
October 12, 2006, 11:26 AM
Francis Mariani
This demo fex may be of assistance:
-SET &ECHO=ALL;

-SET &CURR_DATE = &YYMD;
-SET &CURR_TIME = EDIT(HHMMSS('A8'),'99$99$99');

-SET &CURR_DTTM = &CURR_DATE | &CURR_TIME;

DEFINE FILE CAR
CURR_DATE/HYYMDS WITH MODEL = HINPUT(14, '&CURR_DTTM', 8, 'HYYMDS');
END

TABLE FILE CAR
PRINT
CURR_DATE           AS 'A1'
CURR_DATE/HYYMDSA   AS 'A2'
CURR_DATE/HMTDYYSA  AS 'A3'
CURR_DATE/HMtDYYSA  AS 'A4'

COMPUTE CURR_YYMD/YYMD = HDATE(CURR_DATE, 'YYMD'); AS 'B1'
CURR_YYMD/MTDYY     AS 'B2'
CURR_YYMD/MTRDYY    AS 'B3'
CURR_YYMD/MtDYY     AS 'B4'
CURR_YYMD/MtrDYY    AS 'B5'
WHERE RECORDLIMIT EQ 1
END
-RUN



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
October 12, 2006, 11:31 AM
Prarie
Try This

DDATE/YYMD = HDATE(WKEND_DATE, 'YYMD');
NDATE/MtrDYY = DDATE;


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Prarie, I was already using HDATE function and it worked fine for “date only” display. I was having trouble in displaying “date-time together” in same format (January 1, 1900 9:37AM). Thanks to Francis, I tried his suggestion for Date-Time display and it worked great (except for a tiny difference which I am not worried about). I appreciate both of you for a quick response. Thanks again.
Mike


Prod: WebFOCUS 7.1.3 on Linux Kernel-2.6.5 zSeries 64bit/Apache Tomcat/5.0.28 JAVA version 1.4.2_11 server