Specifications
A-1Calculating Page Lenght Using Printer Colon File Escape Sequence
Appendix A. Calculating Page Length Using Printer
Colon File Escape Sequences
The printer colon file for an ASCII queue on an IBM 4029 LaserPrinter defines page length,
in lines, with the work attribute wL. Obtaining a numeric value for wL involves evalutating
embedded references in the definition of wL. As formatted by the lsvirprt commmand, wL
is defined as follows:
Page Length In Chars, Using Length From Data Base (used in
pipelines)
wL = %?%Cl%t%f!l%e%I_l%;
%? <IF>
%Cl PUSH: (1 If –l Flag on Command Line; Otherwise 0)
%t <THEN>
%f!l For Each Flag x on Command Line: ”–xArgument” –>
OUTPUT
%e <ELSE>
%I_l INCLUDE: (LINES per page)
%; <END>
The %Cl checks to see if the l flag was used on the command line; if it was, then a 1 is
pushed onto the stack, else a 0 is pushed onto the stack. In this case, the l flag was not
used on the command line so a 0 is pushed onto the stack. The %t checks for a true
(non–zero) value on the stack and, not finding one, executes the %e (else) construct %I_l.
_l is defined as %IwY, shown below as formatted by the lsvirprt command.
Default Page Length (lines)
wY = %?%G_z%{1}%&%t%GwJ%e%GwK%;%G_v%*%{300}%/%d
%? <IF>
%G_z PUSH: (Page ORIENTATION)
%{1} PUSH: (Integer Constant 1)
%& PUSH: (pop2 & pop1) –– Bitwise AND
%t <THEN>
%GwJ PUSH: (Primary Page Width (–z 0) or Secondary Page
Length (–z1), in pels)
%e <ELSE>
%GwK PUSH: (Primary Page Length (–z 0) or Secondary Page
Width (–z1), in pels)
%; <END>
%G_v PUSH: (LINE DENSITY (lines per inch))
%* PUSH: (pop2 * pop1)
%{300} PUSH: (Integer Constant 300)
%/ PUSH: (pop2 / pop1)
%d POP –> ASCII String –> OUTPUT
The calculation of _l begins by pushing the value of _z, page orientation, onto the stack.
The job submission command being used in this example, qprt –a1 –Pasc –fp –z1
–p12 –scourier –C –N3 /etc/motd, specifies a z value of 1, so a 1 is pushed onto
the stack. The %{1} pushes another 1 onto the stack, after which the %& pops the top two
values (both 1 s) off the stack and performs a bitwise AND with the two values. The result of
the bitwise AND, a 1, is pushed onto the stack.
Note: The test is a bitwise AND instead of a simple test for equality because the legal
values for the z flag are 0, 1, 2, and 3, correpsonding to the legal number of 90 degree
rotations that can be applied to a printed page.