Creating and Running a Sample SQR Program

This section discusses how to:

  • Create an SQR program.

  • Run an SQR program.

To create an SQR program:

  1. Open a text editor and enter the code in the sample program exactly as shown or open the ex1a.sqr file from the TUTORIAL directory.

  2. If you are writing the sample program, save your code with the name ex1a.sqr.

    SQR programs usually have a file extension of .sqr.

To run the sample program:

  1. Change to the directory in which you saved the program using the command that is appropriate to your operating system.

  2. Enter the appropriate SQR program command at the system command prompt (UNIX/Linux or Microsoft Windows) or from within the graphical user interface (GUI) of the SQR application, where available (Microsoft Windows only).

    If you are using the command line, use SQR (UNIX/Linux) or SQRW (Microsoft Windows) to invoke SQR. Enter sqr or sqrw, the SQR program name, and the connectivity string, all on one line, using this syntax:

    [sqr or sqrw] [program] [connectivity] [flags ...] [args ...] [@file ...]

In a common configuration, you may be running SQR on Microsoft Windows against an Oracle database that is located on another machine in the network. Use this command format:

sqrw ex1a username/password@servername -KEEP

If you correctly replace username, password, and servername with the appropriate information, you should have a command line like this:

sqrw ex1a sammy/baker@rome -KEEP

To produce the output file for this exercise, the example uses the -KEEP flag, which is defined later in this guide.

See SQR for PeopleSoft Tools.

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

Command Line Examples

Here are some examples for running SQR from the command line for different databases and platforms.

DB2 on Microsoft Windows

%PS_HOME%\bin\sqr\DB2\BINW\sqrw %PS_HOME%\sqr\xrfwin.sqr T846U10/testdb2/t3stdb20 
-oc:\sqr_out\xrfwin.out -i%PS_HOME%\sqr\; -zif%PS_HOME%\sqr\pssqr.ini 
-fc:\sqr_out\ T846U10 T846U10 952 VP1 testEnglish

Oracle on Unix

$PS_HOME/bin/sqr/ORA/bin/sqr $PS_HOME/sqr/xrfwin.sqr T846U22/T846U22@T846U22 
-o$PS_HOME/xrfwin_689.out -i$PS_HOME/sqr/ -ZIF$PS_HOME/sqr/pssqr.unx 
"-f$PS_HOME/xrfwin_689.pdf" -printer:pd T846U22 689 VP1 PJS

Microsoft SQL Server on Microsoft Windows

%PS_HOME%\bin\sqr\MSS\BINW\sqrw %PS_HOME%\sqr\xrfwin.sqr T846U10/testdb2/t3stdb20 
-oc:\sqr_out\xrfwin.out -i%PS_HOME%\sqr\; -zif%PS_HOME%\sqr\pssqr.ini 
-fc:\sqr_out\ T846U10 T846U10 952 VP1 testEnglish