HP3000-L Archives

May 1996, Week 1

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:
Larry Boyd <[log in to unmask]>
Reply To:
Larry Boyd <[log in to unmask]>
Date:
Mon, 6 May 1996 08:14:32 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (27 lines)
On  3 May 96 at 16:37, Don Harrington wrote:
 
> I have an eight character date (YYYYMMDD) that I am trying to add a
> number of days to to arrive at another date.  Here is the code:
>
> DEFINE DATE-ISS INT*8 (or DATE, either one gives the same results) =
> NCONVERT(DATE-ISSE)  (DATE-ISSUE being thedate I am trying to add to)
> DEFINE DUE-DATE-CALC INT SIZE 4 = DAYS(DATE-ISS) + FREQUENCY-I &
>         IF FREQ-8UNIT = "D" ELSE DAYS(DATE-ISS) + FREQUENCY-I * 365 &
>         IF FREQ-UNIT = "Y"
> DEFINE DUE-DATE-CHAR CHAR*8 = ASCII(DATE(DUE-DATE-CALC))
>
> My problem is that DUE-DATE-CALC is always zero.  What am I doing wrong
> (no editorial comments, please)?
Don,
 
My guess is the FREQ-UNIT (I assume that FREQ-8UNIT is a typo in your
post and not in the code) is *not* equal to "D" or "Y".  Is this field
a 2 or more character field and the value is not in the first position?
If I remember QUIZ correctly, if all IFs fail, the value will be set to
0?
 
Larry Boyd    <[log in to unmask]>
"Each problem solved creates the opportunity to solve the next problem
          that the last solution created." - Richard Pascale
(These opinions are my own and not those of Hewlett-Packard.)

ATOM RSS1 RSS2