Previous Topic: Field-Level Justification

Next Topic: Input Padding and Justification


Variable-Level Justification

This operates independently of field-level justification, and applies to the data substituted for field variables defined as requiring variable-level justification. Variable-level justification is designed to help tabulated output, where data of differing lengths is substituted for a series of variables and where the normal substitution process disrupts display formats. The #FLD Statement operands that control variable-level justification are VALIGN and PAD.

The substitution process substitutes data in place of the &variable without creating additional characters. Thus, if a variable (for instance, &VARIABLE) is replaced by data (for example, Data), any characters following this are moved left to occupy any spaces remaining after substitution (this occurs if spaces are freed going from a long variable name to a shorter data length).

#NOTE   This sample panel definition gives examples of the
#NOTE   use of variable justification, padding, and field
#NOTE   justification.
#FLD # VALIGN=LEFT
#FLD $ VALIGN=RIGHT
#FLD @ VALIGN=CENTER
#FLD ? VALIGN=LEFT PAD=.
#FLD / VALIGN=RIGHT PAD=.
#FLD } VALIGN=CENTER PAD=.
#FLD ! VALIGN=LEFT JUST=RIGHT PAD=.
#&VARIABLE other data               +
$&VARIABLE other data               +
@&VARIABLE other data               +
?&VARIABLE other data               +
/&VARIABLE other data               +
}&VARIABLE other data               +
!&VARIABLE other data               +

Variable-level justification, controlled by the VALIGN operand of the #FLD statement, lets you influence the way substitution is performed.

Note: Variable-level justification is only performed if the length of the data being substituted is less than the length of the variable name being replaced, including the ampersand (&).

Assume the following variable assignment statement has been executed by the NCL procedure before displaying the sample panel:

&VARIABLE = Data

&VARIABLE is the only variable within a field that contains the words ‘other data’. Where both field justification and variable alignment are used, the padding character applies to both, as shown by the last line of the example for the field character !. The sample panel is displayed as follows:

Data    other data
Data other data
Data  other data
Data..... other data
.....Data other data
..Data... other data
.................................Data..... other data