Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to initialize a date field (L-field) in RPGLE???

625 views
Skip to first unread message

Interleuven

unread,
Nov 19, 1999, 3:00:00 AM11/19/99
to
Is there anyone who can tell me how I can initialize a date field within
RPGLE?
I'm having trouble initializing a date field within DSPF-fields and within
database fields.
I've tried all kind of things but nothing seems to work.
Another problem appears within the file fields while converting a numeric
empty field to a date field(L-field). These date fields become all
0001-01-01.
We are working under OS400 V4R3 and RPGLE.
Can somebody help me or do we have to keep using numeric fields for our
dates, what I don't hope because the L-field offers lots of advantages!

Thanks.

Koen Daniels

koen.d...@interleuven.be

Barbara Morris

unread,
Nov 19, 1999, 3:00:00 AM11/19/99
to
I assume you want to initialize a date field to the current date. The
easiest way depends on the release you are on.

V3R7 or later, you can use INZ(*SYS) or INZ(*JOB) to directly initialize
a date field. You can also use the TIME opcode with a date field in the
result to get the current date dynamically.

Earlier than V3R7, use the TIME opcode and MOVEL with *JOBRUN as the
date format:

D date S D
D DS
D timeres 12S 0
D timedate 6S 0 overlay(timeres:7)
C time timeres
C *JOBRUN movel timedate date

Barbara Morris

0 new messages