HP OpenVMS Systemsask the wizard |
The Question is: Is there an appropriate syntax in the VMS PRINT command to print only the last page of a report without knowing the number of the last page beforehand? The Answer is :
PRINT does not currently offer a "/TAIL" qualifier.
If this is a Postscript file, you can often locate the length of
the file from the following common Postscript sequence:
%%Pages: (atend)
%%Pages: 16
and would thus know that the file is 16 pages of Postscript output.
Alternatively, you could simply search for the string "%%Pages:" in
the Postscript file.
With a queue and an ASCII text file, you would typically need to
create a temporary (intermediate) file:
$ TYPE/TAIL file.ext /OUTPUT=sys$scratch:tempfile.tmp
$ PRINT sys$scratch:tempfile.tmp /DELETE
If you can have multiple activities in parallel, you will want to
append the system time and/or process ID to the filename in order
to prevent filename collisions that can result from duplicates.
With a spooled device and an ASCII text file, you can also use the
following DCL command:
TYPE/TAIL/OUTPUT=device: LOGIN.COM
|