IBM AS/400 Frozen Dessert Maker User Manual


 
Using Program-Described WORKSTN Files
Input Specifications
The input specifications describe the record that the RPG program receives from
the display or ICF device. The WORKSTN file name must be specified in positions
7 through 16. Input fields must be located in the input record in the same sequence
as defined in the DDS; however, the field names do not have to be the same. The
field location entries refer to the location of the fields in the input record.
To receive indicators on input, do one of the following:
Specify the keyword INDARA in the DDS for the WORKSTN file. Do not use
the PASS(*NOIND) keyword on the file description specification and do not
specify the indicators on the input specifications. The program and file use a
separate indicator area to pass the indicators.
Specify the PASS(*NOIND) keyword on the file description specification.
Specify the indicators in the input specifications as fields in the form *INxx.
They must appear in the input record in the order specified by the WORKSTN
file DDS. You can determine this order from the DDS listing.
A record identifying indicator should be assigned to each record in the file to iden-
tify the record that has been read from the WORKSTN file. A hidden field with a
default value can be specified in the DDS for the record identification code.
Calculation Specifications
The operation code READ is valid for a program-described WORKSTN file that is
defined as a combined, full-procedural file. See Table 28 on page 341. The file
name must be specified in factor 2 for this operation. A format must exist at the
device before any input operations can take place. This requirement can be satis-
fied on a display device by conditioning an output record with 1P or by writing the
first format to the device in another program (for example, in the CL program). The
EXFMT operation is not valid for a program-described WORKSTN file. You can
also use the EXCEPT operation to write to a WORKSTN file.
Additional Considerations
When using a format name with a program-described WORKSTN file, you must
also consider the following:
The name specified in positions 53 through 80 of the output specifications is
assumed to be the name of a record format in the DDS that was used to create
the file.
If a Kn specification is present for an output record, it must also be used for
any other output records for that file. If a Kn specification is not used for all
output records to a file, a run-time error will occur.
Using a Program-Described WORKSTN File without a Format Name
When a record-format name is not used, a program-described display-device file
describes a file containing one record-format description with one field. The fields
in the record must be described within the program that uses the file.
When you create the display file by using the Create Display File command, the file
has the following attributes:
A variable record length can be specified; therefore, the actual record length
must be specified in the using program. (The maximum record length allowed is
the screen size minus one.)
340 ILE RPG for AS/400 Programmer's Guide