February 22, 2011, 01:51 PM
bbollmannConvert 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!
February 22, 2011, 02:41 PM
PrarieDo some research on HDATE and HTIME. See if that helps
February 23, 2011, 10:59 AM
bbollmannHDATE 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?
February 23, 2011, 04:21 PM
WazPlease check the documentation.
HDTTM: Converting a Date Value to a Date-Time Value
TIMETOTS: Converting a Time to a Timestamp
February 23, 2011, 05:10 PM
FrankDutchit 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.