Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.
The sequence in which mock-up fields are matched with the data item
descriptions is the same as a page of text is read, from left to right across
each line of the mock-up starting with the top line and continuing to the
bottom.
AppMaster Builder matches the report mock-up fields to the data item
description entries in your program according to the following rules:
- The following are considered literals:
- The COBOL picture character A.
- Any one or more consecutive non-space, non-picture characters.
- Any single COBOL picture character, that is preceded and
followed by a space. Exception to this rule: 9 and X.
- A string of hyphens because of its frequent use for
underlining.
- A single COBOL picture character, such as -, X, Z, or 9, that is
embedded in a string of non-blank, non-picture characters is considered part of
a literal. For example, the following are literals:
and the following are pictures beside literals:
- AMB generates a VALUE statement for each literal in the mockup, and
does not match the literal with the data item descriptions in the program.
- Any legal COBOL picture longer than one character is considered a
COBOL picture, except for the letter S and the hyphen (-), and matches it to
the next data item description in the program.
- AMB considers any consecutive PIC characters in the mock-up as one
PIC character string, unless the string is matched with PIC clauses in
multiple, consecutive SOURCE statements.
- AMB assigns each PIC character string as the PIC for the next
sequential data item description, unless the next description contains a PIC
clause.
- When a data item description contains a PIC clause, AMB compares it
with an equal number of characters in the mock-up, starting with the next
sequential, unassigned character in the mock-up.
- When comparing a data item description entry with a PIC clause to
an equal number of characters in the mock-up and a non-match occurs, AMB
continues the comparison by moving one position to the right until it finds a
match. AMB considers the non-matched characters from this process to be a
literal, and generates a VALUE entry that precedes the data item description
with the PIC clause that initiated the comparison.
- When a PIC clause in a data item description does not match any
series of mock-up characters from the start of a comparison to the end of the
mock-up, AMB terminates processing and generates an error message.
- If a data item contains a PIC clause in a SOURCE or SUM statement,
it indicates that the next matching COBOL picture in the mock-up is the COBOL
picture for the statement. AMB compares it with an equal number of the next
unassigned characters. If no match occurs, the comparison moves one position to
the right until a match is found. If no match is found, an error message is
printed. For example:
Report mock-up:
Report program:
Report Writer matches DATA-1 and DATA-2 directly to the mock-up.
It then matches the PIC clause in the SOURCE statement for DATA-3 to the first
two X characters under FIELD-3, and the two remaining X characters to DATA-4.
If you omit the PIC clause on the DATA-3 SOURCE statement, an error occurs. If
you omit the DATA-4 SOURCE statement, AMB considers the XX a literal, because
there are no source statements remaining.