MAC-PAC Homecontact ussupport login 
Documentation > MAC-PAC Reference and Help > Technical Support > Key Concepts and Procedures > International Translation Facility > Coding/Design Rules for Translator Standards

Coding/Design Rules for Translator Standards

 

 

1.   Coding Character Strings

Character strings can be coded in three different places when a program is written: output specs, DDS specs, and calculation specs.

2.   Output Specifications

Character strings in output specs are coded in columns 45 through 70.  Column 45 must contain a quote, and there must be one other quote on the line.

All strings must be coded to the length allocated to the string, which in many cases will be greater than the number of characters in the English format being coded.

Any character string that has a length attribute greater than 24 must be coded over two or more lines.  When this is required, a continuation character must be coded on all but the last line. This continuation character is a hyphen (-) in column 80.  This is not an RPG requirement, but a Translator standards requirement.

When the length is greater than the number of characters to be coded, the string should be left-justified with trailing spaces, except for stacked fields, which should be centered whenever possible.

Stacked fields require careful programming because the top and bottom of the stacks must be coded separately.

Assuming that processing of output specs is done on an exception line (using EXCPT) basis (all other types will follow the same convention), the bottom of the stack appears in the group of lines directly following the group containing the top of the stack.  The top and bottom must be coded as the same length and must have the same end positions (column 40-43).  Some stacked character strings occupy a total of four lines if the length attribute is greater than 24.  In this case, the first and third lines will have matching end positions and lengths, as will the second and fourth.

3.   DDS Specifications

DDS specs allow a character string of up to 34 characters on each line (columns 45 through 80 with an opening quote in column 45).

The basic rules for DDS specification coding are the same as the rules for output specs, except:

1.   One line may contain 34 characters without requiring a continuation (output    spec MAX=24).

2.   No closing quote is allowed for continuations (first line).

3.   The continuation character (-) must be in column 80. Although a plus sign (+) is normally a valid continuous character, it is not allowed by Translator standards.

4.   The line after the continuation begins in column 45 without an opening quote.

5.   Stacked fields cannot occupy more than two lines (the maximum length of a             stacked field or subheading is 34).

6.   If a field or subheading is stacked, the top and bottom must:

A.   Appear on consecutive DDS spec lines,

B.   Both have an "S" in column one of the spec,

C.   Have the same position (columns 42-44),

D.   Be coded to the same length.

4.   Calculation Specifications

The calculation specs are rarely used to move a character string to a report or screen, but when they are, they should be coded to standards.

Overriding any previous rules, all calculation spec strings are given a length attribute equal to the number of characters in the string.

The calculation spec allows eight characters to be coded between columns 33 and 42 with an opening and closing quote. If the string is eight characters or less, it is coded to the exact length and a hyphen ('-') is placed in  column 80.  (This should not be confused with the continuation character hyphen in the output specs.)  For strings greater than eight characters, each line except the last line is coded with a length of eight and has a plus sign ('+') in column 80.

All lines that contain parts of the character string must be coded next to each other.

5.   Special Considerations

1.   All constants coded inside quotes in output specs and DDS specs are processed for translation. Certain constants should not be translated and so should not be in the output specs.  For example, the report number should be moved to an output field in Housekeeping and not hard-coded into the output spec.

2.   Not all constants in the calculation specs are eligible for translation.  (For example, MOVE 'END' PGMSTS and such lines should not have either a '-' or '+' coded in column 80).

3.   When designing reports and screens, know which character strings are already maintained on the standards file.

4.   Lower case and upper case versions of the same character string are allowed and are considered separately.

5.   All programs must run through the translator successfully before being "signed off," so that potential difficulties can be identified early.

6.   In DDS specs, keywords such as "DSPATR" should not be coded on the same line as a character string.