Focal Point
Convert Date To AlphaNumeric / Convert Time To AlphaNumeric / Date Time to Date-Time

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

February 22, 2011, 01:51 PM
bbollmann
Convert Date To AlphaNumeric / Convert Time To AlphaNumeric / Date Time to Date-Time
I have a DB2 file w/ two sets of Date Fields and two sets of Time Fields providing the start and stop time for a transaction.

I've spent 6 hours today searching the Forum and Help text trying to come up with a way convert those to date-time fields and determine the elapsed seconds between the time. My head hurts, so I'm asking for help

FILENAME=MNTWL101, SUFFIX=DB2     ,
 REMARKS='WOTS - Labor Tracking', $
  SEGMENT=MNTWL101, SEGTYPE=S0,
    DESCRIPTION='WOTS - Labor Tracking', $
    FIELDNAME=WLSDT, ALIAS=WLSDT, USAGE=MDY, ACTUAL=DATE,
      TITLE='Clock-In,Date', DESCRIPTION='Clock-In Date', $
    FIELDNAME=WLSTM, ALIAS=WLSTM, USAGE=HHIS, ACTUAL=HHIS,
      TITLE='Clock-In,Time', DESCRIPTION='Clock-In Time', $
    FIELDNAME=WLTDT, ALIAS=WLTDT, USAGE=MDY, ACTUAL=DATE,
      TITLE='Clock-Out,Date', DESCRIPTION='Clock-Out Date', $
    FIELDNAME=WLTTM, ALIAS=WLTTM, USAGE=HHIS, ACTUAL=HHIS,
      TITLE='Clock-Out,Time', DESCRIPTION='Clock-Out Time', $


To create a Date-Time w/ the HINPUT, I need to get the file's Dates and Times to AlphaNumeric fields.

I can get the date to be AlphaNumeric, but is there a better option?

DEFINE FILE MNTWL101
     D9DAT1/A8YYMD = WLSDT;
     D9DAT2/A10 = D9DAT1;
END


I cannot figure out a way to convert the time field to be AlphaNumeric. Please help me?

Additionally, I'd prefer to convert a Date Field (WLSDT) and Time Field (WLSTM) directly to a Date-Time field. If you can give me code to do that, I'd appreciate it.

Thanks!


Brian Bollmann
Spartan Light Metal Products
WebFocus 7.6.4 / iSeries / WebSphere
February 22, 2011, 02:41 PM
Prarie
Do some research on HDATE and HTIME. See if that helps
February 23, 2011, 10:59 AM
bbollmann
HDATE and HTIME go from Date-Time fields to Date or Time fields. I need to go the other direction.

Are you saying that HDATE/HTIME can go from Date Field or Time Field to Date-Time Field?


Brian Bollmann
Spartan Light Metal Products
WebFocus 7.6.4 / iSeries / WebSphere
February 23, 2011, 04:21 PM
Waz
Please check the documentation.

HDTTM: Converting a Date Value to a Date-Time Value

TIMETOTS: Converting a Time to a Timestamp


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 23, 2011, 05:10 PM
FrankDutch
it might be a smart idea for you to buy a nice book called "(Almost) 1001 Ways to Work with DATES in WebFOCUS" ISBN 978-0-9791722-1-2
It cost maybe 25 U$ and is worth all that dollars.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7