Unifoundry.com

Deckmate — A Punched Card Deck's Best Mate


Home
GNU Unifont
Unicode Tutorial
Deckmate
Hangul Fonts
Japanese Fonts
Olden
Unibetacode
Utf8gen
Utfcheck
Fontforge Poll
Downloads
Checking .sigs

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 output 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. Program lines with a '/' in column 1 or 2 are treated as IBM Job Control Language (JCL) statements and thus do not show solid field separators for one of the three directly supported programming languages. COBOL programs also show a dashed vertical line at the Margin B boundary.

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.

Example — COBOL with IBM 370 JCL

jwrex01.png

Jay Moseley kindly gave permission for this example of an IBM 370 COBOL Report Writer program that includes IBM JCL. This shows the PostScript output of deckmate converted to a PDF file with the ps2pdf utility. Note the dashed gray line at column 12 to mark the start of COBOL Margin B. Copyright © 2008 Jay Moseley. The commands to generate this file's PostScript and final PDF are:

     deckmate -i JRWEX01.CBL -o jrwex01.ps -l cobol
     ps2pdf jrwex01.ps
  

Here are the input source file and the PDF final output:

Example — FORTRAN IV

prime.png

This is the very first FORTRAN program I wrote that did anything non-trivial, using Digital Equipment Corporation's RT-11 FORTRAN IV compiler. Amazingly, this code still compiles with the GNU gfortran compiler 40+ years later. Note how the FORTRAN continuation column, column 6, is not ruled within the comment line in the final output to provide additional clarity. Copyright © 1977, 2020 Paul Hardy. The commands to generate this file's PostScript and final PDF are:

        deckmate -i PRIME.FOR -o prime.ps -l fortran
        ps2pdf prime.ps

Here are the input source file and the PDF final output:

Example — RPG

examp8.png

Jay Moseley also wrote this RPG program. RPG uses fixed format input with different field locations depending upon the type of RPG program statement. This listing includes RPG Header, File Description, Extension, Line Counter, Input, Calculation, and Output form types. Note that comment lines do not include vertical markings for separate fields, for additional clarity. Copyright © 2015 Jay Moseley. The commands to generate this file's PostScript and final PDF are:

        deckmate -i EXAMP8.RPG -o examp8.ps -l rpg
        ps2pdf examp8.ps

Here are the input source file and the PDF final output:

Example — IBM 370 Assembler

ifmtfill.png

Jay Moseley wrote this IBM 370 assembler program. deckmate does not have a special mode for marking field boundaries in IBM mainframe assembler listings. For such cases, column boundaries for drawing dashed vertical gray lines can be provided on the command line; here the "-t 10,16,72" option adds dashed vertical gray lines down the start of columns 10, 16, and 72. Copyright © 1996, 1997, 1998, 1999, 2000 Jay Moseley. The commands to generate this file's PostScript and final PDF are:

        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:

Example — 132-Column Output (PDP-11 Assembler Output)

bootrl-lst.png

The "-w" option produces a "wide" output in landscape mode. This is suitable for many types of line printer output. Here is an example of printing the 132-column output from the PDP-11 RT-11 MACRO-11 assembler. It was created with these commands:

        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:

Example — Changing Stripe Colors

examp8-blue.png

The "-c" option allows specification of a Red,Green,Blue color triplet. The values are floating point PostScript values, each with a range of 0 (respective color component is completely off) to 1 (respective color component is completely on). Here is an example of a light blue stripe, using the RPG program EXAMP8.RPG from above. The commands to generate this file's PostScript and final PDF are:

        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:

examp8-blue.pdf

To produce a completely white background, specify the option "-c 1,1,1".

Reference Files

deckmate.1.png

The Unix-style man (manual) page for deckmate is avaiable at this link:

deckmate.1.pdf

The source tarball and GnuPG signature file can be downloaded 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 eight 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.

Valid HTML 4.01 Transitional Valid CSS! Best Viewed with Any Browser