SQR Command Line

SQR for PeopleSoft comprises SQR, SQR Execute, and SQR Print. Each has a command-line interface.

To begin running SQR, enter the following command:

SQR [program][connectivity][flags...][args...][@file...]

Note: The executable name for SQR is SQR (SQRW for Microsoft Windows). The executable name for SQR Execute is SQRT (SQRWT for Microsoft Windows). The executable name for SQR Print is SQRP (SQRWP for Microsoft Windows).

See Running SQR ExecuteUnderstanding SQR Print.

The following table describes the SQR command-line arguments:

Argument

Description

program

Name of the text file containing the source code. The default file type or extension is .sqr. If you enter this value as a question mark (?) or omit it, SQR for PeopleSoft prompts you for the report program name. On UNIX/Linux-based systems, if your shell uses the question mark as a wildcard character, you must precede it with a backslash (\).

connectivity

Information that SQR for PeopleSoft needs to connect to the database. If you enter this value as a question mark (?) or omit it, SQR for PeopleSoft prompts you for the information.

IBM DB2: Subsystem name and Structured Query Language (SQL) authorization ID.

Ssname/SQLid

Microsoft Windows or IBM DB2: The name of the database, your username, and the password for the database.

[Database] / [Username] / [Password]

Open Database Connectivity (ODBC): The name that you give to the ODBC driver when you set up the driver, and your username and password for the database. This port has been certified against IBM DB2 and Microsoft SQL Server.

Data_Source_Name/[Username]/[Password] 

Oracle: Your username and password for the database, and an optional connection string for the database (for example, @sales.2cme.com).

[Username]/[Password[@Database]] 

flags

See SQR Command-Line Flags.

args...

Arguments that SQR for PeopleSoft uses while the program is running. The ASK and INPUT commands use these arguments rather than prompting the user. You must enter arguments on the command line in the sequence that the program expects—first all ASK arguments, in order, followed by INPUT arguments.

@file...

File containing program arguments—one argument per line. Arguments that are listed in the file are processed one at a time: first all ASK arguments, in order, followed by INPUT arguments. You can specify the command-line arguments (program, connectivity, and args) in this file for non-Microsoft Windows platforms.

SQR supports a number of command-line flags. Each flag begins with a hyphen (-). When a flag takes an argument, the argument must follow the flag with no intervening space.

The following table describes the SQR command-line flags:

Flag

Description

-A

Appends the output to an existing output file carrying the same name as the source of the output. If the file does not exist, a new one is created. This flag is useful when you want to run the same report more than once but want only a single output file.

-Bnn

(Oracle and ODBC)Indicates the number of rows to buffer each time SQR for PeopleSoft retrieves data from the database. The default is 10 rows. Regardless of the setting, all rows are retrieved. When used on the command line, -B controls the setting for all BEGIN-SELECT commands. Inside a program, each BEGIN-SELECT command can also have its own -B flag for further optimization.

-BURST:{xx}

-BURST:T generates the table of contents file only.

-BURST:S generates the report output according to the symbolic table of contents entries that are set in the program with the level argument of the TOC-ENTRY command. In -BURST:S[ {l} ], {l} is the level on which to burst. The -BURST:S setting is equivalent to -BURST:S1.

See Bursting Reports.

Note: -BURST:P and -BURST:S require -PRINTER:EH or -PRINTER:HT.

The page range selection feature of -BURST:P requires -PRINTER:HT.

-BURST:T requires -PRINTER:HT.

-C

(Microsoft Windows) Specifies that the Cancel dialog box appears while the program runs so that you can easily stop the program.

-CB

(Microsoft Windows, Callable SQR) Forces the communication box to use.

-Dnn

(Non-Microsoft Windows) Displays the report output on the terminal while it is being written to the output file. The value for nn is the maximum number of lines to display before pausing. If no number is entered after -D, the display scrolls continuously.

Note: The printer type must be LP; otherwise, the display is ignored. If the program is producing more than one report, the display is for the first report only.

-DEBUG [xxx]

See #DEBUG.

-DNT: {xx}

See DECLARE-VARIABLE.

-E[file]

Directs error messages to the named file or to the default file program.err. If no errors occur, no file is created.

-EH_APPLETS:dir

Specifies the directory location of the enhanced HTML applets. If you include an applet, SQR for PeopleSoft must know where it resides. SQR for PeopleSoft usually checks for the applet in a default directory; the default directory for these applets is IMAGES.

Note: This flag is applicable only when you specify the -PRINTER:EH or -PRINTER:EP flag.

-EH_BQD

Generates a {report}.bqd file from the report data. This flag also associates a query format file (BQD) icon with {report}.bqd in the navigation bar.

Note: This flag is applicable only when you specify the -PRINTER:EH or -PRINTER:EP flag.

-EH_BQD:file

Associates the BQD icon with the specified file.

Note: This flag is applicable only when you specify the -PRINTER:EH or -PRINTER:EP flag.

-EH_BROWSER:xx

Generates HTML, determines the browser, and displays HTML.

