When you create multiple reports, the variables apply to the current report. Production Reporting reserves a library of predefined variables for general use.
All of Production Reporting's reserved variables are global variables. Reference reserved variables in local procedures with a leading underscore. For example, #_sqlstatus or $_sql-error. See BEGIN-PROCEDURE for information on defining local procedures.
Table 3. Production Reporting Reserved Variables
Current date-time on the local machine when Production Reporting starts running the program. | |||
Current line on the page. This value is the physical line on the page, not the line in the report body. Line numbers are referenced in PRINT and other Production Reporting commands used for positioning data on the page. Optional page headers and footers, defined BEGIN-HEADING and BEGIN-FOOTING, have their own line sequences. Line 2 of the heading is different from line 2 of the report body or footing. | |||
Set to one (1) if end of file occurs when reading a flat file; otherwise, set to zero (0). Your program should check this variable after each READ command. (See READ for more information.) | |||
Value returned to the operating system when Production Reporting exits. Can be set in your report. #return-status is initialized to the “success” return value for the operating system. | |||
Count of rows affected by a DML statement (INSERT, UPDATE, or DELETE). This is equivalent to ROWCOUNT in Oracle and Sybase. | |||
Text message from the database explaining an error. This variable is rewritten when a new error is encountered. | |||
Value of #SQL-STATUS set whenever BEGIN-SELECT executes. Normally this variable is checked from within an ON-ERROR procedure so its value describes the error condition (whereas the $SQL-ERROR variable contains the error message). The actual meaning of #SQL-STATUS is database dependent. Consult the proper database manual to fully interpret its meaning. | |||
Last SQL statement sent to the database by Production Reporting. The variable contents are valid after Production Reporting processes BEGIN-SQL, BEGIN-SELECT, or LOAD‑LOOKUP , or within the ON‑ERROR-procedure for BEGIN-SQL and BEGIN-SELECT. The variable is populated for ODBC, Sybase, Oracle, Informix, Teradata, DB2, and DDO. | |||
$sqr‑connected‑db {sqr‑connected‑db} | Class of the backend database from the initial connection or from CONNECT. For ODBC, the class is: ODBC, Sybase, Oracle, Informix, Redbrick, Teradata, or DB2. For DDO, the class is: XML, CSV, SAP, MSOLAP, Essbase, SQLServer, Sybase, Oracle, Informix, or DB2. The information is derived from $sqr-connected-db-name / {sqr-connected-db-name}. | ||
$sqr‑connected‑db‑name {sqr‑connected‑db‑name} | Name of the database driver from the initial connection or from CONNECT. For ODBC, the value is derived from the ODBC Driver Manager. For DDO, the value is derived from the driver used. For all other databases, the value is the same as the value in $sqr-database / {sqr-database}. | ||
$sqr‑database {sqr‑database} | Database type for which Production Reporting was compiled. Valid values are: DB2, ODBC, Sybase, Informix, and Oracle. | ||
$sqr‑dbcs {sqr‑dbcs} | Defines whether Production Reporting recognizes double-byte character strings. The value can be either YES or NO. | ||
$sqr‑encoding {sqr‑encoding} | Name of the default encoding as defined by the ENCODING environment variable when Production Reporting is invoked. | ||
$sqr‑encoding‑console {sqr‑encoding‑console} | Name of encoding for character data written to the log file or console. | ||
$sqr‑encoding‑database {sqr‑encoding‑database} | Character data retrieved from and inserted into the database. | ||
$sqr‑encoding‑file‑input {sqr‑encoding-file-input} | Name of encoding for character data read from files used with OPEN. | ||
$sqr‑encoding‑file‑output {sqr‑encoding‑file‑output} | Name of encoding for character data written to files used with OPEN. | ||
$sqr-encoding‑report‑output {sqr‑encoding‑report‑output} | Report generated by Production Reporting (for example, an LIS file or a PostScript file). | ||
$sqr‑encoding‑source {sqr‑encoding‑source} | Name of encoding for Production Reporting source files and include files. | ||
$sqr‑hostname {sqr‑hostname} | Name of the computer on which Production Reporting is currently executing. | ||
$sqr‑locale | Name of the current locale. A + at the end of the name indicates an argument used in the locale has changed. | ||
#sqr‑max‑columns | Maximum number of columns as determined by the layout. When a new report is selected, this variable is automatically updated to reflect the new layout. | ||
#sqr‑max‑lines | Maximum number of lines as determined by the layout. When a new report is selected, this variable is automatically updated to reflect the new layout. | ||
#sqr‑pid | Process ID of the current Production Reporting process. #sqr‑pid is unique for each run of Production Reporting. This variable is useful in creating unique temporary names. | ||
$sqr‑platform {sqr‑platform} | Hardware/operating system type for which Production Reporting was compiled. Valid values are WINDOWS and UNIX. | ||
Name of the Production Reporting program file. | |||
Name of the report output file. $sqr-report reflects the actual name of the file to be used (as specified by the -F flag or the NEW-REPORT command). | |||
Text string shown with the -ID flag. Production Reporting version. | |||