Print Job Assignment (Print Reports)
DataBasic allows you to generate multiple 'print reports' simultaneously, and can assign different numbers to each. These can be in the range 0 to 127 (the default is to output to print report 0). For example, the following PRINT statements (provided PRINTER ON is in effect) add data to print reports 1 and 2 respectively:
PRINT ON 1 "REPORT ONE" PRINT ON 2 "REPORT TWO"
Note
Further PRINT statements add more data to a specified print report number, or to the default print report (0) if a print report number is not specified. When PRINTER CLOSE is executed or the program terminates, all open print reports are 'closed', and a print job is generated for each closed print report.
TCL, English and Proc only print to one 'print report' (0). For example, the CP command in TCL and an English sentence with option P both print to 'print report 0'. The print report is closed and a print job is generated when the command completes execution.
The print report number determines the options, copies, job-id prefix, formqueue and jobfile for each print job according to the assignment table entries present when the print job is generated.
Assignment Table
Each report number can have an entry in the process's assignment table, which specifies the characteristics to be applied to that report number.
At logon the assignment table contains just a default assignment entry comprising:
Formqueue Copies printed Job file Job name Spooler options |
STANDARD 1 SPOOL.JOBS none none |
All report numbers without a specific entry in the assignment table are given the default parameters, which are listed as entry D in the Rpt# column in the SP-LOOK report. For example, if report 0 is not set up, all reports generated by TCL, English and Proc are assigned the default parameters.
The SP-ASSIGN command can be used to change the default assignment entry and to create or update assignment entries for report numbers 0 to 127.
You can use the SP-LOOK command to view all current assignments.
You can define the default job file for a particular formqueue using command SPM option 1 (or FQM). This replaces the system default SPOOL.JOBS, unless overridden by a job file specified explicitly in the SP-ASSIGN command for a print report (that is, by a job file shown in the applicable assignment table entry).
SP-ASSIGN can be used at any time during a logon session to modify assignment table entries, and thus to change the characteristics applied to print jobs from relevant print reports from then on. At logoff, assignment table entries are cleared.