HP RPG/XL Programmer's Guide (30318-90001)

8- 2
Figure 8-1. Getting the System Date and Time
Comments
1 This line begins the data structure that holds the system date
and time.
2 This line specifies that the first field in the data structure
contains the time. The time is located in positions 20-27 of
the date and time string returned by TIME2 (see line 5).
3 This line specifies that the second field in data structure
contains the day of the week. The day of the week is located in
positions 1-3 of the date and time string returned by TIME2 (see
line 5).
4 The line defines the third field in the data structure. STAMP
includes all 27 positions of the data structure.
5 This line returns a string containing the system date and time.
Columns 28-32 contain TIME2 to return a formatted date and time
string.
Columns 33-42 contain 1 to specify the starting location in the
system date and time string where extraction is to begin.
Columns 43-48 name the field, STAMP, where the system date and
time string is stored.
Using System UDCs
A User-Defined Command (UDC) is an operating system command saved in a
file. UDCs are similar to job files except that they can be executed
interactively in session mode.
You can use UDCs to do many things. For instance, you can set up a test
UDC that loads an RPG program, then executes it. This test UDC can
contain file equations, program parameters, etc. Logon UDCs are also
handy. You set them up so that when a user logs onto the system, the UDC
is executed automatically. Logon UDCs are used primarily for displaying