Please enable JavaScript to view this site.

A-Shell Reference

Revised May 2026

The characters N and n characters in PRINT USING MASK expressions present a potential ambiguity problem as to whether to treat them as literal or as special mask specifiers. To resolve this ambiguity, the following rules are applied:

If immediately preceded by another alphabetic character, treat as literal
If there are any other alphabetic characters anywhere to the right of the N or n, up to the end of the mask, treat as literal
Otherwise (i.e., if immediately preceded by a non-alphabetic character, with no alphabetic characters to the right), treat as numeric field mask specifier.

For example:

PRINT USING "Neg. scans: NNN", X

PRINT USING "Neg. scans: NNN (total)", X

PRINT USING "Neg. scans: #nn (total)", X

In all three statements, the "N" in "Neg." and the "n" in "scans" are treated as literals, since they are adjacent to alphabetic characters.

In the first statement, the "NNN" acts as a mask, because there are no subsequent non-alphabetic chars. In the second, the "NNN" is treated as a literal, because of the trailing alphabetic chars in "total". In the third, the "#nn" is treated as a mask because "#" is an unambiguous leading mask character.

Note that this limitation effectively disables the use of the leading "N" and "n" mask characters in PRINT USING MASKs containing trailing text, but it doesn't affect the use of "N" or "n" as trailing mask characters (e.g. "##.nn"), and doesn't generally affect the common case of <VALUE> USING MASK expressions unless they contain trailing alphabetic characters, which is odd but legal.

History

2015 May, A-Shell 6.1.1410.1:  Revise handling of N and n characters in the mask to match the above description. Previously, all  N  and  n  characters were treated as numeric mask specifiers.