The compiler validates DDS display file source (.dspf) at compile time. The following validations are performed:
Subfile control keyword conditioning indicators: The keywords SFLDSP, SFLDSPCTL, SFLCLR, and SFLEND on a subfile control record format (SFLCTL) must have conditioning indicators in DDS columns 7-16. Without indicators, these keywords would fire unconditionally on every output operation, making the subfile impossible to control from the RPG program.
Example of valid DDS:
A R SFLCTL SFLCTL(SFLREC)
A 30 SFLDSP
A 30 SFLDSPCTL
A 31 SFLCLR
A 32 SFLEND
If an indicator is missing, the compiler reports an error:
[ERROR] CUSTLIST.dspf:11:44 - SFLDSP on SFLCTL format 'SFLCTL' requires a conditioning indicator (e.g., 30 for *IN30)
SFLROLVAL and SFLRCDNBR mutually exclusive: A single subfile field may carry SFLROLVAL (operator-typed roll amount) or SFLRCDNBR (subfile record-number positioning), but not both. A field specifying both is reported as an error:
[ERROR] SFLROL.dspf:12:45 - field 'ROLLAMT' in format 'SFLCTL' specifies both SFLROLVAL and SFLRCDNBR; the two subfile keywords are mutually exclusive on a single field - use one or the other.
ERRMSGID references must resolve: ERRMSGID takes its message text from a message file, so the named file must be on the --dds-path (or beside the source) as <msgfile>.msgf, and it must describe the named message id. Either failure is reported against the DDS line - see ERRMSGID.
Subfile control record overlaps subfile record (CPD7812): The DDS must satisfy two constraints:
-
Row ranges must not intersect. SFL field row numbers are absolute screen positions. The rows spanned by the SFLCTL format's fields and constants must not overlap the subfile's display area, and that display area must fit on the screen - it is as many rows per record as the SFL spans, repeated
SFLPAGtimes. The screen height comes from the file-levelDSPSIZkeyword: 24 rows for*DS3and 27 rows for*DS4. WhenDSPSIZdeclares two sizes, the subfile must fit on both, so the smaller height applies. WhenDSPSIZis omitted, the display defaults to*DS3(24 rows). -
No screen position may be claimed twice. A field occupies its own columns plus the 5250 attribute byte in the column before it; a field at column 1 has its attribute byte on the previous row. No position may be claimed by both an SFLCTL field and an SFL field.
Common causes:
- Placing SFL fields at row numbers that overlap with the SFLCTL content area (e.g., SFL starting at row 1 when SFLCTL has fields at rows 1-3)
- A large SFLPAG value that causes the SFL display area to extend into or past the SFLCTL rows
- Placing SFLCTL heading constants on the same row number as SFL fields, causing column ranges to collide
Example of valid DDS (SFL uses row 1, SFLCTL headers on rows 2-3, footer in separate format):
A R SFLREC SFL
A OPT 1 B 1 3
A CUSTNO 7 0O 1 6
A R SFLCTL SFLCTL(SFLREC)
A SFLPAG(12)
A SFLSIZ(60)
A 2 26'Customer List'
A 3 3'Header'
A R SFLFTR
A OVERLAY
A 23 2'F3=Exit'
Field overlaps another field (CPD7866): Within a record format, fields and constants on the same row must not overlap each other's column ranges, including the 5250 attribute byte. On 5250 displays, every field has an invisible attribute byte in the column immediately before the field's start position. Two adjacent fields therefore need at least one gap position between them for the second field's attribute byte. Fields starting at column 1 are exempt from the attribute byte check because the 5250 hardware handles the attribute byte by wrapping it to the end of the previous row.
Example error:
[ERROR] CUSTLIST.dspf:5:18 - field 'FLD1' at row 5 columns 5-14 (attribute byte at column 4) overlaps field 'FLD2' at columns 10-19 (attribute byte at column 9) in format 'MYFMT' (CPD7866)
Field data type / keyboard shift (CPD7419): The data-type / keyboard-shift entry in DDS position 35 must be one of: a keyboard shift (A, X, N, Y, I, W, M, D, S, or the DBCS shifts J, E, O, G) or a date/time/timestamp data type (L, T, Z). A blank position 35 is also valid. Any other character is rejected (CPD7419). Note that position 35 is a keyboard shift and does not by itself make a field numeric - a field is numeric only when it has decimal positions (DDS columns 36-37); a numeric-only shift such as Y on a field without decimal positions is a character field that restricts operator entry to digits.
Example error:
[ERROR] MYSCREEN.dspf:3:35 - Data type 'Q' not valid for display file field 'BADFLD' (DDS position 35).