This program is designed specifically to take a file of fixed length records and produce a formatted file (on disk) containing page breaks, and heading information suitable to copy to a printer.
Pagefmt was originally designed to format mainframe data for printing on PC's. However, it does an excellent job of creating quick "reports" from text data.
The records should be carriage return delimited but that is not required.
In either case they MUST be of a fixed length.
The program reads information from the command and formats a fixed length record file with page breaks, column headings, page titles and other information necessary to later take the output file directly to a printer.
An optional header file can be provided which would contain any heading(titles, column headings) that you would want printed on the top of each new page.
The program will read the header file and place its contents after each page break is issued.
Page breaks are issued at a default of 55 records based on the record length provided or found (if no record length is provided, the carriage return location of the 1st record is used as the record length).
Page length (page breaks) can be altered using the -L option.
If the -p and -l options are provided, the file is assumed to be sorted on the field designated by the -p -l parameters. In this case, a new page (complete with appropriate headings, and breaks) will be started at each new key, or 55 records whichever is appropriate. This is useful to get a seperate page for each sort item. If no -p -l is used, then the 55 record default (or -L) is used.
C:>pagefmt input_file output_file -[options]
-r + #: Where # is the record length. For records without carriage returns, this is mandatory. If the records have carriage returns, it is not required. The program will locate the record length.
-p + #: Where # is the position of the sort key field
-l + #: Where # is the length of the sort key field
-b: Add ‘B’lank lines after each key. The -b option, when used with the -p and -l options causes a blank line to be inserted before each new set of records with different sort keys. Also, if this option is used, the page breaks are not inserted, and NO heading information can be used.
This option maintains a fixed length format to the records for additional processing. That is why no other page formatting options can be used. If page breaks and headers are needed, a second pass can be made using the appropriate -tdn options.
-L + #: Where # is the new page length in number of records. (Default is 55 records per page)
-t + name: Where name is the name of the file containing headings for each page. If no headings are provided, there is still a page break installed every 55 records.
-nN: Add page numbers to the top of each page. -n places numbers on top left, -N on top right.
-d: Add date to top left of page. (if used, -n converts to -N)
-f: Places filename top center of each page.