Understanding the Sample Program for Printing a Text String

The first sample program is the simplest SQR program. It prints a text string:

Program ex1a.sqr
begin-program
   print 'Hello, World.' (1,1)
end-program

Note: For your convenience, all of the program examples and their output files are included with the installation. As mentioned, these samples are in the SQR for PeopleSoft directory <PS_HOME>\bin\sqr\<database_platform>\SAMPLE (SAMPLEW for Microsoft Windows).

Take another look at the sample program. This program contains three lines of code, starting with BEGIN-PROGRAM and ending with END-PROGRAM. These two commands and the code between them make up the PROGRAM section, which is used to control the order of processing. The PROGRAM section is required, and you can have only one. It typically goes at or near the top of the program.

The PROGRAM section contains a PRINT command, which in this case prints the text Hello, World. This text is enclosed in single quotation marks ('), which are used in SQR to distinguish literal text from other program elements.

The last element of the PRINT command indicates the position on the output page. An output page can be thought of as a grid of lines and columns. The pair (1,1) indicates line 1, column 1, which is the upper-left corner of the page.

Note: In SQR, you must place each command on a new line. You can indent SQR commands.