HP RPG/iX Utilities Reference Manual (30318-90006)
1-310
17 Chapter 1 RPGINIT
RPGINIT performs the following:
• Creates a Local Data Area (LDA) file and initializes the file to ASCII blanks.
• Creates and initializes the RPG user date file RPGUDATE to the current system date.
• Displays the contents of both files and the session's user switch settings.
Creating and Initializing the Local Data Area
The Local Data Area is a temporary file named LDAFILE and is used to pass information between RPG
programs and other programs or job control procedures (such as PROCMON/3000). RPGINIT creates and
initializes LDAFILE to blanks. The file can be created as 1 through 32 multiples of 256 bytes (such as 256,
512, 768, 1024,..., 8192 bytes). To access the Local Data Area from an RPG program, add an Input
specification with a "U" in column 18 and a "DS" in columns 19 through 20. This defines a data structure
named "LDA"; specification of the data structure name is optional.
The LDA record layout is defined in the Input specifications following the "UDS" specification. The
runtime library defines the entire Local Data Area as an array "LDA". The array is made up of 1-byte
elements totalling the size of the entire LDAFILE (that is, 256, 512, 768, 1024,..., 8192 bytes). The LDA
array is defined by RPG; do not define the array on an Extension specification.
When the RPG program begins, the Local Data Area is automatically read into the LDA data structure.
The data is available for first cycle (1P) output. When the program terminates, the LDA data structure is
automatically written to LDAFILE.
NOTE Ifa file named LDAFILEalready exists when RPGINITis run, that fileisreinitialized
to blanks and any prior data is lost.
Creating and Initializing the RPG User Date File
RPGINIT creates and initializes the RPG User Date File, named RPGUDATE, to the current system date.
RPGUDATE is a temporary file containing one 80-byte record.
The date is in the form mmddyy, beginning in position 1 of the RPGUDATE record. This file is used for
RPG programs with an "F" specified in Header Column 17 (UDATE Source). Programs with this
specification initialize the RPG reserved date fields UDATE, UDAY, UMONTH, and UYEAR from the
RPGUDATE file rather than from the operating system date. This allows programs to be run using a date
that is different than the operating system date.
Running RPGINIT
To create and initialize the files LDAFILE and RPGUDATE, run RPGINIT with the command
RUN RPGINIT.PUB.SYS [;PARM=n ] [,QUIET]
where n can be a value of 1 through 32. The PARM value n represents a multiple of 256, as shown in the