HP3000-L Archives

July 2000, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Barry Lake <[log in to unmask]>
Reply To:
Barry Lake <[log in to unmask]>
Date:
Fri, 21 Jul 2000 15:35:58 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (30 lines)
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

ATOM RSS1 RSS2