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

5- 13
Comments
1 This line defines the field PRODID. It occupies positions 31 to
40 in the input record.
2 This line marks the beginning of the data structure PRODID. The
next three lines define the subfields of the PRODID field.
3 This line defines the first subfield of PRODID. Notice that
CATLOG is defined further by the next data structure (line 4).
4 This line is the beginning of the data structure CATLOG. The
next two lines define the subfields of the CATLOG field.
5 The first subfield of CATLOG is CLASS. It is a one-character
field starting with the first position of CATLOG.
6 The second subfield of CATLOG is REFNO. It is also a
one-character field starting with the second position of CATLOG.
NOTE You can nest data structures to the number of levels necessary.
This feature is unavailable in most implementations of RPG.
Figure 5-9 shows subfields defined in a different way from those shown in
the previous figure. However, the end results of the two examples are
identical.
Figure 5-9. Alternate Way to Define Subfields within a Field
Comments
1 This line defines the input field, PRODID, whose subfields are