|
Sorry for the simplistic point of view,... But I believe a date field DOES have a program described format, unless externally desribed.
As far as the Clear opcode,... Well the value is dependent upon what format the date field is in. *USA = 01-01-0000, *ISO = 0000-01-01, *YMD = 40-01-01, & *MDY = 01-01-40.
Regards,
Jon A. Erickson
Sr. Programmer Analyst
800.COM Inc.
1516 NW Thurman St
Portland, OR 97209-2517
Direct: 503.944.3613
Fax: 503.944.3690
Web: http://800.com
-----Original Message-----
From: booth@martinvt.com [mailto:booth@martinvt.com]
Sent: Thursday, July 06, 2000 9:42 AM
To: RPG400-L@midrange.com
Subject: RE: Dumb date question
It's not really that simple; we don't define a date field, ParmAsOf
already knows what it is - it is a date field and as such has no
program-defined format. There has been a lot of discussion about what
date fields look like on the inside, but it's insides aren't available for
casual review.
In this example, either "Today" is not a date field or the first piece of
coding is redundant. I had understood the question was for ParmAsOf to be
a mmddyy field (with or without a separator). But if ParmAsOf is really a
date field then I would still choose the line of code
C Time ParmAsOf
instead of the INZ solution because INZ happens at initialization time
which could have been yesterday or whenever the job started, not when this
line of code is executed.
Which raises a further question: If we use INZ(*SYS) in a job that runs
for three weeks and the we use the Opcode "Clear" do we get the original
date or the current date?
_______________________
Booth Martin
Booth@MartinVT.com
http://www.MartinVT.com
_______________________
Jon Erickson <jerickson@800.com>
Sent by: owner-rpg400-l@midrange.com
07/06/2000 10:09 AM
Please respond to RPG400-L
To: "'RPG400-L@midrange.com'" <RPG400-L@midrange.com>
cc:
Subject: RE: Dumb date question
Yes, but basically, you define the format of the date field either
implicitly by H-spec or data area or explicity via DATFMT keyword and
(*MDY, *YMD, *USA, *ISO, Etc.) as the parameter.
The move opcode using the *MDY in factor 1 tells what format the field
(TODAY) in factor 2 is. The date field ParmAsOf can be of any date
format, I'd hazard to guess *ISO, which is the default.
Hth,
Regards,
Jon A. Erickson
Sr. Programmer Analyst
800.COM Inc.
1516 NW Thurman St
Portland, OR 97209-2517
Direct: 503.944.3613
Fax: 503.944.3690
Web: http://800.com
-----Original Message-----
From: booth@martinvt.com [mailto:booth@martinvt.com]
Sent: Wednesday, July 05, 2000 5:52 PM
To: RPG400-L@midrange.com
Subject: Re: Dumb date question
This gets sooo confusing.
I don't understand how this works Jon. If you define ParmAsOf as a date
field, can it be a *MDY field too?
_______________________
Booth Martin
Booth@MartinVT.com
http://www.MartinVT.com
_______________________
Jon.Paris@hal.it
Sent by: owner-rpg400-l@midrange.com
07/05/2000 07:39 PM
Please respond to RPG400-L
To: RPG400-L@midrange.com
cc:
Subject: Re: Dumb date question
> C TIME TODAY
> C *MDY MOVE TODAY ParmAsOf
> I love date fields.
Mee too - but this is even nicer (V3R7 and later)
D ParmAsOf S D Inz(*Sys) or Inz(*Job)
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.