× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



hi Booth,

D wTimeStampEnd s z C eval wTimeStampEnd = C %timestamp('2007-06-12 06:00:00')

As 3500 replies have no doubt already told you, your syntax for the timestamp literal isn't quite right. You need a dash between the date and time, you need to use dots instead of colons, and you need to add the microseconds.

C eval wTimeStampEnd =
C %timestamp('2007-06-12-06.00.00.000000')

The weird thing about this code is that you've created a hard-coded character field, and you're running it through the %timestamp() BIF (which is basically an IBM provided subprocedure) to convert it to a timestamp field.

It'd be simpler (both for you, and for the computer) if you hard-code it as a timestamp literal instead of as a character string:

C eval wTimeStampEnd =
C z'2007-06-12-06.00.00.000000';

If you're getting your input from VARIABLES rather than hard-coding it as a literal (which isn't what the example in your e-mail stated, but perhaps you simplified the code for our sake) it might be easier to do this instead:

D MyDate s 10a inz('2007-06-12')
D MyTime s 8a inz('06:00:00')
D wTimeStampEnd s z

C eval wTimeStampEnd = %date( MyDate: *ISO)
C + %time( MyTime: *HMS)

Doing it this way (adding a date to a time) eliminates the need to hard-code the microseconds, and eliminates the need to muck around with changing colons into dots, etc.

It all depends on what you're REALLY trying to do... :)

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.