SQR Programmer Reference Card
SQR language version 2.x & 3.x.© 1998, Ray Ontko & Co.
Don Mellen, Editor. Please direct comments, suggestions, and corrections to donm@ontko.com.
This document may be freely copied and distributed provided it is not modified in any way and it retains the original copyright notice.
Latest version of our on-line card.
TABLE OF CONTENTS
- Conventions Used In This Document
- SQR Command Line
- SQRT Command Line
- SQRP Command Line
- Special Characters
- Pre-Defined Variables
- Position Syntax
- Array Dot Syntax
- Data Types
- Command Reference
- Expressions
- Print Format Commands
- Compiler Directives
- Tables
CONVENTIONS USED IN THIS DOCUMENT
[] Optional parameters. {} Required parameters. | Separates a list of "either/or" options. () Notes or additional comments. (Item)+x.x Denotes items that were added in version "x.x". (Item)* Denotes items that are becoming obsolete (but still backward compatible). (Item)-x.x Denotes items that were removed in version "x.x". Items can be commands (in which case the version information applies to the entire command), or command options (in which case the version information applies only to that option within that command).
All information comes from a base of version 2.0, i.e. Any command or command option without version designation has existed since 2.0.
When listing the acceptable values for parameters with pre-defined values, the default value is listed first.
SQR COMMAND LINE
SQR [Report] [Connectivity] [Flags...] [Args...] [@File]
-Flags.. -A Causes the report output to be appended to an existing file of the same name. -Bn Indicates how many rows to buffer during each retrieve of data from the database. (Oracle) (SYBASE CT-Lib)+3.0 -C+3.0 Makes the Cancel dialog box appear during program execution. (Windows) -CB+3.0 Forces the communication box to be used. (Windows, Callable SQR) -Dn Causes output to be displayed to the terminal as well as written to a file. Pauses after n lines. (non-Windows) -DB{database} Causes the program to use database. Overrides embedded SQR "USE" command. (SYBASE) -DEBUG[x] Causes 'DEBUG' to be defined. "#DEBUG" or "#ifdef DEBUG" lines will be compiled. The x allows multiple debugs. DEBUGAB defines DEBUG, DEBUGA, and DEBUGB. -E[file] Causes error messages to be recorded in the named or default file. -F{file} Will override the default output file name (Report).LIS and use the named file. (Path can also be specified. If only a path is specified, the default-named report will be placed there. The "new-report" command ignores all -F settings.)+2.26 (Multiple -F flags will apply to each of multiple reports in the order that they are "declare-report"ed.)+3.0 -G{file_mode}+3.0 Enables specification of report output file mode. (VM) -G{file_attr}+2.26 Enables specification of report output file attributes. (VMS) (OpenVMS)+3.0 -I{dir_list}+3.0 Specifies the #INCLUDE files search paths. Comma or semi-colon separated. -ID+3.0 Displays the copyright banner on the console. (non-Windows) -KEEP+3.0 Creates an .SPF file for each report in addition to .LIS files. -LL{S | D}{C | I}+3.0 Load-Lookup: S=SQR,D=DB , C=case sensitive,I=case insensitive. -LOCK{xx}+3.0 Defines the types of locking (isolation level) for the session. (SQLBase) -M{file} Points to a startup file containing program limits that override the defaults. -N{database}* Uses the named database, rather than the default database. (Rdb) -NOLIS+3.0 Creates an .SPF file for each report instead of .LIS files. -NR+3.0 Uses the No Recovery mode when connecting to the database. (SQLBase) -O[file]+3.0 Directs log messages to file. Defaults to report.log or to sqr.log in the current directory. (Windows) -P+3.0 Directs output to the printer device. (VM) -PB+3.0 Causes column data to retain trailing blanks. (Rdb*, Informix) -P{id[/pass]}+3.0 The role identifier used to associate permissions with SQR. (Ingres) -PRINTER:{xx}+3.0 Causes Printer type xx to be used when creating .LIS files. Valid values are LP, HP, PS, and WP (Windows only). WP output is sent to the printer without saving an output file. -RS Scans, syntax checks, and saves report and "ASK" responses in a 'run time' file called (Report).SQT. -RT Immediately processes the 'run time' file and "ASK" responses saved with the -RS flag. -S Causes the status of all cursors to be displayed at the end of the report run. -SORT{n}+3.0 Specifies the size of the sort buffer in characters. (SQLBase) -T{n} For testing - causes 'order by' clauses to be ignored to save time during testing. Tests for n pages. -U{username}+3.0 Specifies the user name, overriding the connectivity string. (Ingres) -V{server} Uses the named server. (Sybase and SQL Server) -V6+3.0, * Specifies V6 compatibility mode. (Oracle) -XB+3.0 Suppresses the SQR banner and the "SQR...End of Run" message. (non-Windows) -XC+2.20 Suppresses final commit. (callable SQR) -XCB+3.0 Do not use the communications box. (Windows) -XL prevents SQR from logging on to the database. -XMB+3.0.13 Prevents program interruption by error message boxes. Errors will only be sent to an .err file. See also: -E. (Windows & NT) -XP+3.0 prevents SQR from creating temporary stored procedures. (SYBASE DB-Lib)* (SYBASE CT-Lib)+3.0.13 -XTB+3.0 Preserves the trailing blanks in a .LIS file. -ZMF{file}+3.0 Specifies the full path & name of the SQR Error Message file, sqrerr.dat.
- Args...
- Arguments are used by the SQR ASK and INPUT commands while report runs.
- @File
- Files contain report arguments, one argument per line.
SQRT COMMAND LINE+3.0
SQRT [Report] [Connectivity] [Flags...] [Args...] [@File]
-Flags.. -A Causes the report output to be appended to an existing file of the same name. -Bn Indicates how many rows to buffer during each retrieve of data from the database. (Oracle) (SYBASE CT-Lib) -C Makes the Cancel dialog box appear during program execution. (Windows) -CB Forces the communication box to be used. (Windows, Callable SQR) -Dn Causes output to be displayed to the terminal as well as written to a file. Pauses after n lines. (non-Windows) -DB{database} Causes the program to use database. Overrides embedded SQR "USE" command. (SYBASE) -E[file] Causes error messages to be recorded in the named or default file. -F{file} Will override the default output file name (Report).LIS and use the named file. (Path can also be specified. If only a path is specified, the default-named report will be placed there. The "new-report" command ignores all -F settings.) (Multiple -F flags will apply to each of multiple reports in the order that they are "declare-report"ed.) -G{file_mode} Enables specification of report output file mode. (VM) -G{file_attr} Enables specification of report output file attributes. (VMS) (OpenVMS) -ID Displays the copyright banner on the console. (non-Windows) -KEEP Creates an .SPF file for each report in addition to .LIS files. -LOCK{xx} Defines the types of locking (isolation level) for the session. (SQLBase) -NOLIS Creates an .SPF file for each report instead of .LIS files. -NR Uses the No Recovery mode when connecting to the database. (SQLBase) -O[file] Directs log messages to file. Defaults to report.log or to sqr.log in the current directory. (Windows) -P Directs output to the printer device. (VM) -PB Causes column data to retain trailing blanks. (Rdb*, Informix) -P{id[/pass]} The role identifier used to associate permissions with SQR. (Ingres) -PRINTER:{xx} Causes Printer type xx to be used when creating .LIS files. Valid values are LP, HP, PS, and WP (Windows only). WP output is sent to the printer without saving an output file. -S Causes the status of all cursors to be displayed at the end of the report run. -SORT{n} Specifies the size of the sort buffer in characters. (SQLBase) -Tn For testing - causes 'order by' clauses to be ignored to save time during testing. Tests for n pages. -U{username} Specifies the user name, overriding the connectivity string. (Ingres) -V{server} Uses the named server. (Sybase and SQL Server) -V6* Specifies V6 compatibility mode. (Oracle) -XB Suppresses the SQR banner and the "SQR...End of Run" message. (non-Windows) -XC Suppresses final commit. (callable SQR) -XCB Do not use the communications box. (Windows) -XL prevents SQR from logging on to the database. -XMB+3.0.13 Prevents program interruption by error message boxes. Errors will only be sent to an .err file. See also: -E. (Windows & NT) -XP prevents SQR from creating temporary stored procedures. (SYBASE DB-Lib)* (SYBASE CT-Lib)+3.0.13 -XTB Preserves the trailing blanks in a .LIS file. -ZMF{file} Specifies the full path & name of the SQR Error Message file, sqrerr.dat.
- Args...
- Arguments are used by the SQR ASK and INPUT commands while report runs.
- @File
- Files contain report arguments, one argument per line.
SQRP COMMAND LINE+3.0
SQRP [spf-File] [Flags...]
-Flags.. -A Causes the report output to be appended to an existing file of the same name. -Dn Causes output to be displayed to the terminal as well as written to a file. Pauses after n lines. (non-Windows) -E[file] Causes error messages to be recorded in the named or default file. -F{file} Will override the default output file name (Report).LIS and use the named file. (Path can also be specified. If only a path is specified, the default-named report will be placed there. The "new-report" command ignores all -F settings.) (Multiple -F flags will apply to each of multiple reports in the order that they are "declare-report"ed.) -G{file_mode} Enables specification of report output file mode. (VM) -G{file_attr} Enables specification of report output file attributes. (VMS) (OpenVMS) -ID Displays the copyright banner on the console. (non-Windows) -O[file] Directs log messages to file. Defaults to report.log or to sqr.log in the current directory. (Windows) -P Directs output to the printer device. (VM) -PRINTER:{xx} Causes Printer type xx to be used when creating .LIS files. Valid values are LP, HP, PS, and WP (Windows only). WP output is sent to the printer without saving an output file. -XB Suppresses the SQR banner and the "SQR...End of Run" message. (non-Windows) -XTB Preserves the trailing blanks in a .LIS file. -ZMF{file} Specifies the full path & name of the SQR Error Message file, sqrerr.dat.
SPECIAL CHARACTERS
(denoting data type)
& Begins a "bind" variable for a database column or expression, regardless of type. $ Begins a text variable. # Begins a numeric variable. (Floating point). @ Begins a marker location variable, used for identifying position fields inside BEGIN-DOCUMENT paragraphs. ' (Single Quote). Surrounds a text literal. For example, 'Ray Ontko & Co.'.
Double to include a quote inside a literal. For example, '''Yes!!'', he said.'. NOTE: The exclamation mark must also be doubled or the rest of the line will be considered a comment.{} Encloses a substitution variable. [] Encloses a dynamic SQL variable, dynamic query variable, or dynamic table name. Or a dynamic column name+3.0 Variable names may be of any length and are case insensitive. Variable names are known globally throughout a report, except if used in a local procedure, in which case they are local. To reference a global variable from within a local procedure, put an underscore between the special character and the variable name.
PRE-DEFINED VARIABLES
#current-column The current column on the page. #current-line Refers to the physical line number on the page. #end-file Set to one (1) if end of file occurs on READ, otherwise zero (0). #page-count The current page number. #return-status Value to be returned to the operating system when SQR exits. #sql-count The count of rows affected by a DML statement (insert, update and delete). $sql-error The text message from the database explaining the most recent error. #sql-status The status value from the database after each query is compiled or executed. $sqr-database +3.0 The database type for which SQR Workbench was compiled. Valid values are: Allbase* DB2 Informix Ingres Oracle RDB* SQLBase SYBASE {sqr-database} +3.0 see $sqr-database above #sqr-pid +3.0 The process ID of the current SQR process. Unique for each run of SQR. $sqr-platform +3.0 The hardware/operating system type for which SQR was compiled. Valid values are: DOS* MVS WINDOWS UNIX VM VMS {sqr-platform} +3.0 see $sqr-platform above $sqr-program +3.0 The name of the SQR program file. $sqr-report +3.0 The name of the report output file. Reflects the actual name to be used (-F flag or NEW-REPORT command). $sqr-ver +3.0 The text string shown with the -ID flag. $username The database username specified on the command line.
POSITION SYNTAX
(a,b,c) where
Line position and column position values may be fixed, or relative.
- a = line position
- b = column position
- c = length
Examples:
print &name (10,15,30)Will be printed on line 10, column 15.
print &address (+1,15,30)Will be printed directly below the name.
ARRAY DOT SYNTAX
Array elements can be referenced and altered within an expression (in a LET, IF, or WHILE command) by using the special "dot" syntax in the form:
array.field(element[,occurs])
Examples:
if states.name(1) = 'Alabama' let states.abbrev(1) = 'AL' let $State_Bird = states.things(2,1) let $State_Flower = states.things(2,2) let chosen.bird(#curr) = states.things(2,1) end-if
DATA TYPES
The "let", "move", "get" and "put" commands will auto-convert between data types. They will auto-convert string <-> numeric.
- NUMERIC
- Double precision floating point numeric. Range and precision of these are machine dependent.
- CHAR
- String. Length is limited by the memory of your computer.
COMMAND REFERENCE
NOTES: In some cases, the only significant portion of a numeric is its truncated integer value. An "i" is used to designate these cases. "Round" parameter ranges can be from 0 to 6.
KEY: Text Numeric $t Variable #n Variable &t Column &n Column £t Literal £n Literal ~t Variable or Literal ~n Variable or Literal t Var, Lit, or Col n Var, Lit, or Col v Any Variable value Any Var, Lit, or Col
- ADD n TO #n [ROUND= £i]
- ALTER-PRINTER +3.0
- [POINT-SIZE= n_points]
- [FONT-TYPE= {PROPORTIONAL | FIXED | t_font-type_txt}]
- [SYMBOL-SET= t_HP_defined_symbol_set]
- [FONT= i_font]
- [PITCH= n_pitch]
- ARRAY-ADD n... TO array_name(i_element) [field[(i_occurs)]...]
- ARRAY-DIVIDE n... INTO array_name(i_element) [field[(i_occurs)]...]
- ARRAY-MULTIPLY n... TIMES array_name(i_element) [field[(i_occurs)]...]
- ARRAY-SUBTRACT n... FROM array_name(i_element) [field[(i_occurs)]...]
- ASK substitution_variable [£t_prompt]
- BEGIN-DOCUMENT position
- BEGIN-FOOTING £i_footing_lines [FOR-REPORTS=(report_name1,...report_nameN)]+3.0
- BEGIN-HEADING £i_heading_lines [FOR-REPORTS=(report_name1,...report_nameN)]+3.0
- BEGIN-PROCEDURE procedure_name [LOCAL | (arg1,arg2,...argN)]
- BEGIN-PROGRAM +3.0
- BEGIN-REPORT * (alternative: Begin-Program)
- BEGIN-SELECT
- [DISTINCT]
- [-C£n_buffer_size] (Ingres,Oracle,SQLBase)
- [-C£n_connection]+3.0, * (SYBASE DB-Lib)
- [-B£n] (Oracle,SYBASE CT-Lib)
- [-XP]+3.0 (SYBASE)
- [-NR]+3.0 (SQLBase)
- [-SORT£n]+3.0 (SQLBase)
- [-LOCK{RR | CS | RO | RL | XX}]+3.0 (SQLBase)
- [-DBdatabase_name]+3.0 (SQLBase)
- [LOOPS= £n]
- [ON-ERROR=procedure [(arg1,arg2,...argN)]+3.0 ]
- BEGIN-SETUP
- (The following are used exclusively in the SETUP section, ASK, DECLARE-CHART, DECLARE-IMAGE, DECLARE-LAYOUT, DECLARE-PRINTER, DECLARE-PROCEDURE, DECLARE-REPORT, NO-FORMFEED, PAGE-SIZE, PRINTER-DEINIT, PRINTER-INIT, USE)
- BEGIN-SQL
- [-C£n_buffer_size] (Ingres,Oracle,SQLBase)
- [-C£n_connection]+3.0, * (SYBASE DB-Lib)
- [-XP]+3.0 (SYBASE)
- [-NR]+3.0 (SQLBase)
- [-SORT£n]+3.0 (SQLBase)
- [-LOCK{RR | CS | RO | RL | XX}]+3.0 (SQLBase)
- [-DBdatabase_name]+3.0 (SQLBase)
- (in setup) [ ON-ERROR=[STOP | WARN | SKIP] ]
- (non-setup) [ ON-ERROR=procedure [(arg1,arg2,...argN)]+3.0 ]
- BREAK
- CALL subroutine USING value {$t | #n} [param]
- CALL SYSTEM USING t_command #n_status [NOWAIT | WAIT]+3.0.13 Windows NT
- CLEAR-ARRAY +3.0 NAME=array_name
- CLOSE {~i_file_num}
- COLUMNS +3.0 i...
- COMMIT
- (used with ORACLE, SQLBase, RDB , Ingress)
- CONCAT value WITH $t [{:$t_edit_mask | £t_edit_mask}]
- CONNECT t [ON-ERROR=procedure [(arg1,arg2,...argN)]+3.0 ]
- CREATE-ARRAY NAME=array_name SIZE= £i_elements
- {FIELD=
- name:{CHAR | NUMBER}[:i_occurs][={£t|£n}]+3.0}
- [FIELD...]
- DATE-TIME * position [date_format [&t]]
- DECLARE-CHART +3.0 chart_name
- [CHART-SIZE= (£i_width, £i_depth) ]
- [TITLE= {NONE | £t}]
- [SUB-TITLE= {NONE | £t}]
- [FILL= {GRAYSCALE | COLOR | CROSSHATCH | NONE}]
- [3D-EFFECTS= {NO | YES}]
- [BORDER= {YES | NO}]
- [POINT-MARKERS= {YES | NO}]
- [TYPE=
- {BAR | LINE | PIE | STACKED-BAR | 100%-BAR | OVERLAPPED-BAR | FLOATING-BAR | HISTOGRAM | AREA | STACKED-AREA | 100%-AREA | XY-SCATTER-PLOT | HIGH-LOW-CLOSE}]
- [LEGEND= {YES | NO}]
- [LEGEND-TITLE= {NONE | £t}]
- [LEGEND-PLACEMENT=
- {CENTER-RIGHT | CENTER-LEFT | UPPER-RIGHT | UPPER-LEFT | UPPER-CENTER | LOWER-RIGHT | LOWER-LEFT | LOWER-CENTER}]
- [LEGEND-PRESENTATION= {OUTSIDE | INSIDE}]
- [PIE-SEGMENT-QUANTITY-DISPLAY= {YES | NO}]
- [PIE-SEGMENT-PERCENT-DISPLAY= {YES | NO}]
- [PIE-SEGMENT-EXPLODE=
- {NONE | MAX | MIN | USE-3RD-DATA-COLUMN}]
- [{X | Y}-AXIS-LABEL= {NONE | £t}]
- [{X | Y}-AXIS-MIN-VALUE= {AUTOSCALE | £n}]
- [{X | Y}-AXIS-MAX-VALUE= {AUTOSCALE | £n}]
- [{X | Y}-AXIS-SCALE= {LINEAR | LOG}]
- [{X | Y}-AXIS-MAJOR-TICK-MARKS= {YES | NO}]
- [{X | Y}-AXIS-MINOR-TICK-MARKS= {NO | YES}]
- [{X | Y}-AXIS-MAJOR-INCREMENT= {AUTOSCALE | £n}]
- [{X | Y}-AXIS-MINOR-INCREMENT= £n]
- [{X | Y}-AXIS-TICK-MARK-PLACEMENT=
- {OUTSIDE | INSIDE | BOTH}]
- [{X | Y}-AXIS-GRID= {YES | NO}]
- END-DECLARE
- DECLARE-IMAGE +3.0 image_name
- [TYPE= {EPS-FILE | HPGL-FILE | BMP-FILE }]
- [IMAGE-SIZE= (£i_width, £i_height)]
- [SOURCE= £t_file_name]
- END-DECLARE
- DECLARE-LAYOUT +3.0 layout_name
- [PAPER-SIZE= (£n_width_in, £n_height_in)]
- [FORMFEED= {YES | NO}]
- [ORIENTATION= {PORTRAIT | LANDSCAPE}]
- [LEFT-MARGIN= £n_in]
- [TOP-MARGIN= £n_in]
- [{RIGHT-MARGIN= £n_in |
- LINE-WIDTH= £n_in |
- MAX-COLUMNS= £n_columns_integer}]
- [{BOTTOM-MARGIN= £n_in |
- PAGE-DEPTH= £n_in |
- MAX-LINES= £n_lines_integer}]
- [CHAR-WIDTH= £n_pt]
- [LINE-HEIGHT= £n_pt]
- END-DECLARE
- DECLARE PRINTER +2.20, * (alternative: Declare-Printer & Declare-Layout)
- [TYPE= {LINEPRINTER | POSTSCRIPT | HPLASERJET}]
- [ORIENTATION= {PORTRAIT | LANDSCAPE}]
- [LEFT-MARGIN= £n_inches]
- [TOP-MARGIN= £n_inches]
- [LINE-SIZE= £n_points]
- [CHAR-SIZE= £n_points]
- [LINES-INCH= £i_lines]
- [CHARS-INCH= £n_characters]
- [POINT-SIZE= £n_points]
- [FONT= £i_font_number]
- [FONT-STYLE= {PROPORTIONAL | FIXED}-3.0]
- [FONT-TYPE= {PROPORTIONAL | FIXED}+3.0]
- [SYMBOL-SET= £t_from_HP_defined_sets]
- [STARTUP-FILE= £t_file_name]
- [BEFORE-BOLD= £t_any_string]
- [AFTER-BOLD= £t_any-string]
- DECLARE-PRINTER +3.0 printer_name
- [FOR-REPORTS= (report_name1,...report_nameN)]
- [TYPE=
- {LINEPRINTER | POSTSCRIPT | HPLASERJET | LP | PS | HP}]
- [INIT-STRING= £t_any_string]
- [RESET-STRING= £t_any_string]
- [COLOR= {NO | YES}]
- [POINT-SIZE= £n_points]
- [FONT-TYPE= {PROPORTIONAL | FIXED}]
- [SYMBOL-SET= £t_from_HP_defined_sets]
- [STARTUP-FILE= £t_file_name]
- [PITCH= £n_chars_per_inch]
- [FONT= £i_font_number]
- [BEFORE-BOLD= £t_any_string]
- [AFTER-BOLD= £t_any-string]
- END-DECLARE
- DECLARE PROCEDURE +2.20, * (alternative: Declare-Procedure)
- [BEFORE-REPORT= procedure_name]
- [AFTER-REPORT= procedure_name]
- [BEFORE-PAGE= procedure_name]
- [AFTER-PAGE= procedure_name]
- DECLARE-PROCEDURE +3.0
- [FOR-REPORTS= (report_name1,...report_nameN)]
- [BEFORE-REPORT= procedure_name[(value_arg1,value_arg2,...value_argN)]]
- [AFTER-REPORT= procedure_name[(value_arg1,value_arg2,...value_argN)]]
- [BEFORE-PAGE= procedure_name[(value_arg1,value_arg2,...value_argN)]]
- [AFTER-PAGE= procedure_name[(value_arg1,value_arg2,...value_argN)]]
- END-DECLARE
- DECLARE-REPORT +3.0 report_name
- [LAYOUT= layout_name]
- [PRINTER-TYPE=
- {LINEPRINTER | POSTSCRIPT | HPLASERJET | LP | PS | HP}]
- END-DECLARE
- DISPLAY
- value [{:$t_edit_mask | £t_edit_mask}] [NOLINE]
- DIVIDE n INTO #n [ON-ERROR={HIGH | ZERO}] [ROUND= £i]
- DO procedure_name [(value_arg1, value_arg2,...value_argN)]
- DOLLAR-SYMBOL +3.0, * new_single_char_dollar_symbol
- ELSE
- ENCODE £t_code_string INTO $t
- END-DECLARE +3.0
- END-DOCUMENT
- END-EVALUATE
- END-FOOTING
- END-HEADING
- END-IF
- END-PROCEDURE
- END-PROGRAM +3.0
- END-REPORT *
- END-SELECT
- END-SETUP
- END-SQL
- END-WHILE
- EVALUATE value
- WHEN {= | != | <> | < | > | <= | >=} value
- [sqr code...]
- [BREAK]
- [WHEN {= | != | <> | < | > | <= | >=} value] ...
- [WHEN-OTHER]
- END-EVALUATE
- EXECUTE +3.0
- INGRES SYNTAX:
- [ON-ERROR=procedure_name]
- [#n_status=]stored_procedure_name
- [(parameter_name=value [;...]) ]
- SYBASE AND MICROSOFT SQLSERVER SYNTAX:
- [-C£n_connection]*
- [ON-ERROR=procedure_name]
- [DO=procedure_name[(value_arg1,value_arg2,...value_argN)]]
- [@#n_status=]stored_procedure_name
- [[@parameter_name=]value [OUT[PUT]] [,...]
- [INTO any_column data_type [(£n_length)] [,...]
- [WITH RECOMPILE]
- EXIT-SELECT
- EXTRACT $t FROM t ~i_start_location ~i_length
- FIND t IN t ~i_start_loc #n_found_at_offset
- GET v... FROM array_name(i_element) [field[(i_occurs)]...]
- GOTO label
- GRAPHIC () FONT +2.20, * ~i_font [~i_point_size [1 | 0 [~i_pitch]]] (alternative: Declare-Printer & Alter-Printer)
- GRAPHIC position BOX +2.20 ~i_depth [~i_rulewidth [~i_shading_percent]]
- GRAPHIC position HORZ-LINE +2.20 [~i_rulewidth]
- GRAPHIC position VERT-LINE +2.20 [~i_rulewidth]
- IF logical_expression
- INPUT
- {$t} [MAXLEN= £n] [£t_prompt] [TYPE={CHAR | NUMBER | INTEGER | DATE}] [STATUS= #n_status] [NOPROMPT]
- LAST-PAGE +3.0 position [£t_pre_text [£t_post_text] ]
- LET v = expression
- LOAD-LOOKUP
- In the SETUP section
- {NAME= lookup_table_name}
{TABLE= database_table}
{KEY= key_column_database_expression}
{RETURN_VALUE= return_column_database_expression}
{ROWS= £i_maximum_rows}-3.0
[ROWS= £i_maximum_rows]+3.0
[EXTENT= £i_size_to_grow_by]+3.0
[WHERE= £t_where_clause]
[SORT= {DC | DI | SC | SI}]+3.0
[QUIET]- In the body of the report+3.0
- {NAME= lookup_table_name}
{TABLE= database_table}
{KEY= key_column_database_expression}
{RETURN_VALUE= return_column_database_expression}
[ROWS= i_maximum_rows]
[EXTENT= i_size_to_grow_by]
[WHERE= t_where_clause]
[SORT= {DC | DI | SC | SI}]
[QUIET]- LOOKUP lookup_table_name value $t_return_val
- LOWERCASE $t
- MONEY-SYMBOL +3.0, * new_single_char_money_symbol
- MOVE value TO v [{:$t_edit_mask | £t_edit_mask}]
- MULTIPLY n TIMES #n [ROUND= £i]
- NEW-PAGE [i_erase_from_line]
- NEW-REPORT ~t_report_file_name
- NEXT-COLUMN [AT-END={NEWLINE | NEWPAGE}] [GOTO-TOP= i] [ERASE-PAGE= i]
- NEXT-LISTING [NO-ADVANCE]+2.13 [SKIPLINES= i] [NEED= i]
- NO-FORMFEED * (alternative: Declare-Layout)
- OPEN
- {~t_file_name} AS {~i_file_num} {FOR-READING | FOR-WRITING | FOR-APPEND+3.0} RECORD= £i_length[:{FIXED | FIXED_NOLF+3.0 | VARY}] [STATUS= #n]
- PAGE-NUMBER position [£t_pre-text [£t_post_text] ]
- PAGE-SIZE * £i_page_depth £i_page_width (alternative: Declare-Layout)
- POSITION position [@document_marker [COLUMNS i ...]]
- PRINT value position [format_commands]
- PRINT-BAR-CODE +3.0 position
- {TYPE= {i_bar_code_type_num}}
- {HEIGHT= n_height}
- {TEXT= t_bar_code_text}
- [CAPTION= t_caption]
- [CHECKSUM= {NO | YES}]
- PRINT-CHART +3.0 [chart-name] position
- {DATA-ARRAY= {array_name}}
- {DATA-ARRAY-ROW-COUNT= i_row_count}
- {DATA-ARRAY-COLUMN-COUNT= i_col_count}
- [DATA-ARRAY-COLUMN-LABELS= {NONE | array_name | (~t_label1,~t_label2,...)}]
- [CHART-SIZE= (~i_width, ~i_depth)]
- [TITLE= {NONE | t}]
- [SUB-TITLE= {NONE | t}]
- [FILL= {GRAYSCALE | COLOR | CROSSHATCH | NONE | $t | &t}]
- [3D-EFFECTS= {NO | YES | $t | &t}]
- [BORDER= {YES | NO | $t | &t}]
- [POINT-MARKERS= {YES | NO | $t | &t}]
- [TYPE=
- {BAR | LINE | PIE | STACKED-BAR | 100%-BAR | OVERLAPPED-BAR | FLOATING-BAR | HISTOGRAM | AREA | STACKED-AREA | 100%-AREA | XY-SCATTER-PLOT | HIGH-LOW-CLOSE | $t | &t}]
- [LEGEND= {YES | NO | $t | &t}]
- [LEGEND-TITLE= {NONE | t}]
- [LEGEND-PLACEMENT=
- {CENTER-RIGHT | CENTER-LEFT | UPPER-RIGHT | UPPER-LEFT | UPPER-CENTER | LOWER-RIGHT | LOWER-LEFT | LOWER-CENTER | $t | &t}]
- [LEGEND-PRESENTATION= {OUTSIDE | INSIDE | $t | &t}]
- [PIE-SEGMENT-QUANTITY-DISPLAY= {YES | NO | $t | &t}]
- [PIE-SEGMENT-PERCENT-DISPLAY= {YES | NO | $t | &t}]
- [PIE-SEGMENT-EXPLODE=
- {NONE | MAX | MIN | USE-3RD-DATA-COLUMN | $t | &t}]
- [{X | Y}-AXIS-LABEL= {NONE | t}]
- [{X | Y}-AXIS-MIN-VALUE= {AUTOSCALE | n}]
- [{X | Y}-AXIS-MAX-VALUE= {AUTOSCALE | n}]
- [{X | Y}-AXIS-SCALE= {LINEAR | LOG | $t | &t}]
- [{X | Y}-AXIS-MAJOR-TICK-MARKS= {YES | NO | $t | &t}]
- [{X | Y}-AXIS-MINOR-TICK-MARKS= {NO | YES | $t | &t}]
- [{X | Y}-AXIS-MAJOR-INCREMENT= {AUTOSCALE | n}]
- [{X | Y}-AXIS-MINOR-INCREMENT= n]
- [{X | Y}-AXIS-TICK-MARK-PLACEMENT=
- {OUTSIDE | INSIDE | BOTH | $t | &t}]
- [{X | Y}-AXIS-GRID= {YES | NO | $t | &t}]
- PRINT-DIRECT +2.20
- [NOLF]+3.0
- [PRINTER={LINEPRINTER | POSTSCRIPT | HPLASERJET | LP | PS | HP}]+3.0
- {t} ...
- PRINT-IMAGE +3.0 [image_name] position
- [TYPE= {EPS-FILE | HPGL-FILE | BMP-FILE | $t | &t}]
- [IMAGE-SIZE= (~i_width, ~i_height)]
- [SOURCE= t_file_name]
- PRINTER-DEINIT +2.20, * reset_string (alternative: Declare-Printer)
- PRINTER-INIT * initialization_string (alternative: Declare-Printer)
- PUT value... INTO array_name(i_element) [field[(i_occurs)]...]
- READ {~i_file_num} INTO v:£i_length... [STATUS= #n]+3.0
- ROLLBACK
- (used with ORACLE, SQLBase, RDB , Ingress)
- SHOW
- [cursor_position] [CLEAR-SCREEN | CS | CLEAR-LINE | CL]
- [value] [EDIT {edit_mask}]
- [BOLD] [BLINK] [UNDERLINE] [REVERSE] [NORMAL] [BEEP] [NOLINE] ...
- STOP [QUIET]+2.20
- STRING {t}... BY t_delim_txt INTO $t
- SUBTRACT n FROM #n [ROUND= £i]
- UNSTRING {t} BY t_delim_txt INTO $t...
- UPPERCASE $t
- USE database (SYBASE and SQL Server only)
- USE-COLUMN i_column_number
- USE-PRINTER-TYPE +3.0
- {LINEPRINTER | POSTSCRIPT | HPLASERJET | LP | PS | HP}
- USE-PROCEDURE +3.0
- [FOR-REPORTS= (report_name1,...report_nameN)]
- [BEFORE-REPORT= procedure_name[(value_arg1,value_arg2,...value_argN)]]
- [AFTER-REPORT= procedure_name[(value_arg1,value_arg2,...value_argN)]]
- [BEFORE-PAGE= procedure_name[(value_arg1,value_arg2,...value_argN)]]
- [AFTER-PAGE= procedure_name[(value_arg1,value_arg2,...value_argN)]]
- USE-REPORT +3.0 t_report_name
- WHILE logical_expression
- WRITE {~i_file_num} FROM value[:£i_length]... [STATUS= #n]+3.0
EXPRESSIONS
NOTE: Logical expressions can be numeric. 0 is considered false, and non-zero is considered true.OPERATORS (In descending order of precedence)...
FILE FUNCTIONS+3.0
- ||
- + - {sign prefixes}
- ^
- * / %
- + -
- < > >= <= <> != =
- not
- and
- or xor
NUMERIC FUNCTIONS
- DELETE(t_filename) --> #n_error_code_or_zero
- EXISTS(t_filename) --> #n_error_code_or_zero
- RENAME(t_oldname,t_newname) --> #n_error_code_or_zero
STRING FUNCTIONS
- ABS(n) --> #n_positive
- ACOS(n) --> #n_radians
- ASIN(n) --> #n_radians
- ATAN(n) --> #n_radians
- CEIL(n) --> #i_smallest_greater_than_n
- COS(n_radians) --> #n
- COSH(n_radians) --> #n
- DEG(n_radians) --> #n_degrees
- E10(n_power) --> #n_10_raised_to_power
- EXP(n_power) --> #n_log_base_e_raised_to_power
- FLOOR(n) --> #i_largest_less_than_n
- LOG(n) --> #n_natural_log_of_n
- LOG10(n) --> #n_base10_log_of_n
- MOD(nx, ny) --> #n_remainder_of_x_div_y
- POWER(nx, ny) --> #n_x_raised_to_power_of_y
- RAD(n_degrees) --> #n_radians
- ROUND(nx, ny) --> #n_x_rounded_to_y_decimal_places
- SIGN(n) --> #i_0_pos1_neg1
- SIN(n_radians) --> #n
- SINH(n_radians) --> #n
- SQRT(n) --> #n_square_root_of_n
- TAN(n_radians) --> #n
- TANH(n_radians) --> #n
- TRUNC(nx, ny) --> #n_x_truncated_to_y_decimal_places
- ARRAY+3.0(t_array_name,t_field_name) --> $t_pointer
- ASCII(t_str) --> #i_ascii_val_of_first_char_in_str
- CHR(i_ascii_val) --> $t_char_of ascii_val
- COND(n_logical, value_a, value_b) --> v_if_nlogical_then_valuea_else_valueb
- EDIT(v_source, t_edit_mask) --> $t_source_edited_under_mask
- GETENV+3.0(t_var_name) --> $t_value_of_environent_var_name_or_null
- INSTR(t_source, t_str, i_start_atoffset) --> #i_position_of_str_in_source_or_0
- ISBLANK+3.0(t_source) --> #i_1_if_source_is_null_or_whitespace_else_0
- ISNULL(t_source) --> #i_1_if_source_is_null_else_0
- LENGTH(t_source) --> #i_num_of_chars_in_source
- LOWER(t_source) --> $t_lower_cased_source
- LPAD(t_source, i_len, t_str) --> $t_source_padded_on_left_with_str_to_len
- LTRIM(t_source, t_char_set) -->
- $t_source_with_all_leftmost_char_set_chars_removed
- NVL(value_source, value_alt) --> v_source_unless_null_then_alt
- RANGE(value_source, value_low, value_high) -->
- #i_1_if_source_is_within_low_to_high_(inclusive)_else_0
- RPAD(t_source, i_len, t_str) --> $t_source_padded_on_right_with_str_to_len
- RTRIM(t_source, t_char_set) -->
- $t_source_with_all_rightmost_char_set_chars_removed
- SUBSTR(t_source, i_start_pos, i_len) -->
- $t_len_chars_from_source_starting_at_pos
- TO_CHAR(n_num) --> $t_digits
- TO_NUMBER(t_digits) --> #f_num
- TRANSLATE(t_source, t_orig, t_repl) -->
- $t_source_with_each_orig_char_replaced_with_respective_repl_char
- UPPER(t_source) --> $t_upper_cased_source
PRINT Format Commands
- BOLD +2.20
- BOX +2.20
- CENTER
- CODE +2.20, * (alternative: Code-Printer)
- CODE-PRINTER +3.0 = {LINEPRINTER | POSTSCRIPT | HPLASERJET | LP | PS | HP}
- EDIT edit_mask
- Text Mask Characters =
- X | B | ~ | R[n]
- Numeric Mask Characters =
- 8+3.0 | 9 | 0 | $ | B | E | V+3.0 | . | ,
- Numeric Mask Suffix Characters =
- C+3.0 | MI | PR | PS | PF | NA | NU
- Date Mask Characters+3.0, * (any except Oracle and SQLBase) =
- YY | YYYY | MM | MON | MONTH | DD | HH | MI | SS | PM (SYBASE and SQLBase) | GG (RDB) | NNNNN (DB2) |
- NOTE: the vertical bar character "|" can be used to separate date mask components without being displayed. Dates must be in the proper DATE-TIME format
- FILL
- MATCH {match_text i_line i_column print_text} ...
- NOP
- ON-BREAK
- [PRINT= {ALWAYS | CHANGE | CHANGE/TOP-PAGE | NEVER}]
- [SKIPLINES= i]
- [AFTER= procedure_name]
- [BEFORE= procedure_name]
- [SAVE= $t] [LEVEL= £i] [SET= £i]
- [PROCEDURE= procedure_name (for compatibility)]
- SHADE +2.20
- UNDERLINE +2.20
- WRAP
- i_line_length i_max_lines [KEEP-TOP]+2.13 [STRIP= strip_chars] [ON= break_chars] [R]
COMPILER DIRECTIVES
- #DEBUG[x...]+3.0 SQR_command
- #DEFINE substitution_variable value
- #ELSE
- #END-IF
- #IF substitution_variable {= | != | <> | < | > | <= | >=} {£t | £n}
- #IFDEF substitution_variable
- #IFNDEF substitution_variable
- #INCLUDE file_name
TABLES
Common HP Symbol Sets+2.20
CODE Symbol Set CODE Symbol Set 0U ASCII 17U PC-852 10U PC-8 12U PC-850 8U HP Roman-8 7J DeskTop 19U Windows 3.1 Latin 1 0N ISO 8859/1 Latin 1 9E Windows 3.1 Latin 2 2N ISO 8859/2 Latin 2 5T Windows 3.1 Latin 5 5N ISO 8859/9 Latin 5 10J PS Text 12J MC Text 13J Ventura International 14J Ventura US 1U Legal 6J Microsoft ® Publishing 15U Pi-Font 6M Ventura Math 5M PS Math 8M Math-8 579L Wingdings Font 19M Symbol
Font Numbers+2.20
HP LASERJET FONTS No. Typeface Style No. Typeface Style 0 Line Printer Fixed 17 Optima Proportional 1 Pica Fixed 18 Garamondi Proportional 2 Elite Fixed 19 Cooper Black Proportional 3 Courier Fixed 20 Coronet Bold Proportional 4 Helvetica Proportional 21 Broadway Proportional 5 Times Roman Proportional 22 Bauer Bodini Black Condensed Proportional 6 Letter Gothic Fixed 23 Century Schoolbook Proportional 8 Prestige Fixed 24 University Roman Proportional 11 Presentations Fixed
POSTSCRIPT FONTS No. Typeface Bold No. Typeface Bold 3 Courier Y 32 Times Italic Y 4 Helvetica Y 33 Avante Garde Demi 5 Times Roman Y 34 Avante Garde Book Oblique 6 Avante Garde Book 35 Avante Garde Demi Oblique 8 Palatino Roman Y 36 Palitino Oblique Y 11 Symbol 37 New Century Schoolbook Italic Y 12 Zapf Dingbats 38 Helvetica Narrow Y 17 Zapf Chancery Medium Italic 39 Helvetica Narrow Oblique Y 18 Bookman Light 40 Bookman Demi 23 New Century Schoolbook Roman Y 41 Bookman Light Italic 30 Courier Oblique Y 42 Bookman Demi Italic 31 Helvetica Oblique Y
1Note: Fonts 6, 8, and 800 are in the ADOBE type Manager (ATM) and not included with Windows.
WINDOWS FONTS No. Typeface Style No. Typeface Style 3 Courier New Fixed 11 Symbol 4 Arial Proportional 300 Courier New Bold 5 Times New Roman Proportional 400 Arial Bold 16 AvantGarde Proportional 500 Times New Roman Bold 18 Palatino Proportional 1800 Palatino Bold
Default DATE-TIME Formats
Database Version Format ALL +2.0, -3.0 DD-Mon-YYYY HH:MI PM Allbase +3.0 YYYY-MM-DD HH:MI:SS.NNN DB2 +3.0 YYYY-MM-DD-HH:MI:SS.NNNNNN Informix +3.0 YYYY-MM-DD HH:MI:SS.NNNNNN Ingres +3.0 DD-MON-YYYY HH:MI:SS Oracle +3.0 DD-Mon-YYYY HH:MI PM Rdb +3.0 DD-MON-YYYY HH:MI SQLBase +3.0 DD-Mon-YYYY HH:MI PM SYBASE +3.0 DD-MON-YYYY HH:MI
Input Status
Value Indicates 0 Successful. 1 Bad type (did not match TYPE parameter). 2 Too long (longer than MAXLEN or INTEGER out of range).
Bar Code Types+3.0
Type Description Text
LengthText
Type*Checksum
Recognized1 UPC-A 11,13, or 16 9 2 UPC-E 11,13, or 16 9 3 EAN/JAN-13 12,14, or 17 9 4 EAN/JAN-8 7,9, or 12 9 5 3 of 9 (code 39) 1 to 30 9,X,p Y 6 Extended 3 of 9 1 to 30 9,X,x,p,c Y 7 Interleaved 2 of 5 2 to 30 9 Y 8 Code 128 1 to 30 9,X,x,p,c 9 Codabar 1 to 30 9 Y 10 Zip+4 Postnet 5,9, or 11 9 11 MSI Plessey 1 to 30 9 Y 12 Code 93 1 to 30 9,X,p 13 Extended 93 1 to 30 9,X,x,p 14 UCC-128 19 9 15 HIBC 1 to 30 9 Y
*Text Type Codes 9 Numbers (0-9) X Upper Case Letters (A-Z) x Lower Case Letters (a-z) p Punctuation c Control Characters
-M File Entries
Entry Default Max Size Is The Maximum ... BREAKS+2.26 100 64K-1 4 breaks per EVALUATE or IF command. CURSORS+3.0 6 60 - no. of concurrent database cursors. (SQLBase) DYNAMICARGS+2.26 70 32K-1 12-3.0 no. of dynamic SQL arguments. 14+3.0 EXPRESSIONSPACE+2.26 2048 64K-1 1 byte length for LET temporary string storage. FORWARDREFS+2.26 200 32K-1 8 no. of &column forward references. LONGSPACE+3.0 13515 32K-2 1 buffer size in bytes to transfer text and image data. NUMVARIABLES* 240 32K 8 no. of numeric variables and literals. ONBREAKS 30 64K-1 8 no. of ON-BREAK LEVEL= values per set. POSITIONS 900 64K-1 13-3.0 no. of position parameters. 14+3.0 PROGLINEPARS 9000 64K-1 2 no. of arguments for all program lines. Generally 3 or 4 times the PROGLINES value. PROGLINES 2500 32K-1 8 no. of program lines (SQR commands). QUERIES 60 32K-1 60 no. of BEGIN-SQL and BEGIN-SELECT paragraphs. Database dependent and can vary. QUERYARGS 240 64K-1 6 no. of arguments (bind vars) for all SQL and SELECT statements. Value must be 1 more than number used. SQLSIZE 4000 64K-1 1 length of a SQL statement in characters STRINGSPACE 10000 64K-1 1 size in bytes of string space for program line arguments. SUBVARS+2.26 100 32K-1 8 no. of run-time substitution variables. VARIABLES 750 64K-1 14-3.0 no. of variables, literals, and database columns. 22+3.0 (Informix and Ingress) 20+3.0 (RDB) 18+3.0 (Others) WHENS+2.26 70 64K-1 4 no. of WHEN arguments per EVALUATE command.
Hardcoded Limits
Number Of... Limit Arrays (maximum) 20 Array fields per array (maximum) 20 Bytes for INPUT buffer 511 Characters for SQR line (maximum) 255 Concurrent open cursors (maximum) 30 Document markers (maximum) 120 Document paragraphs (maximum) 20 Dynamic SQL arguments (maximum)-2.26 70 Forward references (maximum)-2.26 200 OPEN files (maximum) 12 Substitution variables (maximum)-2.26 100
Copyright © 1999, Ray Ontko & Co. | Last updated: Tuesday, February 27, 2007 |