Subject: | |
From: | |
Reply To: | VANCE,JEFF (HP-Cupertino,ex1) |
Date: | Thu, 3 Apr 2003 15:23:43 -0800 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Donna wrote:
> given the following:
>
> HPDATETIME = 20030403133637300
...
> you (or i :-) want to extract "030403" (yymmdd) and "1336" (hhmm)
> without resorting to substring manipulation (eg: setvar foo
> pos(hpdatetime,3,6) and setvar bar pos(hpdatetime(9,4)).
However you extract the part(s) you want, make sure you do NOT
reference HPDATETIME more than once. The reason is to ensure
that you don't reference once before and once after a boundary
condition, such as the day changing. I would do it this way:
setvar tmp hpdatetime
setvar my_yymmdd str(tmp, 3, 4)
setvar my_hhmm str(tmp, 9, 4)
HTH,
Jeff Vance, vCSY
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|