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 would disrupt display formats. The #FLD operands that control field level justification are VALIGN and PAD.

The substitution process normally substitutes data in place of the &variable without creating additional characters. Thus, if a variable (for example, &VARIABLE) is replaced by data, any characters following this are moved left to occupy any spaces remaining after substitution (that is, 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 which 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 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