When this flag is set to ALL, SQR for PeopleSoft generates frame.html, which contains JavaScript to determine the browser on the user’s machine (that is, the person reading the report, not the person writing it).

When this flag is set to BASIC, SQR for PeopleSoft generates HTML that is suitable for all browsers.

When this flag is set to IE, SQR for PeopleSoft generates HTML that is designed for Microsoft Internet Explorer.

Note: This flag is applicable only when you specify the -PRINTER:EH or -PRINTER:EP flag.

-EH_CSV

Generates a {report}.csv file from the report data.

Note: This flag is applicable only when you specify the -PRINTER:EH or -PRINTER:EP flag.

-EH_CSV:file

Associates the CSV icon with the specified file.

Note: This flag is applicable only when you specify the -PRINTER:EH or -PRINTER:EP flag.

-EH_CSVONLY

Creates a .csv file, but does not create an HTML file.

Note: This flag is applicable only when you specify the -PRINTER:EH or -PRINTER:EP flag.

-EH_FULLHTML:xx

Specifies the level of the generated enhanced HTML code. This can be 30, 32, or 40.

Note: For upward compatibility, a value of TRUE is equivalent to 40 and FALSE is 30.

-EH_Icons:dir

Specifies the directory in which the HTML should find the referenced icons.

Note: This flag is applicable only when you specify the -PRINTER:EH or -PRINTER:EP flag.

-EH_IMAGES:dir

Specifies the directory path for the .gif files that are used by the navigation bar.

Note: This flag is applicable only when you specify the -PRINTER:EH or -PRINTER:EP flag.

-EH_KEEP

Copies (does not move) the files when used in conjunction with -EH_ZIP.

Note: This flag is applicable only when you specify the -PRINTER:EH or -PRINTER:EP flag.

-EH_LANGUAGE:xx

Sets the language that is used for the HTML navigation bar. You can specify English, French, German, Portuguese, Spanish, Japanese, Simplified Chinese, or Korean.

Note: This flag is applicable only when you specify the -PRINTER:EH or -PRINTER:EP flag.

-EH_PDF

Associates a PDF icon with {report}.pdf in the navigation bar.

Note: This flag is applicable only when you specify the -PRINTER:EH or -PRINTER:EP flag.

-EH_Scale:{nn}

Sets the scaling factor to a value from 50 to 200.

Note: This flag is applicable only when you specify the -PRINTER:EH or -PRINTER:EP flag.

-EH_XML:file

Associates the XML icon with the specified file.

Note: This flag is applicable only when you specify the -PRINTER:EH or -PRINTER:EP flag.

-EH_ZIP[:file]

Moves the generated files to the specified file or {report}.zip if {file} is not specified.

Note: This flag is applicable only when you specify the -PRINTER:EH or the -PRINTER:EP flag.

-F[file | directory]

Overrides the default output file name, program.lis. The default action places the program.lis file in the same directory as the program.sqr file. To use the current directory, specify -F without an argument. To change the name of the output file, specify -F with the new name. If the new name does not specify a directory, the file is created in the current directory. The output file is not created until data is actually printed on the page. If no data is printed, no output file is created.

Specify these file names and directories for different operating systems:

UNIX/Linux

Directory character is /

-F$HOME/reports/

IBM MVS

