Printing Portions of a File

It is possible to print selected portions of a file by assigning an appropriate string value to the PRINTPARTIAL file attribute. You can select portions of a file by lines, records, or sequence numbers. LINES is the default clause, since printing lines of a file is usually the desired method. Records are zero-relative, and lines are 1-relative, so that record 0 is equivalent to line 1.

The keyword END corresponds to the last line or record of the file. If only one number is specified for a LINE, RECORD, or SEQUENCE clause, only that record or print line is printed. If two numbers are specified, all records or print lines in that range are printed. Multiple ranges are permitted in ascending order only.

The SEQUENCE clause is valid only for file types that have real sequence numbers; for example, nonbackup files such as symbol files and sequential files. The SEQUENCE clause is not valid for backup files because they do not have sequence numbers. If the SEQUENCE clause is used with a backup file (or a data file without sequence numbers), the sequence numbers are assumed to start at 100 and increment by 100, as CANDE currently does.

You can also select portions of a file by comparing a user-specified text value to a field in each record. If the comparison is true, the record will print.

You can also print a specified range of columns in a file. The start column and end column numbers are integers between 1 and the value of the MAXRECSIZE file attribute. The start column number must be less than or equal to the end column number.

Examples

The following are simple PRINT statements that cause the specified files to be printed:

PRINT DRONE/CLONE;
PRINT (JOHNS)ADD/BACK ON THREEPACK, (CAY)INVENTORY/LIST;

The following PRINT statements contain a print attribute phrase as part of the print specification:

PRINT (WENDY)FREE/CODE (BANNER=TRUE,
	NOTE="Review printout for John Smith" );
PRINT (JAKE)SCRAG/EXTRAS (SAVEPRINTFILE=FALSE, 
	PRINTERKIND=LINEPRINTER);

The following PRINT statement includes individual print specifications and common print modifiers as part of the PRINTDEFAULTS specification:

PRINT (LIZA)CAVE/DEPTHS (DESTINATION="LP5",PRINTCHARGE=4328),
      (GEORGE)WATER/COMP (DESTINATION="IP7",PRINTCOPIES=3);
          PRINTDEFAULTS=(HEADER=SUPPRESSED,TRAILER=UNCONDITIONAL,
                        PRINTPRIORITY=45);

The following PRINT statements show the use of the PRINTPARTIAL attribute to print portions of a file:

PRINT F1 (PRINTPARTIAL="1, 25-40, 80-END");
PRINT F1 (PRINTPARTIAL="LINES 1, 25-40, 80-100");
PRINT F1 (PRINTPARTIAL="RECORD 0, 24-39, 79-END");
PRINT F1 (PRINTPARTIAL="COLUMN 1-72 SEQUENCE 100-900");
PRINT F1 (PRINTPARTIAL="SEQ 100-900 @ 1-72");
PRINT F1 (PRINTPARTIAL="WHERE COL 1-5 = 'NAME:'");