Pretty Printing Fixed Format Punched Card Decks
The deckmate
package prints old fixed-format
80-column program listings (historically from punched card
decks, hence the name) and 132-column line printer printouts
on simulated line printer paper output as a PostScript file.
Language-specific field separators are marked in the printout.
The program optionally will mark fields with user-specified
dashed gray lines. The popular ps2pdf
utility
can convert these PostScript output files to PDF.
The default printout provides column numbers from 01 to 80 or 132 across the top of each page, with 6 white lines of listing followed by alternating three line groups of green and white lines, as on old line printer paper. The green striped lines can be customized to a different color, including white for a plain white background.
Printout options for COBOL, FORTRAN, and Report Program Generator (RPG) have dashed and solid vertical lines in a listing to mark fields in early fixed-format versions of those languages. COBOL programs also show a dashed vertical line at the Margin B boundary.
COBOL, FORTRAN, and RPG program lines with anything other than
spaces or a single decimal number in the first five columns are
treated as IBM or CDC NOS Job Control Language (JCL) and do not
show solid vertical field separator lines between fields. The
"DD=
" option also allows specification of an IBM
Data Definition JCL ddname that begins data set input, at which
point no further vertical field separators for COBOL, FORTRAN,
or RPG will appear. This allows language-specific field delimeters
in those three languages to show while not interfering with
program input data having different field boundaries.
deckmate
also accepts an option to output dashed
gray lines at user-specified columns for other languages (such
as assembler) and to separate fields in fixed-format data sets.
RPG still uses fixed-format statements with field boundaries dependent upon each statement type, which maintains some modern relevance to these old languages.
Files that use FORTRAN carriage control characters in the first column support overstriking. If a letter is overstruck over the same letter that appeared in the preceding non-overstruck line, it will appear in boldface.
The default font for listings is the built-in Type 1 Courier PostScript font. Three alternatives for listing font can be selected: Cardpunch, DOTwriter, and DOTwriterAPL. The DOTwriterAPL font implements the ISO-IR-68 APL encoding. See http://unifoundry.com/retro/ for details.
Example — COBOL with IBM 370 JCL
deckmate -i JRWEX01.CBL -o jrwex01.ps -l cobol DD=GO.DATAIN ps2pdf jrwex01.ps
Here are the input source file and the PDF final output:
- JRWEX01.CBL — source file [see http://www.jaymoseley.com/hercules/compiling/cobolrw.htm]
- jrwex01.pdf — formatted output
Example — FORTRAN IV
deckmate -i PRIME.FOR -o prime.ps -l fortran ps2pdf prime.ps
Here are the input source file and the PDF final output:
Example — ISO-IR-68 APL
deckmate -i PRIMES.APL -o aplprimes.ps -F DOTwriterAPL ps2pdf aplprimes.ps
Here are the input source file, PDF final output, and ISO-IR-68 encoding:
- PRIMES.APL — source file
- aplprimes.pdf — formatted output
- DOTwriterAPL-1.2-test.pdf — ISO-IR-68 encoded DOTwriterAPL font
Example — RPG
deckmate -i EXAMP8.RPG -o examp8.ps -l rpg ps2pdf examp8.ps
Here are the input source file and the PDF final output:
- EXAMP8.RPG — source file [see http://www.jaymoseley.com/hercules/rpgtutor/rpg020.htm]
- examp8.pdf — formatted output
Example — IBM 370 Assembler
deckmate -i IFMTFILL.ALC -o ifmtfill.ps -t 10,16,72 ps2pdf ifmtfill.ps
Here are the input source file and the PDF final output:
- IFMTFILL.ALC — source file [see http://www.jaymoseley.com/programming/code/IFMTFILL.ALC]
- ifmtfill.pdf — formatted output
Example — 132-Column Output (PDP-11 Assembler Output)
deckmate -i BOOTRL.LST -o bootrl-lst.ps -w -t 9,17,25,33,41,49,57,73,121 ps2pdf bootrl-lst.ps
Here are the input source file and the PDF final output.
Note: the BOOTRL.LST
file is ASCII,
but your browser might not recognize it as such —
it begins with a Carriage Return character with no Line Feed,
and ends with trailing nulls that the RT-11 MACRO-11 assembler
generated when creating the file.
deckmate
handles such input properly:
- BOOTRL.LST — MACRO-11 output file
- bootrl-lst.pdf — formatted output
Example — Overprinting and Boldface
deckmate -i OVERPRINT.TXT -o overprint.ps ps2pdf overprint.ps
Here are the input source file and the PDF final output.
- OVERPRINT.TXT — text input file
- overprint.pdf — formatted output
Example — FORTRAN (ASA) Carriage Control
deckmate -i FORCC.TXT -o forcc.ps -CC 3,7 ps2pdf forcc.ps
Here are the input source file and the PDF final output.
Example — Changing Stripe Colors
deckmate -i EXAMP8.RPG -o examp8-blue.ps -l rpg -c 0.8,.93,1 ps2pdf examp8-blue.ps
The blue element, with a value of 1, is the only color component at full intensity. Here is the PDF final output:
To produce a completely white background, specify the option
"-c 1,1,1
".
Documentation
The Unix-style man (manual) page for |
Download
The source tarball and GnuPG signature file are at these links:
No punched cards were bent, folded, spindled, or mutilated in the creation of this software.
Installing Deckmate
Compiling the package requires a C compiler and the Unix
make
utility. To compile and install the
Deckmate package on a system with a Unix-style command
line interface (GNU/Linux, BSD, Mac OS X, Cygwin, etc.),
type these commands in a terminal window:
./configure make make check make install make clean
The "make check
" command will run 15 tests
using sample fixed-format program listings in COBOL, FORTRAN,
RPG, IBM 370 assembler, and PDP-11 assembler that are in the
"examples
" directory.
The "make install
" command might need to be run as
"sudo make install
" on your system.
Following installation, a check of proper functioning of the
installed package can be verified with the command:
make installcheck
By default, the standalone program, deckmate
,
will be installed in "/usr/local/bin
"
and the man (manual) page will be installed in
"/usr/local/share/man/man1
". To override
these defaults, see the detailed instructions in the
INSTALL
file in the source package.
License
The software on this site, unless otherwise noted, is released under the terms of the GNU General Public License (GNU GPL) version 2.0, or (at your option) a later version.
The deckmate
source code is Copyright ©2020 Paul Hardy.
The Cardpunch, DOTwriter, and DOTwriterAPL fonts are Copyright ©2020 Paul Hardy and licensed under the SIL Open Font License (OFL) version 1.1. Any output files containing those embedded fonts thus are covered under the terms of embedded SIL OFL fonts.
See the AUTHORS
file in the source package for full details.