Directory character is (

-FDSN:SQR.REPORTS(

-GPRINT=YES | NO

(IBM MVS) -GPRINT=YES includes control characters in the first column of each record of the SQR report output file. -GPRINT=NO omits the control characters.

-Idir_list

Specifies the list of directories that SQR for PeopleSoft searches when processing the #INCLUDE directive when the include file does not exist in the current directory and no path is specified for the file. The directory names must be separated by commas (,) or semicolons (;).

For UNIX/Linux-based systems, if your shell uses semicolons as command delimiters, you must precede each semicolon with a backslash (\). Always append the directory character to the end of each directory name. See the -F flag for a list of directory characters, sorted by operating system.

-ID

(Non-Microsoft Windows) Displays the copyright banner on the console.

-KEEP

See Specifying Output File Types by Using SQR Command-Line Flags.

-LL{s | d}{c | i}

Specifies the following LOAD-LOOKUP values:

  • s: SQR

  • d: DB

  • c: Case sensitive

  • i: Case insensitive

See LOAD-LOOKUP.

-Mfile

Defines a startup file containing sizes to assign to internal parameters—extremely small, large, or complex reports. Mfiles are text files that have individual switches in the INI files that are unique to a run.

-NOLIS

Prevents the creation of .lis files, creating .spfs instead.

-O[file]

Directs log messages to the specified file or to program.log if no file is specified. By default, the sqr.log file is created in the current working directory.

-olim

Displays the SQR resources that are used by the SQR report.

  • Limit is the programmatic limit, the maximum amount of memory that can be allocated to the variable.

  • Defined is the value defined in the pspssqr.ini file; this is a user-defined value.

  • Actual is the actual amount of memory/space used by the variable at runtime.

-P

(IBM MVS) Suppresses printer control characters from column 1.

-PRINTER:xx

Uses printer type xx when creating output files. The xx represents:

EH: Enhanced HTML

-PRINTER:EH

EP: Enhanced HTML or PDF

-PRINTER:EP

HP: HP LaserJet

-PRINTER:HP

HT: HTML 2.0

-PRINTER:HT

LP: Line printer

-PRINTER:LP

PD: PDF

-PRINTER:PD

PS: PostScript

-PRINTER:PS

WP: Microsoft Windows

-PRINTER:WP

LP, HP, and PS produce .lis files. EH and HT produce .htm files. HT produces version 2.0 HTML files with the report content inside <PRE></PRE> tags. EH produces reports in which content is fully formatted with version 3.0 or 3.2 HTML tags. On Microsoft Windows systems, WP sends the output to the default Microsoft Windows printer. To specify a Microsoft Windows printer that is not the default, enter -PRINTER:WP:{printer name}, where {printer name} is the name that is assigned to your printer. For example, to send output to a Microsoft Windows printer named New Printer, use -PRINTER:WP:NewPrinter. If the printer name has spaces, enclose the entire argument in quotes. To create an .spf file also, use -KEEP.

-RS

Saves the program in a runtime file. The program is scanned, compiled, and checked for correct syntax. Queries are validated and compiled. The executable version is saved in a file named program.sqt.

Note: SQR for PeopleSoft does not prompt ASK variables after compilation.

-RT

Uses the runtime file that is saved with the -RS flag. This skips all syntax and query checking, and processing begins immediately.

Note: SQR for PeopleSoft does not prompt ASK variables after compilation.

-S

Requests that the status of all cursors be displayed at the end of the report run. Status includes the text of each SQL statement, the number of times each was compiled and run, and the total number of rows that were selected. The output appears directly on the screen. This information can be used for debugging SQL statements, enhancing performance, and tuning.

-Tnn

Specifies that you want to test your report for nn pages. To save time during testing, SQR for PeopleSoft ignores all ORDER BY clauses in SELECT statements. If the program is producing more than one report, SQR for PeopleSoft stops after producing the specified number of pages defined for the first report.

-T{B}

(Microsoft Windows, IBM DB2, and ODBC) Trims trailing blanks from database character columns.

If the TB flag is set in DB2 database environment, SQR trims the all-blanks fields (fields that contain only spaces) to NULL values in the SQR buffers.

Using the TB flag on IBM MVS and DB2 has no effect. IBM MVS and DB2 prevent SQR for PeopleSoft from removing trailing blanks from database character columns.

Note: The -TB flag has an effect only if SQR is connecting to a DB2, or ODBC (MSS) database. Confusingly, the behavior of the -TB command-line flag varies depending on the platform. If you are using one of the previously mentioned databases and are running SQR on z/OS, the -TB flag will act in the following way:

If you do not use the -TB flag, trailing blanks are trimmed.

If you do use the -TB flag, trailing blanks are not trimmed.

If you are running SQR on any other platform, the behavior of -TB is the opposite. That is:

If you do not use the -TB flag, trailing blanks are not trimmed.

If you do use the -TB flag, trailing blanks are trimmed.

-T{Z}

(IBM MVS and DB2) Prevents SQR for PeopleSoft from removing trailing zeros from the decimal portion of numeric columns.

-XB

(Non-Microsoft Windows) Suppresses the SQR banner and the SQR.... End of Run message.

-XC

(Callable SQR) Suppresses the database commit when the report has finished running.

-XCB

(Microsoft Windows) Does not use the communication box. Requests for input are made in Microsoft Windows dialog boxes.

-XI

Prevents user interaction during a program run. If an ASK or INPUT command requires user input, an error message is generated and the program ends.

-XL

Prevents SQR for PeopleSoft from signing in to the database. Programs that you run in this mode cannot contain SQL statements. -XL enables you to run SQR for PeopleSoft without accessing the database. You still must supply at least an empty slash on the command line as a placeholder for the connectivity information.

For example:

sqr myprog / -xl

-XLFF

Prevents a trailing form feed.

-XMB

(Microsoft Windows) Disables the error message display so that you can run a program without interruption from error message boxes. Error messages are sent to an .err file. See the -E flag.

-XNAV

Prevents SQR for PeopleSoft from creating the navigation bar in .htm files that are generated with -PRINTER:HT. This occurs when only a single .htm file is produced. Multiple .htm files that are generated from a single report always contain the navigation bar.

-XTB

Preserves the trailing blanks in a .lis file.

-XTOC

Suppresses the table of contents for the report. This flag is ignored when you specify either -PRINTER:EH or -PRINTER:HT.

-ZIF{file}

Sets the full path and name of the SQR initialization file, pssqr.ini.

-ZIV

Invokes the SPF Viewer after generating the program.spf file. This flag implicitly invokes the -KEEP flag to create program.spf. In the case of multiple output files, only the first report file is passed to the viewer.

-ZMF{file}

Specifies the full path and name of the SQR error message file, sqrerr.dat.

-PDF_tag

Generates the tagged PDF report when run against PDF report output.