Focal Point
[CLOSED] convert time from ms to seconds

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

March 09, 2009, 03:39 PM
Tomsweb
[CLOSED] convert time from ms to seconds
I have a report with a time field as
USAGE=P13.4, ACTUAL=P7, in the master file description.

When I create a report with that field, it displays as: 142100.0000

Any ideas on how to convert this field to diaplay in report as HH:MM:SS?

Thanks,
Tomsweb Winky

This message has been edited. Last edited by: Kerry,


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
March 10, 2009, 05:22 AM
GamP
Something like this maybe?
SET CDN=OFF

APP APPENDPATH IBISAMP

EX -lines 4 EDAPUT MASTER,FPTEST,CV,FILE,
FILENAME=FPTEST, SUFFIX=FIX, $
  SEGMENT=FPTEST, $
    FIELDNAME=TIMEFLD, USAGE=P13.4, ACTUAL=A13, $

EX -lines 3 EDAPUT FOCTEMP,FPTEST,CV,FILE,
142100.0000
151309.3674

-RUN
FILEDEF FPTEST DISK fptest.ftm (LRECL 15 RECFM V

DEFINE FILE FPTEST
TFLD/A8=EDIT(FTOA(TIMEFLD, '(D6)', 'A7'),'99:9$9:99');
END

TABLE FILE FPTEST
PRINT * TFLD
END
Hope this helps....


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
March 10, 2009, 03:13 PM
ypatel
quote:
Originally posted by Tomsweb:
I have a report with a time field as
USAGE=P13.4, ACTUAL=P7, in the master file description.

When I create a report with that field, it displays as: 142100.0000

Any ideas on how to convert this field to diaplay in report as HH:MM:SS?

Thanks,
Tomsweb Winky


Try this
Haven't tried myself
but the first field converts F to A and takes only first 6 chars, gets rid of decimal points.
NEWTIME/A6=FTOA(YOUR_TIMEFIELD, '(P13.4)', NEWTIME);
FMTTIME/A8 = EDIT(NEWTIME,'99:99:99');


-Yogesh Patel
------------------------------------------------------------------------
PROD: WF 764 on Linux Apache tomcat v5.5
DEV: WF 768 on Linux
March 10, 2009, 10:07 PM
jimster06
To convert a PACKED field to alpha, PTOA will work better.


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K