Subject: | |
From: | |
Reply To: | |
Date: | Fri, 21 Jul 2000 15:35:58 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
At 2:50 PM -0700 7/21/00, [log in to unmask] wrote:
>Below is a test attempting to use 'datebuild' and 'strwrite'. I have
>used it in the past without a problem. Can anyone see what is wrong
>with my syntax?
>
>%
>%SETVAR DATE1 DATEBUILD(!HPYEAR,!HPMONTH,!HPDATE)
>%
>%SETVAR DATE1 STRWRITE(DATE1:'%4Y')
>Error: Format specifier contained %4Y, expected one of:
> GARBAGE CENTER
>Error: Bad format specifier.
I believe that STRWRITE is seeing DATE1 as a string variable, not a date
variable. As such, '%4Y' is not a valid formatting option. But I just tried:
%setvar date1 strwrite(datebuild(!hpyear,!hpmonth,!hpdate):'%4Y')
That seems to work fine. However, it simply produces a 4-digit year,
throwing away the month and date. If that's all you're seeking, then why
not just use the HPYYYY variable? Or if you're trying to produce a
century-included date string, then just insert slashes into the HPYYYYMMDD
variable. Perhaps I'm missing something?
Barry Lake [log in to unmask]
Allegro Consultants, Inc. www.allegro.com
(408)252-2330
|
|
|