Re: RPG DATE QUESTION
- From: "Pat Landrum" <pat_landrum@xxxxxxxxxxx>
- Date: Mon, 26 Jun 2006 18:24:33 -0400
If the field in the file is not defined as a date field, why treat is as
such. If you want to make sure it contains a valid date use the TEST op
code.
Example testing order date. (You don't have to use RPG_Free)
/free
If OrderDate <> *Zeros;
Test *USA OrderDate; // Use whatever date format the data
represents
If %Error; // numeric data is not a date
OrderDate = *Zeros;
EndIf;
/end-free
"Eb" <emcook@xxxxxxxxx> wrote in message
news:dnf0a2ltnihbahp8ojj6bdh17pverh4n13@xxxxxxxxxx
Date fields must have a valid date. All zero's is not a valid date.
I don't like it either, but thats the rule.
On 26 Jun 2006 13:03:50 -0700, "Roscoe" <Roscoe_Floyd@xxxxxxxxxxx>
wrote:
In an RPGLE program I'm trying to zero out a *ISO date not clear it. I
have some customer records that have 0 for a maintenance date and I
need to select them. The date in the file is 8 not *ISO I'm loading
both date fields in "D" type variables and comparing. This works fine
if both dates are not zeros but I'm having trouble with 0 compare.
There has to be a real easy way to do this I'm just missing it. What I
want to do is just INZ the selection date to zeros but I get an error.
If the default value for the selection date is zeros and the date
coming from file is zeros then the record will be selected. I think
there is an easy answer to this and I'm just missing it.
I've tried : C EVAL #WEND =
*ALL'0'
EXAMPLE
D#WEND D
VALUE('0000-00-00') INZ('0000-00-00')
DFT('0000-00-00')
D#WORD D
if order date equals ending date add to counter
if #wend = #word
eval rcdcnt += 1
end
.
- Follow-Ups:
- Re: RPG DATE QUESTION
- From: Dale Berta
- Re: RPG DATE QUESTION
- References:
- RPG DATE QUESTION
- From: Roscoe
- Re: RPG DATE QUESTION
- From: Eb
- RPG DATE QUESTION
- Prev by Date: Re: QbnEndPreProcessor
- Next by Date: Re: how to translate to free format?
- Previous by thread: Re: RPG DATE QUESTION
- Next by thread: Re: RPG DATE QUESTION
- Index(es):
Relevant Pages
|