Professional Documents
Culture Documents
March 2007
Enterprise PeopleTools 8.49 PeopleBook: SQR Language Reference for PeopleSoft SKU PT849SQL-B 0307 Copyright 1988-2007, Oracle. All rights reserved. The Programs (which include both the software and documentation) contain proprietary information; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation of the Programs, except to the extent required to obtain interoperability with other independently created software or as specified by law, is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. This document is not warranted to be error-free. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose. If the Programs are delivered to the United States Government or anyone licensing or using the Programs on behalf of the United States Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are commercial computer software or commercial technical data pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the Programs, including documentation and technical data, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement, and, to the extent applicable, the additional rights set forth in FAR 52.227-19, Commercial Computer Software--Restricted Rights (June 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065. The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the licensees responsibility to take all appropriate fail-safe, backup, redundancy and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and we disclaim liability for any damages caused by such use of the Programs. The Programs may provide links to Web sites and access to content, products, and services from third parties. Oracle is not responsible for the availability of, or any content provided on, third-party Web sites. You bear all risks associated with the use of such content. If you choose to purchase any products or services from a third party, the relationship is directly between you and the third party. Oracle is not responsible for: (a) the quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with the third party, including delivery of products or services and warranty obligations related to purchased products or services. Oracle is not responsible for any loss or damage of any sort that you may incur from dealing with any third party. Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Open Source Disclosure Oracle takes no responsibility for its use or distribution of any open source or shareware software or documentation and disclaims any and all liability or damages resulting from use of said software or documentation. The following open source software may be used in Oracles PeopleSoft products and the following disclaimers are provided. Apache Software Foundation This product includes software developed by the Apache Software Foundation (http://www.apache.org/). Copyright 2000-2003. The Apache Software Foundation. All rights reserved. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. OpenSSL Copyright 1998-2005 The OpenSSL Project. All rights reserved.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/). THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT AS IS AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Loki Library Copyright 2001 by Andrei Alexandrescu. This code accompanies the book: Alexandrescu, Andrei. Modern C++ Design: Generic Programming and Design Patterns Applied. Copyright 2001 Addison-Wesley. Permission to use, copy, modify, distribute and sell this software for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Helma Project Copyright 1999-2004 Helma Project. All rights reserved. THIS SOFTWARE IS PROVIDED AS IS AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HELMA PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Helma includes third party software released under different specific license terms. See the licenses directory in the Helma distribution for a list of these license. Sarissa Copyright 2004 Manos Batsis. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ICU ICU License - ICU 1.8.1 and later COPYRIGHT AND PERMISSION NOTICE Copyright 1995-2003 International Business Machines Corporation and others. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation. THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder. All trademarks and registered trademarks mentioned herein are the property of their respective owners. Suns JAXB Implementation JDSDK 1.5 relaxngDatatype.jar 1.0 License Copyright 2001, Thai Open Source Software Center Ltd, Sun Microsystems. All rights reserved. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. W3C IPR SOFTWARE NOTICE Copyright 2000 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. Note: The original version of the W3C Software Copyright Notice and License could be found at http://www.w3.org/Consortium/Legal/copyright-software-19980720. THIS SOFTWARE AND DOCUMENTATION IS PROVIDED AS IS, AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
Contents
General Preface About This PeopleBook ............................................................................. .. .. ... ..xi PeopleSoft Enterprise Application Prerequisites... ........................................................ . . . . . . . . .xi Application Fundamentals..................................................................................... . . . . . . . . .xi Documentation Updates and Printed Documentation..................................................... .........xii Obtaining Documentation Updates................................................................................xii Downloading and Ordering Printed Documentation.............................................................xii Additional Resources.......................................................................................... . . . . . . . .xiii Typographical Conventions and Visual Cues............................................................... ........xiv Typographical Conventions.......................................................................................xiv Visual Cues................................................................................................... . . . . . . .xv Country, Region, and Industry Identifiers................................................................ . . . . . . . .xv Currency Codes.....................................................................................................xvi Comments and Suggestions.................................................................................. ........xvi Common Elements Used in PeopleBooks.................................................................. ........xvi
Preface SQR Language Reference for PeopleSoft Preface............................................ . . . . . . .xix SQR Language Reference for PeopleSoft.................................................................. ........xix
Chapter 1 Understanding SQR for PeopleSoft............................................................... ..........1 SQR for PeopleSoft Tools..................................................................................... ..........1 The SQR Language............................................................................................ ..........1 Understanding the SQR Language.................................................................................2 SQR Program Structure.............................................................................................2 SQR Syntax Conventions...........................................................................................3 Rules for Entering SQR Commands. ..............................................................................4 SQR Command Line........................................................................................... ..........4 SQR Command-Line Arguments.. .................................................................................4 SQR Command-Line Flags..........................................................................................5 SQR Data Elements............................................................................................ . . . . . . . .15 Columns...................................................................................................... . . . . . . .15
Contents
Chapter 2 SQR Command Reference.......................................................................... . . . . . . . .21 SQR Command Overview..................................................................................... . . . . . . . .21 SQR Commands............................................................................................... . . . . . . . .22 ADD........................................................................................................... . . . . . . .22 ALTER-COLOR-MAP....................................................................................... . . . . . . .23 ALTER-LOCALE............................................................................................. . . . . . . .25 ALTER-PRINTER............................................................................................ . . . . . . .32 ALTER-REPORT............................................................................................ . . . . . . .33 ARRAY-ADD, ARRAY-DIVIDE, ARRAY-MULTIPLY, ARRAY-SUBTRACT........................... . . . . . . .34 ASK............................................................................................................ . . . . . . .36 BEGIN-DOCUMENT........................................................................................ . . . . . . .37 BEGIN-EXECUTE........................................................................................... . . . . . . .38 BEGIN-FOOTING........................................................................................... . . . . . . .41 BEGIN-HEADING........................................................................................... . . . . . . .42 BEGIN-PROCEDURE...................................................................................... . . . . . . .43 BEGIN-PROGRAM.......................................................................................... . . . . . . .46 BEGIN-SELECT............................................................................................. . . . . . . .46 BEGIN-SETUP............................................................................................... . . . . . . .49 BEGIN-SQL.................................................................................................. . . . . . . .50 BREAK........................................................................................................ . . . . . . .53 CALL, CALL SYSTEM...................................................................................... . . . . . . .53 CLEAR-ARRAY.............................................................................................. . . . . . . .57 CLOSE........................................................................................................ . . . . . . .58 COLUMNS.................................................................................................... . . . . . . .59 COMMIT...................................................................................................... . . . . . . .59 CONCAT...................................................................................................... . . . . . . .60 CONNECT.................................................................................................... . . . . . . .61 CREATE-ARRAY............................................................................................ . . . . . . .62 CREATE-COLOR-PALETTE............................................................................... . . . . . . .64 #DEBUG...................................................................................................... . . . . . . .65 DECLARE-CHART.......................................................................................... . . . . . . .66 DECLARE-COLOR-MAP................................................................................... . . . . . . .74 DECLARE-CONNECTION................................................................................. . . . . . . .75 DECLARE-IMAGE........................................................................................... . . . . . . .77
vi
Contents
DECLARE-LAYOUT......................................................................................... . . . . . . .78 DECLARE-PRINTER........................................................................................ . . . . . . .85 DECLARE-PROCEDURE.................................................................................. . . . . . . .94 DECLARE-REPORT........................................................................................ . . . . . . .96 DECLARE-TOC.............................................................................................. . . . . . . .97 DECLARE-VARIABLE...................................................................................... . . . . . . .99 #DEFINE............................................................................................................101 DISPLAY............................................................................................................103 DIVIDE..............................................................................................................106 DO...................................................................................................................107 #ELSE...............................................................................................................108 ELSE................................................................................................................108 ENCODE............................................................................................................108 END-DECLARE, END-DOCUMENT, END-EVALUATE, END-FOOTING, END-HEADING. . . . . . .......109 #END-IF, #ENDIF..................................................................................................110 END-IF..............................................................................................................110 END-PROCEDURE, END-PROGRAM, END-SELECT, END-SETUP, END-SQL, END-WHILE........110 EVALUATE................................................................................................... . . . . . .111 EXECUTE (Sybase and Microsoft SQL Server)...............................................................113 EXIT-SELECT......................................................................................................115 EXTRACT..........................................................................................................115 FIND.................................................................................................................117 GET..................................................................................................................118 GET-COLOR.......................................................................................................119 GOTO...............................................................................................................121 GRAPHIC BOX, GRAPHIC HORZ-LINE, GRAPHIC VERT-LINE.... .... ..... .... ..... .... .... ............121 #IF...................................................................................................................124 IF.....................................................................................................................126 #IFDEF..............................................................................................................127 #IFNDEF............................................................................................................127 #INCLUDE..........................................................................................................128 INPUT...............................................................................................................129 LAST-PAGE........................................................................................................131 LET..................................................................................................................132 LOAD-LOOKUP....................................................................................................163 LOOKUP............................................................................................................167 LOWERCASE......................................................................................................167 MBTOSBS..........................................................................................................168 MOVE...............................................................................................................168 MULTIPLY..........................................................................................................172
vii
Contents
NEW-PAGE.........................................................................................................173 NEW-REPORT.....................................................................................................173 NEXT-COLUMN...................................................................................................174 NEXT-LISTING....................................................................................................175 OPEN...............................................................................................................176 PAGE-NUMBER...................................................................................................178 POSITION..........................................................................................................179 PRINT...............................................................................................................180 PRINT-BAR-CODE................................................................................................200 PRINT-CHART.....................................................................................................202 PRINT-DIRECT....................................................................................................207 PRINT-IMAGE.....................................................................................................207 PUT..................................................................................................................209 READ................................................................................................................210 ROLLBACK.........................................................................................................212 SBTOMBS..........................................................................................................213 SECURITY.........................................................................................................213 SET-COLOR.......................................................................................................214 SET-GENERATIONS.............................................................................................216 SET-LEVELS.......................................................................................................216 SET-MEMBERS...................................................................................................217 SHOW...............................................................................................................217 STOP................................................................................................................222 STRING.............................................................................................................222 SUBTRACT.........................................................................................................223 TOC-ENTRY.......................................................................................................224 UNSTRING.........................................................................................................225 UPPERCASE......................................................................................................226 USE..................................................................................................................226 USE-COLUMN.....................................................................................................227 USE-PRINTER-TYPE.............................................................................................227 USE-PROCEDURE...............................................................................................228 USE-REPORT.....................................................................................................230 WHILE...............................................................................................................230 WRITE..............................................................................................................232
Chapter 3 Generating HTML Output............................................................................ .......235 HTML General Purpose Procedures......................................................................... .......235
viii
Contents
HTML Heading Procedures................................................................................... .......239 HTML Highlighting Procedures............................................................................... .......242 HTML Hypertext Link Procedures............................................................................ .......246 HTML List Procedures......................................................................................... .......247 HTML Table Procedures....................................................................................... .......251
Chapter 4 Invoking SQR Execute............................................................................... .......255 Running SQR Execute......................................................................................... .......255 Using SQR Execute Flags.................................................................................... .......255
Chapter 5 Using SQR Print....................................................................................... .......263 Understanding SQR Print..................................................................................... .......263 Generating Output from the Command Line................................................................ .......263 Using SQR Print Command-Line Flags..................................................................... .......264 Generating Output in Microsoft Windows................................................................... .......268
Chapter 6 Avoiding Older SQR Commands.................................................................. .......269 Understanding Older SQR Commands...................................................................... .......269 Using Older SQR Commands................................................................................ .......270 BEGIN-REPORT...................................................................................................270 DATE-TIME.........................................................................................................270 DECLARE PRINTER..............................................................................................272 DECLARE PROCEDURE........................................................................................277 DOLLAR-SYMBOL................................................................................................278 GRAPHIC FONT...................................................................................................279 MONEY-SYMBOL.................................................................................................280 NO-FORMFEED...................................................................................................281 PAGE-SIZE.........................................................................................................282 PRINT CODE...................................................................................................283 PRINTER-DEINIT.................................................................................................283 PRINTER-INIT.....................................................................................................284
ix
Contents
Chapter 7 Using the PSSQR.INI File and the PSSQR Command Line.................................. .......285 Installing PSSQR.INI........................................................................................... .......285 Default Settings Section....................................................................................... .......286 Processing-Limits Section..................................................................................... .......292 Environment Sections.......................................................................................... .......294 Locale Section.................................................................................................. .......296 Fonts Section................................................................................................... .......298 Adding Fonts Entries..............................................................................................298 Specifying Character Sets in Windows.........................................................................299 HTML-Images Section......................................................................................... .......299 PDF Fonts Section............................................................................................. .......300 PDF Fonts: Exclusion Ranges Section...................................................................... .......302 TrueType Font Section......................................................................................... .......302 Enhanced-HTML Section...................................................................................... .......303 Colors Section.................................................................................................. .......304 Using PSSQR.EXE Command-Line Options............................................................... .......304
Appendix A SQR Messages........................................................................................ .......309 Unnumbered Messages.. ..................................................................................... .......309 Numbered Messages. ......................................................................................... .......312
Appendix B Using SQR Sample Programs...................................................................... .......425 Understanding SQR Samples................................................................................ .......425 SQR Sample Programs...........................................................................................425
Index ............................................................................................................457
Application Fundamentals
Each application PeopleBook provides implementation and processing information for your PeopleSoft Enterprise applications. For some applications, additional, essential information describing the setup and design of your system appears in a companion volume of documentation called the application fundamentals PeopleBook. Most product lines have a version of the application fundamentals PeopleBook. The preface of each PeopleBook identifies the application fundamentals PeopleBooks that are associated with that PeopleBook.
xi
General Preface
The application fundamentals PeopleBook consists of important topics that apply to many or all PeopleSoft Enterprise applications. Whether you are implementing a single application, some combination of applications within the product line, or the entire product line, you should be familiar with the contents of the appropriate application fundamentals PeopleBooks. They provide the starting points for fundamental implementation tasks.
See Also
Oracles PeopleSoft Customer Connection, http://www.oracle.com/support/support_peoplesoft.html
xii
General Preface
Additional Resources
The following resources are located on Oracles PeopleSoft Customer Connection website:
Resource Application maintenance information Business process diagrams Interactive Services Repository Hardware and software requirements Updates + Fixes Support, Documentation, Business Process Maps Support, Documentation, Interactive Services Repository Implement, Optimize + Upgrade; Implementation Guide; Implementation Documentation and Software; Hardware and Software Requirements Implement, Optimize + Upgrade; Implementation Guide; Implementation Documentation and Software; Installation Guides and Notes Implement, Optimize + Upgrade; Implementation Guide; Implementation Documentation and Software; Pre-Built Integrations for PeopleSoft Enterprise and JD Edwards EnterpriseOne Applications Implement, Optimize + Upgrade; Implementation Guide; Supported Platforms Support, Documentation, Documentation Updates Support, Support Policy Support, Documentation, Documentation Updates, Category, Release Notes Support, Roadmaps + Schedules Support, Documentation, Documentation Updates, Category, Release Notes Support, Documentation, Documentation Updates, Category, Release Value Proposition Support, Documentation, Documentation Updates, Category, Statement of Direction Support, Troubleshooting Support, Documentation, Upgrade Documentation and Scripts Navigation
Installation guides
Integration information
Minimum technical requirements (MTRs) Documentation updates PeopleBooks support policy Prerelease notes Product release roadmap Release notes Release value proposition Statement of direction Troubleshooting information Upgrade documentation
xiii
General Preface
Typographical Conventions
This table contains the typographical conventions that are used in PeopleBooks:
Typographical Convention or Visual Cue Bold Description Indicates PeopleCode function names, business function names, event names, system function names, method names, language constructs, and PeopleCode reserved words that must be included literally in the function call. Indicates field values, emphasis, and PeopleSoft Enterprise or other book-length publication titles. In PeopleCode syntax, italic items are placeholders for arguments that your program must supply. We also use italics when we refer to words as words or letters as letters, as in the following: Enter the letter O. KEY+KEY Indicates a key combination action. For example, a plus sign (+) between keys means that you must hold down the first key while you press the second key. For ALT+W, hold down the ALT key while you press the W key. Indicates a PeopleCode program or other code example. Indicate chapter titles in cross-references and words that are used differently from their intended meanings. Indicate that the preceding item or series can be repeated any number of times in PeopleCode syntax. Indicate a choice between two options in PeopleCode syntax. Options are separated by a pipe ( | ).
Italics
. . . (ellipses)
{ } (curly braces)
xiv
General Preface
Description Indicate optional items in PeopleCode syntax. When placed before a parameter in PeopleCode syntax, an ampersand indicates that the parameter is an already instantiated object. Ampersands also precede all PeopleCode variables.
Visual Cues
PeopleBooks contain the following visual cues.
Notes
Notes indicate information that you should pay particular attention to as you work with the PeopleSoft Enterprise system. Note. Example of a note. If the note is preceded by Important!, the note is crucial and includes information that concerns what you must do for the system to function properly. Important! Example of an important note.
Warnings
Warnings indicate crucial configuration considerations. Pay close attention to warning messages. Warning! Example of a warning.
Cross-References
PeopleBooks provide cross-references either under the heading See Also or on a separate line preceded by the word See. Cross-references lead to other documentation that is pertinent to the immediately preceding documentation.
Country Identifiers
Countries are identified with the International Organization for Standardization (ISO) country code.
xv
General Preface
Region Identifiers
Regions are identified by the region name. The following region identifiers may appear in PeopleBooks: Asia Pacific Europe Latin America North America
Industry Identifiers
Industries are identified by the industry name or by an abbreviation for that industry. The following industry identifiers may appear in PeopleBooks: USF (U.S. Federal) E&G (Education and Government)
Currency Codes
Monetary amounts are identified by the ISO currency code.
xvi
General Preface
Select Once to run the request the next time the batch process runs. After the batch process runs, the process frequency is automatically set to Dont Run. Select Always to run the request every time the batch process runs. Select Dont Run to ignore the request when the batch process runs.
Click to access the Process List page, where you can view the status of submitted process requests. Click to access the Report List page, where you can view report content, check the status of a report, and see content detail messages (which show you a description of the report and the distribution list). An ID that represents a set of selection criteria for a report or process. Click to access the Process Scheduler request page, where you can specify the location where a process or job runs and the process output format. An ID that represents a set of control table information, or TableSets. TableSets enable you to share control table information and processing options among business units. The goal is to minimize redundant data and system maintenance tasks. When you assign a setID to a record group in a business unit, you indicate that all of the tables in the record group are shared between that business unit and any other business unit that also assigns that setID to that record group. For example, you can define a group of common job codes that are shared between several business units. Each business unit that shares the job codes is assigned the same setID for that record group. Enter up to 15 characters of text. An ID that represents the person who generates a transaction.
xvii
General Preface
xviii
See Also
Enterprise PeopleTools 8.49 PeopleBook: SQR for PeopleSoft Developers, Getting Started with SQR for PeopleSoft
xix
Preface
xx
CHAPTER 1
Chapter 1
The HEADING and FOOTING sections specify what is printed in the header and footer on each page of the report.
BEGIN-HEADING {heading_lines} {heading commands}... END-HEADING BEGIN-FOOTING {footing_lines} {footing commands}... END-FOOTING
Chapter 1
Variable
Chapter 1
Note. The executable name for SQR is SQR (SQRW for Windows). The executable name for SQR Execute is SQRT (SQRWT for Windows). The executable for SQR Print is SQRP (SQRWP for Windows). See Chapter 4, Invoking SQR Execute, page 255 and Chapter 5, Using SQR Print, page 263.
Chapter 1
Argument connectivity
Description 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: Name of the database, your username, and the password for the database.
[Database] / [Username] / [Password]
Open Database Connectivity (ODBC): 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 args...
See the following section, SQR Command-Line Flags. 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 expectsfirst all ASK arguments, in order, followed by INPUT arguments. File containing program argumentsone 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.
@file...
Chapter 1
-Bnn
-BURST:{xx}
-CB
Chapter 1
Flag -Dnn
Description (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.
-DBdatabase
(Sybase) Forces the SQR program to use the specified database, which overrides any USE command in the SQR program. See Chapter 2, SQR Command Reference, #DEBUG, page 65. See Chapter 2, SQR Command Reference, DECLARE-VARIABLE, page 99. Directs error messages to the named file or to the default file program.err. If no errors occur, no file is created. 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.
-DEBUG [xxx]
-DNT: {xx}
-E[file]
-EH_APPLETS:dir
-EH_BQD
Generates a {report}.bqd file from the report data. 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.
Chapter 1
Flag -EH_BROWSER:xx
Description 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 users 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. When this flag is set to NETSCAPE, SQR for PeopleSoft generates HTML that is designed for Netscape. 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.
Chapter 1
Flag -EH_KEEP
Description 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.
Chapter 1
Description 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/
-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. 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.
-Idir_list
-ID
(Non-Microsoft Windows) Displays the copyright banner on the console. See Enterprise PeopleTools 8.49 PeopleBook: SQR for PeopleSoft Developers, Printing with SQR.
-KEEP
10
Chapter 1
Description Specifies the following LOAD-LOOKUP values: s: SQR d: DB c: Case sensitive i: Case insensitive See Chapter 2, SQR Command Reference, LOAD-LOOKUP, page 163.
-Mfile
Defines a startup file containing sizes to assign to internal parametersextremely small, large, or complex reports. Mfiles are text files that have individual switches in the INI files that are unique to a run. Prevents the creation of .lis files, creating .spfs instead. 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. 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 pssqr.ini file; this is a user-defined value. Actual is the actual amount of memory/space used by the variable at runtime.
-NOLIS -O[file]
-olim
-P
(IBM MVS) Suppresses printer control characters from column 1. (Informix) Causes column data to preserve trailing blanks.
-PB
11
Chapter 1
Flag -PRINTER:xx
Description Uses printer type xx when creating output files. The xx represents: EH: Enhanced HTML
-PRINTER:EH
HP: HP LaserJet
-PRINTER:HP
PD: PDF
-PRINTER:PD
PS: PostScript
-PRINTER:PS
LP, HP, and PS produce files .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.
12
Chapter 1
Flag -RT
Description 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. 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. (Microsoft Windows, IBM DB2, Sybase CT-Lib, and ODBC) Trims trailing blanks from database character columns. (IBM MVS and DB2) Prevents SQR for PeopleSoft from removing trailing blanks from database character columns. Note. The -TB flag only has an effect if SQR is connecting to either a DB2, Sybase CT-Lib, or ODBC (MSS) database. Confusingly, the behavior of the -TB command-line flag varies depending on theplatform. If you are using one of the above mentioned databases and are running SQR on z/OS, the -TB flag will behave as follows: 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: If you do not use the -TB flag, trailing blanks are not trimmed. If you do use the -TB flag, trailing blanks are trimmed.
-Tnn
-T{B}
13
Chapter 1
Flag -T{Z}
Description (IBM MVS and DB2) Prevents SQR for PeopleSoft from removing trailing zeros from the decimal portion of numeric columns. (Sybase) Uses the named server. (Non-Microsoft Windows) Suppresses the SQR banner and the SQR.... End of Run message. (Callable SQR) Suppresses the database commit when the report has finished running. (Microsoft Windows) Does not use the communication box. Requests for input are made in Microsoft Windows dialog boxes. Prevents user interaction during a program run. If an ASK or INPUT command requires user input, an error is produced and the program ends. 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
-Vserver -XB
-XC
-XCB
-XI
-XL
-XLFF -XMB
Prevents a trailing form feed. (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. 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.
-XNAV
14
Chapter 1
Flag -XP
Description (Sybase) Prevents SQR for PeopleSoft from creating temporary stored procedures. See Chapter 2, SQR Command Reference, BEGIN-SELECT, page 46.
-XTB -XTOC
Preserves the trailing blanks in a .lis file. Suppresses the table of contents for the report. This flag is ignored when you specify either -PRINTER:EH or -PRINTER:HT. Sets the full path and name of the SQR initialization file, sqr.ini. 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. Specifies the full path and name of the SQR error message file, sqrerr.dat.
-ZIF{file}
-ZIV
-ZMF{file}
Columns
Columns are fields that are defined in the database. The ampersand character (&) begins a database column or expression name. It can be any type of column, such as character , number , or date . Columns that are defined in a query are declared automatically, except for dynamic columns and database or aggregate functions.
15
Chapter 1
Variables
Variables are storage places for text or numbers that you define and manipulate. Variables begin with special characters: $ begins a text or date variable. # begins a numeric variable. % begins a list variable. @ begins a variable name for a marker location. Marker locations identify positions to begin printing in a BEGIN-DOCUMENT paragraph.
Variable Rules
The following rules govern the use of variables in SQR: Variables can be almost any name of almost any lengthfor example, $state_name or #total_cost. Do not use an underscore (_) or colon (:) as the first character of a two-variable name. See Enterprise PeopleTools 8.49 PeopleBook: SQR for PeopleSoft Developers, Using Break Logic, Using Hyphens and Underscores. Variable names are not case sensitive. That is, you can use a name in uppercase on one line and lowercase on the next; both refer to the same variable. SQR for PeopleSoft initializes variables to null (text and date) or zero (numeric). A command can grow to whatever length the memory of your computer can accommodate. Numeric variables can be one of three types: float, integer, or decimal. See Chapter 2, SQR Command Reference, DECLARE-VARIABLE, page 99. Variables and columns are known globally throughout a report, except when used in a local procedure (one with arguments or declared with the LOCAL argument), in which case they are known in that procedure only. See Chapter 2, SQR Command Reference, BEGIN-PROCEDURE, page 43.
16
Chapter 1
Variable #current-line
Description 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 SQR commands that are used for positioning the data on the page. Optional page headers and footers, which are defined with BEGIN-HEADING and BEGIN-FOOTING commands, have their own line sequences. Line 2 of the heading is different from line 2 of the report body or footing.
#end-file
See Chapter 2, SQR Command Reference, READ, page 210. Current page number. Value to return to the operating system when SQR for PeopleSoft exits. This can be set in the report. #return-status is initialized to the success return value for the operating system. Count of the rows that are affected by a SELECT paragraph (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. The value of #sql-status is set whenever a BEGIN-SELECT command is run. Normally this variable is checked from inside 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. Therefore, consult the proper database manual to fully interpret its meaning. Name of encoding for character data that is written to the log file or console.
#page-count #return-status
#sql-count
$sql-error
#sql-status
Character data that is retrieved from and inserted into the database.
Name of encoding for character data that is read from files that are used with the OPEN command.
17
Chapter 1
Variable $sqr-encoding-file-output {sqr-encoding-file-output} $sqr-encoding-report-output {sqr-encoding-report-output} $sqr-encoding-source {sqr-encoding-source} $sqr-database {sqr-database} $sqr-dbcs {sqr-dbcs} $sqr-encoding {sqr-encoding} $sqr-hostname {sqr-hostname} $sqr-locale
Description Name of encoding for character data that is written to files that are used with the OPEN command.
Report that is generated by SQR for PeopleSoft (for example, a .lis file or a PostScript file).
Database type for which SQR was compiled. Values are ORACLE, DB2, ODBC, SYBASE, and INFORMIX.
Specifies whether SQR for PeopleSoft recognizes double-byte character strings. Values are YES and NO.
Name of the default encoding as defined by the ENCODING environment variable when SQR for PeopleSoft is invoked. Name of the computer on which SQR for PeopleSoft is currently running.
Name of the current locale that is being used. A plus symbol (+) at the end of the name indicates that an argument that is used in the locale has changed. 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. 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. Process ID of the current SQR process. #sqr-pid is unique for each run of SQR. This variable is useful in creating unique, temporary names. The hardware or operating system type for which SQR was compiled. Values are MVS, Windows, and UNIX/Linux.
#sqr-max-lines
#sqr-max-columns
#sqr-pid
$sqr-platform, {sqr-platform}
18
Chapter 1
Description Name of the SQR process file . Text string that is shown with the -ID flag. SQR version. Database username that is specified on the command line. Name of the report output file . $sqr-report reflects the actual name of the file to use, as specified by the -F flag or NEW-REPORT command.
$sqr-report
List Variables
List variables contain an ordered collection of SQR variables and are nonrecursivethat is, you cannot nest lists inside lists. Indicate list variables with the percent symbol (%). Create list variables with the LET command and a list of variables. For example:
let %list1 = list (num_var1|str_var1, num_var2|str_var2,...)
Working with list variables includes the following tasks: Defining a list variable: You can use a list variable to hold multiple rows of information. Before you assign a list variable, define it by using the following syntax:
let %listname=list(col_var|num_var|str_var|str_lit|num_lit[,...])
or
let %listname[num_lit]=list(NUMBER|DATE|TEXT$colname |.colname[,...])
Assigning a list variable: Assign a list variable by using the following syntax:
let %listname|%listname[num_var|num_lit]=list(col_var|str_var |num_var|str_lit|num_lit[,...])
Accessing a list variable: Access a list variable by using the following syntax:
let str_var|num_var=%listname[num_var|num_lit].#colname
19
Chapter 1
A NUMBER field has the same characteristics as an undeclared #var. The underlying storage depends on the contents, and the DEFAULT-NUMERIC setting applies. The usual SQR rules for variable assignment apply to list access. Assignment is prohibited only between date and numeric types. Assignment of a numeric column to a string variable returns the string representation of the numeric value; assignment of a date variable to a string variable returns the default-edit-mask representation of the date.
Literals
Literals are text or numeric constants: A single quote begins and ends a text literal . For example:
Hello
Numerals 09 begin numeric literals . Numerals that include digits with an optional decimal point and leading sign are acceptable numeric literals. For example, -543.21. Numeric literals can also be expressed in scientific form. For example, 1.2E5.
Sample Reports
To see a quick overview of how an SQR report looks, view the sample reports that are stored in the SQR for PeopleSoft directory <PS_HOME>\bin\sqr\<database_platform>\SAMPLE (or SAMPLEW, for Windows). You can modify these reports to meet your needs.
20
CHAPTER 2
num_col
&price
date_col
&date1
txt_var num_var
$your_name #total_cost
date_var
$date1
21
Chapter 2
Description Text literal defined in a program. Numeric literal defined in a program. Integer literal defined in a program. Integer literal used as an argument to a command. The position qualifier, which consists of the line, column, and length specification. The minimum position, (), means to use the current line and column position on the page for the length of the field being printed.
int_lit nn
12345 123
position
(5,10,30)
SQR Commands
The following sections discuss the SQR commands in alphabetical order.
ADD
Syntax
ADD{src_num_lit | _var | _col} TO dst_num_var [ROUND=nn]
Description
Adds one number to another. The source value is added to the destination variable and the result is placed in the destination. The source is always first and the destination is always second. When dealing with money-related values, use decimal variables rather than float variables . Float variables are stored as double precision floating point numbers , and small inaccuracies can appear when adding many numbers in succession. These inaccuracies can appear due to the way floating point numbers are represented by different hardware and software implementations and also due to inaccuracies that can be introduced when converting between floating point and decimal.
22
Chapter 2
Parameters
Parameter src_num_lit | _var | _col dst_num_var ROUND Description Source number literal, variable, or column. A numeric destination variable that contains the result after execution. Rounds the result to the specified number of digits to the right of the decimal point. For float variables, this value can be from 0 to 15. For decimal variables, this value can be from 0 to the precision of the variable. For integer variables, this argument is not appropriate.
Example
To add 10 to #counter:
add add #counter to #new_count &price to #total round=2
See Also
ALTER-COLOR-MAP
Syntax
ALTER-COLOR-MAP NAME = {color_name_lit | _var | _col} VALUE = ({color_name_lit | _var | _col} | {rgb})
Description
Dynamically alters a defined color. The ALTER-COLOR-MAP command is allowed wherever the PRINT command is allowed. This command enables you to dynamically alter a defined color. You cannot use this command to define a new color.
Parameters
Parameter NAME VALUE {color_name_lit | _var | _col} Description Defines the name of the color you want to alter. For example, light blue. Defines the RGB value of the color you want to alter. For example, (193, 233, 230). The color_name is composed of alphanumeric characters (A-Z, 0-9), the underscore (_) character, and the hyphen (-) character. It must start with an alpha (A-Z) character and is not case-sensitive. The name none is reserved and cannot be assigned a value. A name in the format (RGBredgreenblue) cannot be assigned a value. The name default is reserved and may be assigned a value. Default is used during execution when a referenced color is not defined in the runtime environment. red_lit | _var | _col, green_lit | _var | _col, blue_lit | _var | _col where each component is a value in the range of 000 to 255. In the BEGIN-SETUP section, only literal values are allowed.
{rgb}
23
Chapter 2
The default colors implicitly installed with SQR include: black=(0,0,0) white=(255,255,255) gray=(128,128,128) silver=(192,192,192) red=(255,0,0) green=(0,255,0) blue=(0,0,255) yellow=(255,255,0) purple=(128,0,128) olive=(128,128,0) navy=(0,0,128) aqua=(0,255,255) lime=(0,128,0) maroon=(128,0,0) teal=(0,128,128) fuchsia=(255,0,255)
Example
The following example illustrates the ALTER-COLOR-MAP command:
begin-setup declare-color-map light_blue = (193, 222, 229) end-declare end-setup begin-program alter-color-map name = light_blue value = (193, 233, 230) print Yellow Submarine () foreground = (yellow) background = (light_blue) get-color print-text-foreground = ($print-foreground) set-color print-text-foreground = (purple) print Barney (+1,1) set-color print-text-foreground = ($print-foreground) end-program
See Also
24
Chapter 2
ALTER-LOCALE
Syntax
ALTER-LOCALE [LOCALE={txt_lit _var|DEFAULT|SYSTEM}] [NUMBER-EDIT-MASK={txt_lit|_var|DEFAULT|SYSTEM}] [MONEY-EDIT-MASK={txt_lit|_var|DEFAULT|SYSTEM}] [DATE-EDIT-MASK={txt_lit|_var|DEFAULT|SYSTEM}] [INPUT-DATE-EDIT-MASK={txt_lit|_var|DEFAULT|SYSTEM}] [MONEY-SIGN={txt_lit|_var|DEFAULT|SYSTEM}] [MONEY-SIGN-LOCATION={txt_var|DEFAULT|SYSTEM|LEFT |RIGHT}] [THOUSAND-SEPARATOR={txt_lit|_var|DEFAULT|SYSTEM}] [DECIMAL-SEPARATOR={txt_lit|_var|DEFAULT|SYSTEM}] [DATE-SEPARATOR={txt_lit|_var|DEFAULT|SYSTEM}] [TIME-SEPARATOR={txt_lit|_var|DEFAULT|SYSTEM}] [EDIT-OPTION-NA={txt_lit|_var|DEFAULT|SYSTEM}] [EDIT-OPTION-AM={txt_lit|_var|DEFAULT|SYSTEM}] [EDIT-OPTION-PM={txt_lit|_var|DEFAULT|SYSTEM}] [EDIT-OPTION-BC={txt_lit|_var|DEFAULT|SYSTEM}] [EDIT-OPTION-AD={txt_lit|_var|DEFAULT|SYSTEM}] [DAY-OF-WEEK-CASE={txt_var|DEFAULT|SYSTEM|UPPER|LOWER |EDIT|NO-CHANGE}] [DAY-OF-WEEK-FULL=({txt_lit1|_var1}...{txt_lit7 |_var7})] [DAY-OF-WEEK-SHORT=({txt_lit1|_var1}...{txt_lit7 |_var7})] [MONTHS-CASE={txt_var|DEFAULT|SYSTEM|UPPER|LOWER|EDIT |NO-CHANGE}] [MONTHS-FULL=({txt_lit1|_var1}...{txt_lit12| _var12})] [MONTHS-SHORT=({txt_lit1|_var1}...{txt_lit12|_var12})]
Description
Selects a locale or changes locale parameters used for printing date, numeric, and money data and for data accepted by the INPUT command. A locale is a set of preferences for language, currency, and the presentation of charts and numbers. The SYSTEM locale represents the behavior of older versions of SQR prior to Version 4.0. When you install SQR for PeopleSoft Version 4.0 or later, the default locale is set to SYSTEM. This provides upwards compatibility for older SQR programs. This table describes the SYSTEM locale settings:
25
Chapter 2
Keyword NUMBER-EDIT-MASK
Value The PRINT command prints two digits to the right of the decimal point and left justifies the number in the field. The MOVE, SHOW, and DISPLAY commands format the number with six digits to the right of the decimal point and left justify the number. SQR uses the same default as the NUMBER-EDITMASK keyword. SQR uses the default database date format. See the Date Time section for more details. SQR uses a default date edit mask with the INPUT command. See the Sample Date Edit Masks table for a listing of the date edit mask. $ LEFT , . / : n/a am pm bc ad EDIT
MONEY-EDIT-MASK
DATE-EDIT-MASK
INPUT-DATE-EDIT-MASK
MONEY-SIGN MONEY-SIGN-LOCATION THOUSAND-SEPARATOR DECIMAL-SEPARATOR DATE-SEPARATOR TIME-SEPARATOR EDIT-OPTION-NA EDIT-OPTION-AM EDIT-OPTION-PM EDIT-OPTION-BC EDIT-OPTION-AD DAY-OF-WEEK-CASE
26
Chapter 2
Keyword DAY-OF-WEEK-FULL
Value (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday) (Sun, Mon, Tue, Wed, Thu, Fri, Sat) EDIT (January, February, March, April, May, June, July, August, September, October, November, December) (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec)
MONTHS-SHORT
Parameters
The following table list and describes the parameters: Note. Many of the settings can have a value of DEFAULT or SYSTEM . For a given setting, specifying DEFAULT retrieves the value from the corresponding setting of the default locale as identified in the Default-Settings section of the sqr.ini file. Similarly, specifying SYSTEM retrieves the value from the corresponding setting of the system locale. You can alter the system locale using the ALTER-LOCALE command; however, you cannot define it in the sqr.ini file.
Parameter LOCALE Description Specifies the name of the locale to use. This name must be defined in the sqr.ini file. If this field is omitted, then the current locale is used. The locale name is not case-sensitive and is limited to the following character set: A-Z, 0-9, underscore, and hyphen. The current locale can be determined by printing the reserved variable $sqr-locale. Specifies the numeric edit mask to use with the keyword NUMBER in a PRINT, MOVE, SHOW, or DISPLAY command. Specifies the numeric edit mask to use with the keyword MONEY in a PRINT, MOVE, SHOW, or DISPLAY command. The default date edit mask to use with the keyword DATE in the PRINT, MOVE, SHOW, or DISPLAY command, or the LET functions datetostr() or strtodate(). The default date format to use with the INPUT command when TYPE=DATE is specified with the command or the input variable is a date variable. For information about Edit Masks, see PRINT. Specifies the characters that replace the $ or other currency symbol used in edit masks. Specifies where to place the MONEY-SIGN characters. Valid values are LEFT and RIGHT.
MONEY-SIGN MONEY-SIGN-LOCATION
27
Chapter 2
Parameter THOUSAND-SEPARATOR DECIMAL-SEPARATOR DATE-SEPARATOR TIME-SEPARATOR EDIT-OPTION-NA EDIT-OPTION-AM EDIT-OPTION-PM EDIT-OPTION-BC EDIT-OPTION-AD DAY-OF-WEEK-CASE
Description Specifies the character to replace the , edit character. Specifies the character to replace the . edit character. Specifies the character to replace the / character. Specifies the character to replace the : character. Specifies the characters to use with the na option. Specifies the characters to replace AM. Specifies the characters to replace PM. Specifies the characters to replace BC. Specifies the characters to replace AD. Specifies how the case for the DAY-OF-WEEK-FULL or DAY-OF-WEEK-SHORT entries is affected when used with the format codes DAY or DY. Valid values are UPPER, LOWER, EDIT, and NO-CHANGE. UPPER and LOWER force the output to either all uppercase or lowercase, ignoring the case of the format code in the edit mask. Use EDIT to follow the case specified with the format code in the edit mask. Use NO-CHANGE to ignore the case of the format code and output the day of week explicitly listed in the DAY-OF-WEEK-FULL or DAY-OF-WEEK-SHORT entries. Specifies the full names for the days of the week. SQR considers the first day of the week to be Sunday. You must specify all seven days. Specifies the abbreviated names for the days of the week. SQR considers the first day of the week to be Sunday. You must specify all seven abbreviations. Specifies how the case for the MONTHS-FULL or MONTHS-SHORT entries is affected when used with the format codes MONTH or MON. Valid values are UPPER, LOWER, EDIT, and NO-CHANGE. UPPER and LOWER force the output to either all uppercase or lowercase, ignoring the case of the format code in the edit mask. Use EDIT to follow the case specified with the format code in the edit mask. Use NO-CHANGE to ignore the case of the format code and output the month explicitly listed in the MONTHS-FULL or MONTHS-SHORT entries. Specifies the full names for the months of the year. SQR for PeopleSoft considers the first month of the year to be January. You must specify all 12 months. Specifies the abbreviated names for the months of the year. SQR for PeopleSoft considers the first month of the year to be January. You must specify all 12 abbreviations.
MONTHS-FULL MONTHS-SHORT
Example
The following example illustrates the ALTER-LOCALE command:
! ! The following program segments will illustrate the various ! ALTER-LOCALE features. ! begin-setup declare-variable
28
Chapter 2
date $date $date1 $date2 $date3 end-declare end-setup ! ! Set default masks ! alter-locale number-edit-mask = 9,999,999.99 money-edit-mask = $999,999,999.99 date-edit-mask = Mon DD, YYYY let #value = 123456 let $edit = Mon DD YYYY HH:MI:SS let $date = strtodate(Jan 01 2004 show With NUMBER option #Value show With MONEY option #Value show Without NUMBER option #Value show With DATE option $Date show Without DATE option $Date
11:22:33, $edit) = #value number = #value money = #value = $date date = $date
! ! Reset locale to SQR defaults and assign a multi-character ! money-sign. ! alter-Locale locale = System money-sign = AU$ ! Australian dollars let #value = 123456 show #value edit $999,999,999,999.99 show #value edit $$$$,$$$$999,999.99
! ! Move the money-sign to the right side of the value. Note ! the leading space. ! alter-locale money-sign = AU$ ! Australian dollars money-sign-location = right
29
Chapter 2
let #value = 123456 show #value edit $999,999,999,999.99 show #value edit $$$$,$$$$999,999.99
30
Chapter 2
let $value = let $edit = Mon DD YYYY HH:MI let $date1 = strtodate(Jan 01 2004 11:59, $edit) let $date2 = strtodate(Feb 28 2004 12:01, $edit) show $value edit 999,999,999,999.99Na show $date1 edit Mon DD YYYY HH:MI:SS PM show $date2 edit Mon DD YYYY HH:MI:SS pm
31
Chapter 2
German: 01 Januar 2004 ist Donnerstag 28 Februar 2004 ist Samstag 15 Mrz 2004 ist Montag Spanish: 01 enero 2004 es jueves 28 febrero 2004 es sbado 15 marzo 2004 es lunes
See Also
DISPLAY, LET, MOVE, PRINT, SHOW Chapter 7, Using the PSSQR.INI File and the PSSQR Command Line, page 285
ALTER-PRINTER
Syntax
ALTER-PRINTER [POINT-SIZE={point_size_num_lit|_var}] [FONT-TYPE={font_type|txt_var}] [SYMBOL-SET={symbol_set_id|txt_var}] [FONT={font_int_lit|_var}] [PITCH={pitch_num_lit|_var}]
Description
Alters printer parameters at runtime. You can place the ALTER-PRINTER command in any part of an SQR program except the SETUP section. ALTER-PRINTER attempts to change the attributes of the current printer for the current report. If an attribute does not apply to the current printer, it is ignored. For example, ALTER-PRINTER is ignored if it specifies proportional fonts for a report printed on a line printer. When your program is creating multiple reports and the printer is shared by another report, the attributes are changed for that report as well.
32
Chapter 2
Parameters
Parameter POINT-SIZE FONT-TYPE SYMBOL-SET FONT PITCH Specifies the new font point size. Specifies the new font type. Values are PROPORTIONAL or FIXED. Specifies the new symbol set identifier. Specifies the new font as a number. (For example, font=3 for Courier and font=4 for Helvetica.) Specifies the new pitch in characters per inch. See the DECLARE-PRINTER arguments table for information about these arguments. Description
Example
Change the font and symbol set for the current printer:
alter-printer font=4 ! Helvetica ! PC-850 Multilingual
symbol-set=12U
If the output prints to a PostScript printer, the SYMBOL-SET argument is ignored; however, if the .spf file is kept (-KEEP) and later printed on an HP LaserJet, the symbol set 12U can be used.
See Also
ALTER-REPORT
Syntax
ALTER-REPORT [HEADING={heading_name_txt_lit|_var|_col}] [HEADING-SIZE={heading_size_int_lit|_var|_col}] [FOOTING={footing_name_txt_lit|_var|_col}] [FOOTING-SIZE={heading_size_int_lit|_var|_col}]
Description
Alters some of the report-specific functionality. This command gives you the ability to dynamically change the heading or footing sections that are active for the current report. You can also change how much space the heading or footing sections occupy. If the HEADING or FOOTING value is set to NONE, the section is disabled for the current report. If the HEADING or FOOTING value is set to DEFAULT, the section reverts to the setting that were in effect when the report was initiated. If no HEADING or FOOTING value is set, the HEADING-SIZE or FOOTING-SIZE values affect the HEADING/FOOTING currently being used.
33
Chapter 2
If the ALTER-REPORT command was not invoked from within a BEGIN-HEADING or BEGIN-FOOTING section and the page has not been written to, the assignment takes effect immediately; otherwise it takes effect for the next page.
Parameters
Parameter HEADING HEADING-SIZE FOOTING FOOTING-SIZE Description Specifies the name of the BEGIN-HEADING section to use. Specifies the amount of space the BEGIN-HEADING section occupies on the page. Specifies the name of the BEGIN-FOOTING section to use. Specifies the amount of space the BEGIN-FOOTING section occupies on the page
Example
The following example illustrates the ALTER-REPORT command:
begin-footing 2 name=confidental print Company Confidential (1,1,0) center page-number (2,37,0) end-footing begin-footing 2 name=proprietary print Company Proprietary (1,1,0) center page-number (2,37,0) end-footing begin-report alter-report footing = Proprietary footing-size = 6 . . . end-report
! Increase depth
See Also
34
Chapter 2
Description
These four commands perform arithmetic on one or more elements in an array. The following information applies to the array arithmetic commands: The array must first be created using the CREATE-ARRAY command. The four array arithmetic commands perform on one or more source numbers, placing the result into the corresponding field in the array. Array element and field occurrence numbers can be numeric literals (123) or numeric variables (#j) and can be from zero (0) to one less than the size of the array. If fields are not listed, the results are placed into consecutively defined fields in the array. If fields are listed, results are placed into those fields, at the specified occurrence of the field. If an occurrence is not specified, the zeroth (0) occurrence is used. All fields must be of type number, decimal, float, or integer. They cannot be of type date, char, or text. If division by zero is attempted, a warning message appears, the result field is unchanged, and SQR continues executing.
Parameters
Parameter src_num_lit|_var|_col dst_array_name ( element_int_lit|_var|_col) [ field [ ( occurs_lit|_var|_col) ] ] Description Source values are added to, divided into, multiplied times, or subtracted from the respective destination array fields. All variables must be numeric in type. Destination array fields contain the results after the operation. All variables must be numeric in type.
Example
The following example adds &salary and #comm to the first two fields defined in the emps array. The #jth element of the array is used:
array-add &salary #comm to emps(#j)
The following example subtracts #lost, #count, and 1 from the fields loses, tot, and sequence of the #j2th element of the stats array:
array-subtract #lost #count 1 from stats(#j2) loses tot sequence
The following example multiplies occurrences 0 through 2 of the field p in the #ith element of the percentages array by 2:
array-multiply 2 2 2 times percentages(#i) p(0) p(1) p(2)
35
Chapter 2
The following example divides the #i2th occurrence of the salesman field of the #jth element of the commissions array by 100:
array-divide 100 into commissions(#j) salesman(#i2)
! one row needed for this example ! initialize to 35,000 ! initialize to 5,000
let #salary = 1000 let #commission = 1000 let #j = 0 ! address the array row with variable "#j" ! Add 1000 (in variables) to each column of row 0 (the 1st and only row) array-add #salary #commission TO emps(#j) ! retrieved the new "added" values get #sal #com FROM emps(0) Salary Comm print #sal (+1,1) money print #com (,22) money end-procedure
See Also
The CREATE-ARRAY command for information about creating an array. The CLEAR-ARRAY command for information about clearing or initializing an array. The GET, PUT, and LET commands for information about using arrays.
ASK
Syntax
ASK substitution_variable [prompt]
36
Chapter 2
Description
Retrieves values for a compile-time substitution variable. The retrieval can be by user input, command-line arguments, or as entries in the @file on the command line. The value of the substitution variable replaces the reference variable in the program. Variables are referenced by enclosing the variable name in braces, for example, {state_name}. When the substitution variable is text or date, surround the brackets by single quotes. Substitutions are made when the program is compiled and are saved in the .sqt file. Each variable can be referenced multiple times. ASK is used only in the SETUP section and must appear prior to any substitution variable references. You cannot break the ASK command across program lines.
Parameters
Parameter Substitution_variable Prompt Description The variable to be used as the substitution variable. An optional, literal text string to be displayed as a prompt if the value for the substitution variable is not entered on the command line or in an argument file.
Example
In the following example, state takes the value entered by the user in response to the prompt Enter state for this report:
begin-setup ask state Enter state for this report end-setup ... begin-select name, city, state, zip from customers where state = {state} end-select
See Also
The INPUT command for information about input at runtime. Enterprise PeopleTools 8.49 PeopleBook: SQR for PeopleSoft Developers, Compiling Programs and Using SQR Execute
BEGIN-DOCUMENT
Syntax
BEGIN-DOCUMENT position END-DOCUMENT
Description
Begins a document paragraph . A document paragraph enables you to write free-form text to create form letters, invoices, and so on.
37
Chapter 2
You can reference database columns, SQR variables, and document markers within a document. Their locations in the document determine where they print on the page. You should not use tabs inside a document paragraph. To indent text or fields, use the spacebar. Note also that if the variables being printed inside a document paragraph are variable in length, you might needto manipulate the variable outside the document paragraph. Note. A document must be executed before you can reference its document markers. Because documents can be printed at relative positions on the page, the actual location of a document marker may not be known by SQR until the document itself has been executed.
Parameters
Parameter position Description The location on the page where the document begins. The position can be fixed or relative to the current position. See the POSITION command for a description and examples of the position parameter.
Example
The following example illustrates the BEGIN-DOCUMENT command
begin-document (1,1) .b Dear $firstname ... end-document
See Also
END-DOCUMENT Enterprise PeopleTools 8.49 PeopleBook: SQR for PeopleSoft Developers, Creating Form Letters
BEGIN-EXECUTE
Syntax
BEGIN-EXECUTE [CONNECTION=uq_txt_lit] [ON-ERROR=procedure[(arg1[,argi]...)]] [RSV=num_var] [STATUS=list_var|num_var|txt_var] [SCHEMA=txt_lit|txt_var] [PROCEDURE=txt_lit|txt_var [PARAMETERS=(arg1[IN|INOUT|NULL[,argi[IN|INOUT]]...]])] |COMMAND=txt_lit|txt_var |GETDATA=txt_lit|txt_var] [BEGIN-SELECT[BEFORE=sqr_procedure[(arg1[,argi]...]])]] [AFTER=sqr_procedure[(arg1[,argi]...]])]]] col-name type=char|text|number|date[edit-mask] [on-break]... FROM ROWSETS=({m,-n,n-m,m-|all}) |FROM PARAMETER=txt_lit|txt_var END-SELECT]
38
Chapter 2
END-EXECUTE
Description
Begins a new construct. In a BEGIN-EXECUTE paragraph, the syntax of BEGIN-SELECT varies as shown in the following syntax:
Parameters
Parameter CONNECTION Description Identifies a name previously specified using the DECLARE-CONNECTION construct. If you do not specify a name, SQR Server uses the default connection. The default connection is defined by the command-line entries for datasource (DSN), username (USER), and password (PASSWORD). Name is not case-sensitive. Declares the procedure to execute if an error occurs. Row Set Variable. A global SQR variable containing the row set being retrieved. Identifies a list or scalar variable that receives the status of the stored procedure. Identifies the location in the datasource of the object being queried. The name of the datasource-stored procedure to be executed. The name may include spaces. If the datasource is SAP R/3, this procedure is a BAPI. Scalar and/or list variables of the form list_var | num_lit | txt_lit | txt_var | num_var | any_col. If you do not specify the keywords IN or INOUT, the default value is IN. Specify all parameters in order; leaving any parameters unnamed causes a syntax error. To ignore a parameter, fill its position with the keyword NULL. This results in a null value for that parameter position. A text string you pass to the datasource without modification by SQR. This string can include embedded SQR variables. Names an SQR procedure to be executed before or after the row set. The procedure is not performed unless at least one row is returned from the specified row sets. Special case addition to the BEGIN-SELECT syntax. Available for use with all datasource types, including SAP R/3 and JDBC. Names the row sets from which to retrieve the column variables. If you specify more than one row set, use identical column name/type signatures. Row set numbers must be sequential from left-to-right within the parentheses, and they must not overlap as in this example: (1-3, 2-4). Numeric literals or #variables are allowed. Special case addition to the BEGIN-SELECT syntax. Available only for SAP R/3 datasources. Use only with the PROCEDURE keyword. This argument names an output parameter containing one or more rows from which the column variables are to be retrieved. Specifies a set of keyword-value pairs that represent modifications to be made to the Properties of the datasource (specified by the CONNECTION = statement). An arbitrary number of such pairs can be specified.
FROM PARAMETER
39
Chapter 2
Note. This is a similar concept to the PARAMETERS = statement in DECLARE-CONNECTION, with the minor difference being that the properties specified here alter the flow of returned information, as opposed to just setting login properties. Can be used in conjunction with any data-access model (Procedure, Command, Getdata). An application of this statement would be in the MDB setting, where it might be used to specify such things as Level, Generation, or Include-Column. For example, PROPERTIES = ( SetColumn = 5 )
Example
The following example illustrates the BEGIN-EXECUTE command
begin-setup declare-variable date $when_ordered text $ship_method integer #theRow integer #theStatus integer #howMany end-declare end-setup input #howMany type=integer input $pword let %parm1 = list($when_ordered, $ship_method, #howMany) declare-connection SAPR3 user=scott parameters=clientno=5;node=starfish; end-declare alter-connection name=SAPR3 password=$pword Begin-Execute connection=SAPR3 rsv=#theRow status=#theStatus on-error=it_failed(#theStatus) procedure=CreditHistory version 5 parameters=(%parm1,recalculate) print proc ran OK, status is (+1,1) print #theStatus (,+5) edit 999 Begin-Select before=do_eject after=cleanup city &col=char (1,1) on-break level=1 after=city-tot keyval type=number (1,+1) rcvd type=date (0,+2) from Rowsets=(1) End-Select
40
Chapter 2
End-Execute
See Also
EXECUTE
BEGIN-FOOTING
Syntax
BEGIN-FOOTING footing_lines_int_lit [FOR-REPORTS=(ALL|report_name1[,report_namei]...)] [FOR-TOCS=(ALL|toc_name1[,toc_namei]...)] [NAME={footing_name}] END-FOOTING
Description
Begins the FOOTING section. The FOOTING section defines and controls the information to be printed at the bottom of each page. You must define the report_name in a DECLARE-REPORT paragraph. If you do not use DECLARE-REPORT, the footing is applied to all reports. You can also specify FOR-REPORTS=(ALL). Note that the parentheses are required. You can specify more than one BEGIN-FOOTING section; however, there can be only one for each report. A BEGIN-FOOTING section with FOR-REPORTS=(ALL) can be followed by other BEGIN-FOOTING sections for specific reports, which override the ALL setting. You must define the toc_name in a DECLARE-TOC paragraph. You can also specify FOR-TOCS=(ALL). Note that the parentheses are required. You can specify more than one BEGIN-FOOTING section; however, there can be only one section for each table of contents. A BEGIN-FOOTING section with FOR-TOCS=(ALL) can be followed by other BEGIN-FOOTING sections for a specific table of contents, which override the ALL setting. The BEGIN-FOOTING section can be shared between reports and tables of contents. You can print outside the footing area of the reportthat is, in the body areafrom the footing, but you cannot print in the footing area from the body.
Parameters
Parameter footing_lines_int_lit FOR-REPORTS Description The number of lines to be reserved at the bottom of each page. Specifies the reports to which this footing applies. This argument is required only for a program with multiple reports. If you are writing a program that produces a single report, you can ignore this argument. Specifies the table of contents to which this heading applies. Specifies the name to be associated with this footing section. Use this parameter with the ALTER-REPORT command. The name cannot be NONE or DEFAULT.
FOR-TOCS NAME
41
Chapter 2
Example
The following example illustrates the BEGIN-FOOTING command
begin-footing 2 for-reports=(customer, summary) print Company Confidential (1,1,0) center page-number (2,37,0) end-footing begin-footing 2 ! For all reports print Division Report (1,1,0) center page-number (2,37,0) end-footing begin-footing 2 for-tocs=(all) print Table of Contents (2,1) let $page = roman(#page-count) ! ROMAN numerals print $page (,64) end-footing
See Also
The ALTER-REPORT command for information about dynamic headings and footings. The DECLARE-LAYOUT command for information about page layout. The DECLARE-REPORT command for information about programs with multiple reports. The DECLARE-TOC command for information about the table of contents. The END-FOOTING command.
BEGIN-HEADING
Syntax
BEGIN-HEADING heading_lines_int_lit [FOR-REPORTS=(ALL| report_name1[, report_namei]...)] [FOR-TOCS=(ALL|toc_name1[, toc_namei]...)] [NAME={footing_name}] END-HEADING
Description
Begins a HEADING section. The HEADING section defines and controls information to be printed at the top of each page. You must define the report_name in a DECLARE-REPORT paragraph. If you do not use DECLARE-REPORT, the heading is applied to all reports. You can also specify FOR-REPORTS=(ALL). Note that the parentheses are required. You can specify more than one BEGIN-HEADING section; however, there can be only one for each report. A BEGIN-HEADING section with FOR-REPORTS=(ALL) can be specified followed by other BEGIN-HEADING sections for specific reports, which override the ALL setting. You must define the toc_name in a DECLARE-TOC paragraph. You can also specify FOR-TOCS=(ALL). Note that the parentheses are required.
42
Chapter 2
You can specify more than one BEGIN-HEADING section; however, there can be only one section for each table of contents. A BEGIN-HEADING section with FOR-TOCS=(ALL) can be specified, followed by other BEGIN-HEADING sections for specific tables of contents, which override the ALL setting. The BEGIN-HEADING section can be shared between reports and a table of contents. You can print outside the heading area of the reportthat is, in the body areafrom the heading, but you cannot print in the heading area from the body.
Parameters
Parameter heading_lines_int_lit FOR-REPORTS Description The number of lines to be reserved at the top of each page. Specifies the reports to which this heading applies. This is required only for a program with multiple reports. If you are writing a program that produces a single report, you can ignore this argument. Specifies the table of contents to which this heading applies. Specifies the name to be associated with this heading section. This option cannot be used if FOR-REPORTS or FOR-TOCS is also specified. Use this parameter with the ALTER-REPORT command. The name cannot be NONE or DEFAULT.
FOR-TOCS NAME
Example
The following example illustrates the BEGIN-HEADING command
! Use 2 lines for begin-heading 2 print $current-date (1,1) edit MM/DD/YY ! heading, print Sales for the Month of (1,30) ! 2nd is blank. print $month () end-heading begin-heading 2 for-tocs=(all) print Table of Contents (1,1) bold center end-heading
The ALTER-REPORT command for information about dynamic headings/footings. The DECLARE-LAYOUT command for information about page layout. The DECLARE-REPORT command for information about programs with multiple reports. The DECLARE-TOC command for information about Table of Contents. The END-HEADING command.
See Also
BEGIN-PROCEDURE
Syntax
BEGIN-PROCEDURE procedure_name [LOCAL|(arg1 [, argi]...)] END-PROCEDURE
43
Chapter 2
Description
Begins a procedure. A procedure is one of the most powerful parts of the SQR language. It enables modularized functions and provides standard execution control. The procedure name must be unique. The name is referenced in DO commands. Procedures contain other commands and paragraphs (for example, SELECT, SQL, DOCUMENT). By default, procedures are global. That is, variables or columns defined within a procedure are known and can be referenced outside of the procedure. A procedure is local when the word LOCAL appears after the procedure name or when the procedure is declared with arguments. That is, variables declared within the procedure are available only within the procedure, even when the same variable name is used elsewhere in the program. In addition, any query defined in a local procedure has local database column variable names assigned that do not conflict with similarly named columns defined in queries in other procedures. SQR procedures can be called recursively. However, unlike C or Pascal, SQR maintains only one copy of the local variables and they are persistent. Arguments passed by a DO command to a procedure must match in number: Database text or date columns, string variables, and literals can be passed to procedure string arguments. If passing a date string to a date argument, the date string must be in the format specified by the SQR_DB_DATE_FORMAT setting, or a database dependent format, or the database-independent format SYYYYMMDD[HH24[MI[SS[NNNNNN]]]]. See the Default Database Formats table in the PRINT command description. Database numeric columns, numeric variables, and numeric literals can be passed to procedure numeric arguments. Numeric variables (DECIMAL, INTEGER, FLOAT) can be passed to procedure numeric arguments without regard to the argument type of the procedure. SQR automatically converts the numeric values upon entering and leaving the procedure as required. Date variables or columns can be passed to procedure date or string arguments . When a date variable or column is passed to a string argument, the date is converted to a string according to the following rules: - For DATETIME columns and SQR DATE variables, SQR uses the format specified by the SQR_DB_DATE_FORMAT setting. If this has not been set, SQR uses the first database-dependent format as listed in the Default Database Formats table. - For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT setting. If this has not been set, SQR uses the format listed in the Default Database Formats table. - For TIME columns, the format specified by the SQR_DB_TIME_ONLY_FORMAT setting is used. If this has not been set, SQR uses the format listed in the TIME Column Formats table. To reference or declare global variables from a local procedure, add a leading underscore to the variable name, after the initial $, #, or &. (Example: #_amount) Note. All the SQR reserved variables, such as #sql-status and $sql-error, are global variables. Within a local procedure, they must be referenced using the leading underscore: #_sql-status or $_sql-error.
44
Chapter 2
Parameters
Parameter procedure_name LOCAL arg1 [, argi]... Description Specifies a unique name for this procedure. Procedure names are not case-sensitive. Specifies that this is a local procedure. Specifies the arguments to be passed to or returned from the procedure. Arguments can be string variables ($arg), numeric variables (#arg), or date variables ($arg). If you want to return a value passed back to the calling DO command, place a colon (:) before the variable name. The arguments of the BEGIN-PROCEDURE and DO commands must match in number, order, and type.
Example
The following example shows a procedure, main, that also executes the procedure print_list, for each row returned from the Select statement. No parameters are passed to print_list:
begin-procedure main begin-select name address phone do print_list from custlist order by name end-select ! main end-procedure
In the following example, five arguments are passed to the Calc procedure:
do Calc (&tax, OH, &county_name, 12, #amount) begin-procedure Calc(#rate, $state, $county, #months, :#answer) . . . let #answer = ... end-procedure
In the preceding example the value for :#answer is returned to #amount in the calling DO command. The following example references global variables:
begin-procedure print-it ($a, $b) print $_deptname (+2,5,20) print $a (,+1) print $b (,+1) end-procedure ! $deptname is ! declared outside ! this procedure
45
Chapter 2
See Also
DO, END-PROCEDURE The Default Database Formats table in the Chapter 2, SQR Command Reference, PRINT, page 180 command description.
BEGIN-PROGRAM
Syntax
BEGIN-PROGRAM END-PROGRAM
Description
Begins the PROGRAM section of an SQR program. After processing the any commands in the SETUP section, SQR starts program execution at the BEGIN-PROGRAM section. The PROGRAM section typically contains a list of DO commands, though other commands can be used. This is the only required section in an SQR program.
Example
The following example illustrates the BEGIN-PROGRAM command
begin-program do startup do main do finish end-program
See Also
BEGIN-SELECT
Syntax
BEGIN-SELECT[DISTINCT][-Cnn][-Bnn][-XP][-NR][-SORTnn] [-LOCK{RR|CS|RO|RL|XX}][-DBdatabase] [-DBconnectionstring] [LOOPS=nn][ON-ERROR=procedure[(arg1[,argi]...)]] {column} [&synonym] {expression &synonym} {[$columnname] &synonym = (char | number | date)} [SQR commands] FROM {table,...|[table:$tablename]} [additional SQL] [$variable] END-SELECT
46
Chapter 2
Description
Begins a SELECT paragraph . A SELECT paragraph is the principal means of retrieving data from the database and printing it in a report. A SELECT paragraph must be inside a PROCEDURE or BEGIN-PROGRAM section. Note that SELECT * FROM is not a valid SQR SQL statement. BEGIN-SELECT can be placed inside a BEGIN-PROGRAM section.
Parameters
The table describes the parameters: Note. The arguments can span multiple lines; however, the first character position cannot be used unless the continuation character terminated the previous line. If the first character position is used with arguments spanning multiple lines, the argument will be misconstrued as a Select column.
47
Chapter 2
Description Specifies that duplicate rows be eliminated from your query. (Oracle) Sets the context area size (buffer size for query) to larger or smaller than the default. This option is rarely needed. (Oracle, ODBC, Sybase CT-Lib) Sets the number of rows to retrieve at one time. This is for performance purposes only. Regardless of this setting, all rows are selected. The default, without using -B, is 10 rows. An overall setting for a program can be indicated on the SQR command line with -B, which can be overridden by a separate -B flag on each BEGIN-SELECT command. (Sybase) Prevents the creation of a stored procedure for the SELECT paragraph. When -XP is specified, SQR generates a new SQL statement using the current value of any bind variables each time the BEGIN-SELECT is executed. This disables the potential performance optimization created by stored procedures. Use this flag if you change the variables frequently during execution and you do not want SQR to automatically create stored procedure. You can also use -XP if the username/password to your program does not have permission to create stored procedures. If you do not change variables frequently during execution, the use of stored procedures may optimize your programs performance. In that case, do not use this argument. Note also that -XP is available as a command-line flag. -XP improves performance when you use bind variables and dynamic query variables in the same query. Each time the dynamic query variable changes in value, a new stored procedure is created. If the dynamic query variable changes often and the query contains bind variables, you create many stored procedures if you do not use -XP. (ODBC) Specifies the ODBC connection string for this SELECT paragraph only. A connection string has the following syntax: DSN=data_source_name[;keyword=value[;keyword=value [;...]]] This option enables you to combine data from multiple databases in one program. For example, a connection string for an Oracle database named ora8 might look like this:
DSN=ora8;UID=scott;PWD=tiger
-XP
-DBconnectionstring
where DSN, UID, and PWD are keywords common to all drivers (representing: name, user ID, and password, respectively). Connection string options are always separated by a semicolon (;). Other driver-specific options may be added to the connection string using driver-defined keywords. See your ODBC driver documentation for available options. LOOPS ON-ERROR Specifies the number of rows to retrieve. After the specified number has been processed, the SELECT loop exits. Declares a procedure to execute if an error occurs due to incorrect SQL syntax. Error trapping should be used with dynamic query variables. SELECT paragraphs without dynamic variables are checked for errors before the program is processed and therefore do not require a special error procedure. Optionally, you can specify arguments to be passed to the ON-ERROR procedure. Arguments can be any variable, column, or literal.
Example
In this example, duplicate rows are not selected for the city, state, and zip columns because of the distinct keyword. The numbers within parentheses accompanying city, state, and zip define the column positions of these rows. Column names can not have spaces in front of them. See Enterprise PeopleTools 8.49 PeopleBook: SQR for PeopleSoft Developers, Using Column Variables.
48
Chapter 2
begin-select distinct city (1,1,30) state (0,+2,2) zip (1,+3,6) from custlist order by city end-select
In this example, the first two columns may, or may not, be present when the statement is compiled. The column cust_id is declared to be a number. A runtime error is produced if the database table, as identified by the variable $table_name, declares it to be something other than a number.
begin-select [$col_var_char] [$col_var_num] cust_id from [$table_name] [$where clause] [$order_by_clause] end-select loops=100 &col1=char &col2=number &id=number
See Also
Enterprise PeopleTools 8.49 PeopleBook: SQR for PeopleSoft Developers, Selecting Data from the Database and Enterprise PeopleTools 8.49 PeopleBook: SQR for PeopleSoft Developers, Using Dynamic SQL and Error Checking. END-SELECT, EXIT-SELECT
BEGIN-SETUP
Syntax
BEGIN-SETUP END-SETUP
Description
Begins a SETUP section. This optional section is processed prior to the BEGIN-PROGRAM, BEGIN-HEADING, and BEGIN-FOOTING sections. The SETUP section should be the first section in the program. The SETUP section contains commands that determine the overall characteristics of the program. The commands used in the SETUP section cannot be used elsewhere unless specified. The SETUP section can include the following commands:
ASK BEGIN-SQL
(The CREATE-ARRAY command can also be used in the other sections of an SQR program.)
DECLARE-CHART DECLARE-IMAGE DECLARE-LAYOUT DECLARE-PRINTER
49
Chapter 2
(The LOAD-LOOKUP command can also be used in the other sections of an SQR program.)
USE
Example
The following example illustrates the BEGIN-SETUP command
begin-setup declare-layout customer_list paper-size=(8.5, 11) left-margin=1.0 right-margin=1.0 end-declare end-setup
See Also
BEGIN-SQL
Syntax
BEGIN-SQL[-Cnn][-XP][-NR][-SORTnn] [-LOCK{RR|CS|RO|RL|XX}] [-DBdatabase][-DBconnectionstring] [ON-ERROR=procedure[(arg1[,argi]]...)]! In the SETUP section |[ON-ERROR={STOP|WARN|SKIP}](insetup)! Outside the SETUP section END-SQL
Description
Begins an SQL paragraph . This paragraph can reside in a BEGIN-PROCEDURE, BEGIN-SETUP, or BEGIN-PROGRAM section. BEGIN-SQL starts all SQL statements except SELECT, which has its own BEGIN-SELECT paragraph. If a single paragraph contains more than one SQL statement, each statement except the last must be terminated by a semicolon (;). If a single paragraph contains more than one SQL statement, and the -C flag is used, all are assigned the same context area size or logical connection number. Only non-SELECT statements can be used (except SELECT INTO for Sybase and Microsoft SQL Server). Columns and variables can be referenced in the SQL statements.
50
Chapter 2
Stored Procedures
For Oracle, stored procedures are implemented using PL/SQL in the BEGIN-SQL paragraph. For Sybase and Microsoft SQL Server, SQR supports stored procedures with the EXECUTE command. For some databases, such as Oracle, using DDL statements within a BEGIN-SQL paragraph causes a commit of outstanding inserts, updates, and deletes and releases cursors. For this reason, ensure that these are done in the proper order or unpredictable results may occur.
Oracle PL/SQL
For Oracle, PL/SQL is supported in a BEGIN-SQL paragraph. This requires an additional semicolon at the end of each PL/SQL statement. For Oracle PL/SQL:
begin-sql declare varpl varchar2 (25);; var2 number (8,2);; begin varpl :=abcdefg;; $v1 :=varpl;; $v2 :=1230894asd;; var2 :=1234.56;; #v :=var2;; end;; end-sql
51
Chapter 2
Parameters
Parameter -Cnn -XP Description (Oracle) Sets the context area size (buffer size for query) to larger or smaller than the default. This option is rarely needed. (Sybase) Prevents the creation of a stored procedure for the SQL paragraph. When -XP is specified, SQR generates a new SQL statement using the current value of the bind variables each time the BEGIN-SQL is executed. This disables the performance optimization created by stored procedures. Use this flage if you change the variables frequently during execution and you do not want SQR to automatically create stored procedures. You may also use it if your program does not have permission to create stored procedures. If you do not change variables frequently during execution, the use of stored procedures optimizes the performance of the program. In that case, do not use this argument. -XP improves performance when you use bind variables and dynamic query variables in the same query. Each time the dynamic query variable changes in value, a new stored procedure is created. If the dynamic query variable changes often and the query contains bind variables, you create many stored procedures if you do not use -XP. (ODBC) Specifies the ODBC connection string for this SQL paragraph only. A connection string has the following syntax:
DSN=data_source_name[;keyword=value[;keyword=value[;...]]]
-DBconnectionstring
This option enables you to combine data from multiple databases in one program. For example, a connection string for an Oracle named ora8 might look like the following:
DSN=ora8;UID=scott;PWD=tiger
where DSN, UID, and PWD are keywords common to all drivers (representing name, user ID, and password, respectively). Connection string options are always separated by a semicolon (;). Other driver-specific options may be added to the connection string using driver-defined keywords. See your ODBC driver documentation for available options. ON-ERROR Declares a procedure to execute if an error occurs due to incorrect SQL syntax except when executed in a BEGIN-SETUP section. By default, SQR reports any error and then halts; if an error procedure is declared, you can trap errors, report or log them, and continue processing. The procedure is invoked when an error occurs in any SQL statement in the paragraph. After the error procedure ends, control returns to the next SQL statement. Optionally, you can specify arguments to be passed to the ON-ERROR procedure. Arguments can be any variable, column, or literal. If ON-ERROR is used in the SETUP section, it is a condition flag supporting the following conditions: STOP: Do not run the program. WARN: Run the program but with a warning message. SKIP: Ignore any errors and run the program.
Example
The following example illustrates the BEGIN-SQL command
begin-sql update orders set invoice_num = #next_invoice_num
52
Chapter 2
where order_num = &order_num end-sql begin sql delete orders where order_num = &order_num; insert into orders values ($customer_name, #order_num,...) end-sql
See Also
Enterprise PeopleTools 8.49 PeopleBook: SQR for PeopleSoft Developers, Using Dynamic SQL and Error Checking and Enterprise PeopleTools 8.49 PeopleBook: SQR for PeopleSoft Developers, Using Additional SQL Statements with SQR. END-SQL, BEGIN-PROCEDURE, EXECUTE The -S command-line flag.
BREAK
Syntax
BREAK
Description
Causes an exit from within an EVALUATE or WHILE command. Execution then continues to the command immediately following the END-WHILE or END-EVALUATE. This command is used inside a WHILE ... END-WHILE loop or within an EVALUATE command.
See Also
WHILE, EVALUATE
To issue operating system commands from within an SQR program, use the following syntax:
CALL SYSTEM USING command status [ WAIT | NOWAIT ]
Description
Issues an operating system command or calls a subroutine that you have written in another language, such as C or COBOL, and passes the specified parameters. You can write your own subroutines to perform tasks that are awkward in SQR. Subroutines can be written in any language. Warning! PeopleSoft recommends that the UCALL function not use any database calls as it may cause erroneous results. Used in an SQR program, CALL has the following format:
53
Chapter 2
CALL your_sub USING source destination [param_literal] CALL SYSTEM USING command status [WAIT|NOWAIT]
The CALL SYSTEM is a special subroutine that is provided as part of SQR to enable the program to issue operating system commands. Its arguments, command, status, and WAIT|NOWAIT are described below. The values of the source and destination variables and the parameters literal value are passed to your subroutine. Upon return from the subroutine, a value is placed in the destination variable. You must write the subroutine and call it in one of the supplied UCALL routines. Optionally, you could rewrite UCALL in another language instead. The source file UCALL.C contains sample subroutines written in C. The UCALL function takes the following arguments:
Argument callname Description Name of the subroutine. How Passed By reference with a maximum of 31 characters, null terminated. By reference with a maximum of 255 characters, null terminated. By reference with a maximum of 255 characters. By reference. By reference. By reference with a maximum of 80 characters, null terminated.
strsrc
Source string.
strdes
Destination string.
Source double floating point. Destination double floating point. Subroutine parameter string. It must be a literal.
When you use the CALL command, your arguments are processed as follows: Calling arguments are copied into the variables depending on the type of argument. Strings are placed into strsrc and numerics are placed into dblsrc. Return values are placed into strdes or dbldes depending on whether your destination argument for CALL is a string or numeric variable. The destination arguments can also be used to pass values to your subroutine. To access your subroutine, add a reference to it in UCALL and passing along the arguments you need. You must relink SQR to CALL after compiling a user-defined function that becomes another SQR function. If you have created a new object file, you must add your subroutine to the link command file: in UNIX/Linux it is called SQRMAKE; in Windows it is called SQREXT.MAK. (Alternatively, you could add your routine to the bottom of the UCALL source module that is already included in the link).
54
Chapter 2
Your subroutine and calling SQR program are responsible for passing the correct string or numeric variables and optional parameter string to the subroutine. No checking is performed.
Parameters
Parameter subroutine src_txt_lit|_var|_col src_num_lit|_var|_col dst_txt_var|_num_var param SYSTEM command status Description Specifies the name of your subroutine. Specifies a text column, variable, or literal which is to be input to the called subroutine. Specifies a numeric column, variable (decimal, float, or integer), or literal that is to be input to the called subroutine. Specifies a text or numeric variable (decimal, float, or integer) into which the called subroutine is to place the return result. Specifies an optional alphanumeric string of characters to be passed as a parameter to the subroutine. Specifies that this CALL command issues an operating system command. Specifies the operating system command to execute. The command can be a quoted string, string variable, or column. Contains the status returned by the operating system. The status must be a numeric variable. The value returned in status is system-dependent as follows: UNIX/Linux: Zero (0) indicates success. Any other value is the system error code. PC/ Microsoft Windows: A value less than 32 indicates an error. (Microsoft Windows only): WAIT specifies that SQR suspend its execution until the CALL SYSTEM command has finished processing. NOWAIT specifies that SQR start the CALL SYSTEM command but continue its own processing while that command is in progress. For Microsoft Windows, the default is NOWAIT. On UNIX\Linux operating systems the behavior is always WAIT.
WAIT|NOWAIT
Example
See these sample subroutines included in the UCALL source file: TODASH shows how strings can be manipulated. SQROOT demonstrates how to access numerics. SYSTEM invokes a secondary command processor. The following code calls these subroutines:
call todash using $addr $newaddr /., call sqroot using #n #n2 call sqroot using &hnvr #j call system using dir #s ! ! ! ! ! ! ! Convert these to dashes Put square root of #n into #n2 Hnvr is numeric database column Get directory listing
55
Chapter 2
The following example uses the SYSTEM argument to issue an operating system command. Some operating systems let you invoke a secondary command processor to enter one or more commands and then return to SQR.
! Unix (Type exit to return to SQR) ! let $shell = getenv(SHELL) if isblank($shell) let $shell = /bin/sh end-if call system using $shell #unix_status !Windows (Type exit to return to SQR) ! let $comspec = getenv(COMSPEC) let $cmd = comspec || /c ||$comspec || /k call system using $cmd #win_status wait
The following step-by-step example shows how to add a user-defined subroutine to SQR so that it can be invoked from SQR using the CALL command. For this example, the C function initcap, which makes the first letter of a string uppercase, is added. The function accepts two parameters. The first parameter is the string to which the initcap function is applied. The second is the resultant string. To add initcap function to SQR, the following modifications are needed to the UCALL.C file that was provided with SQR: 1. Add the prototype for the initcap function:
static void initcap CC_ARGS((char *, char *));
2. Modify the UCALL routine in the UCALL.C file. Specifically, add an else if statement at the end of the if statement to check for the initcap function:
void ucall CC_ARGL((callname, strsrc, strdes, dblsrc, dbldes, params)) ... /* If other subroutines, add "else if..." statement for each */ else if (strcmp(callname,"initcap") == 0) initcap(strsrc, strdes); else sq999("Unknown CALLed subroutine: %s\n", callname); return; }
3. At the end of the UCALL.C file, add the initcap routine listed in the following example. The routine name must be lowercase; however, in your SQR program it can be referenced either uppercase or lowercase.
static void initcap CC_ARGL((strsrc, strdes)) /* Pointer to source string */ CC_ARG(char *, strsrc) CC_LARG(char *, strdes) /* Pointer to destination string */ {
56
Chapter 2
int nIndex; int nToUpCase; char cChar; nToUpCase = 1; for (nIndex = 0; cChar = strsrc[nIndex]; nIndex++) { if (isalnum(cChar)) { if (nToUpCase) strdes[nIndex] = islower(cChar) ? toupper(cChar) : cChar; else strdes[nIndex] = isupper(cChar) ? tolower(cChar) : cChar; nToUpCase = 0; } else { nToUpCase = 1; strdes[nIndex] = cChar; } } strdes[nIndex] = \0; }
Note. The CC_ARG macros are defined in the UCALL.C source module. The macros give the programmer the ability to define a fully-prototyped function without having to worry if the C compiler supports the feature. After these modifications, recompile UCALL.C and relink SQR. See the programming manual for your particular machine for details. Finally, the following is an example of a simple SQR program which uses the initcap function:
begin-program input $name Enter lowercase $name call initcap using input $last Enter lowercase $last call initcap using . . . the first name ! ! $name $capname ! the last name ! ! $last $caplast ! Get Set Now Get Set Now the the set the the set first name from the user first name to all lowercase the first character to uppercase last name from the user last name to all lowercase the first character to uppercase
See Also
The LET command for information about user-defined functions using UFUNC.C that can be used in the context of an expression and that can pass and/or return any number of arguments.
CLEAR-ARRAY
Syntax
CLEAR-ARRAY NAME=array_name
57
Chapter 2
Description
Resets each field of an array to its initial value. The CLEAR-ARRAY command resets each field of the named array to the initial value specified for that field in the CREATE-ARRAY command. If no initial value was specified, numeric fields are reset to zero, text fields are reset to null, and date fields are reset to null. CLEAR-ARRAY also releases all memory used by the specified array and returns it to its pristine state.
Parameters
Parameter NAME Description Specifies the name of the array to be cleared.
Example
The following example illustrates the CLEAR-ARRAY command
clear-array name=custs
See Also
CREATE-ARRAY
CLOSE
Syntax
CLOSE {filenum_lit|_var_col}
Description
Closes a file, specified by its file number. Closes a flat file that has been previously opened using the OPEN command.
Parameters
Parameter filenum_lit|_var_col Description Specifies the number assigned to the file in the OPEN command.
Example
The following example illustrates the CLOSE command
close 5 close #j
See Also
58
Chapter 2
COLUMNS
Syntax
COLUMNS {int_lit|_var|_col}[int_lit|_var|_col]...
Description
Defines logical columns to be used for PRINT commands. COLUMNS defines the leftmost position of one or more columns within the current page layout. It sets the first column as current. COLUMNS can be used for printing data either down the page or across the page, depending on how you use the NEXT-COLUMN and USE-COLUMN commands. The COLUMNS command applies only to the current report. If you want to print columns in more than one report, you must specify the COLUMNS command for each report. The USE-COLUMN 0 turns off columns. See USE-COLUMN.
Parameters
Parameter int_lit|_var|_col Description Specifies the left margin position of each column.
See Also
COMMIT
Syntax
COMMIT
Description
Causes a database commit. COMMIT is useful when you are doing many inserts, updates, or deletes in an SQL paragraph. A database commit releases the locks on the records that have been inserted, updated, or deleted. Used with some databases, it also has other effects. For this reason, it should not be used within the scope of an active SELECT paragraph or unpredictable results may occur. When the application completes, a commit is performed automatically unless a ROLLBACK was done or, for callable SQR, the -XC flag was set. Other commands or options, such as the CONNECT command and the use of DDL statements for some databases with a BEGIN-SQL paragraph, can also cause the database to do a commit. COMMIT is an SQR command and should not be used within an SQL paragraph. If COMMIT is used in an SQL paragraph, unpredictable errors can occur. Note. The COMMIT command can be used with SQR servers for Oracle, DB2, Informix, and ODBC. For Sybase and Microsoft SQL Server, use BEGIN TRANSACTION and COMMIT TRANSACTION within SQL paragraphs as in the following code segment.
59
Chapter 2
Example
The following example illustrates the COMMIT command
add 1 to #updates_done if #updates_done > 50 commit move 0 to #updates_done end-if
For Sybase:
... ! Begin Transaction occurred previously begin-sql insert into custlog values (&cust_num, &update_date) end-sql add 1 to #inserts if #inserts >= 50 begin-sql ! Commit every 50 rows commit transaction; begin transaction ! Begin next transaction end-sql move 0 to #inserts end-if ... ! One more Commit Transaction is needed
Warning! Any data being changed by a current transaction is locked by the database and cannot be retrieved in a SELECT paragraph until the transaction is completed by a COMMIT or ROLLBACK statement (or COMMIT TRANSACTION or ROLLBACK TRANSACTION statement for Sybase or Microsoft SQL Server).
CONCAT
Syntax
CONCAT {src_any_lit|_var|_col} WITH dst_txt_var[[:$]edit_mask]
Description
Concatenates a variable, column, or literal with a string variable. The contents of the source field are appended to the end of the destination field. CONCAT can optionally edit the source field before appending it. Edit masks can be changed dynamically by placing them in a string variable and referencing the variable name preceded by a colon (:). Also, the source can be a date variable or column. If an edit mask is not specified, the date is converted to a string according to the following rules: For DATETIME columns and SQR DATE variables, SQR uses the format specified by the SQR_DB_DATE_FORMAT setting.
60
Chapter 2
If this has not been set, the first database-dependent format as listed in the Default Database Formats table is used. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT. If this has not been set, the format listed in the Default Database Formats table is used. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_FORMAT. If this has not been set, the format as listed in the Time Column Formats table is used.
Parameters
Parameter src_any_lit|_var|_col dst_txt_var edit_mask Description Specifies the source field to be concatenated with the dst_txt_var field. Contains the result after execution Specifies an optional edit mask.
Example
The following example illustrates the CONCAT command
concat &zip_plus_4 with $zip -xxxx concat &descrip with $rec :$desc_edit concat $date1 with $string ! Edit zip plus 4. ! Edit mask in variable. ! Concatenate a date.
See Also
The PRINT command for information about the Default Database Formats table, the Time Column Formats table, and edit masks. The LET command for string functions. STRING, UNSTRING
CONNECT
Syntax
CONNECT {txt_lit|_var|_col}[ON-ERROR=procedure[(arg1 [, argi]...)]]
Description
Logs off the database and logs on under a new username and password. The new username and password can be stored in a string variable, column, or literal. Warning! The username/password is not encrypted, so beware of security issues. After each CONNECT, the reserved variable $username is set to the new username. All database cursors or logons are closed before the CONNECT occurs. You should not issue a CONNECT within a SELECT or an SQL paragraph while a query is actively fetching or manipulating data from the database.
61
Chapter 2
Parameters
Parameter txt_lit|_var|_col ON-ERROR Description Specifies a username and password for the logon. Specifies a procedure to be executed if the logon fails. If no ON-ERROR procedure is specified and the logon fails, SQR halts with an error message.
Note. You can optionally specify arguments to be passed to the ON-ERROR procedure. Arguments can be any variable, column, or literal.
Example
The following example illustrates the CONNECT command
connect connect $new-user on-error=bad-logon($new_user) sqr/test
CREATE-ARRAY
Syntax
CREATE-ARRAY NAME=array_name SIZE=nn {FIELD=name:type[:occurs] [={init_value_txt_lit|_num_lit}]}...
Description
Creates an array of fields to store and process data. You can define arrays to store intermediate results or data retrieved from the database. For example, a SELECT paragraph can retrieve data, store it in an array, and gather statistics at the same time. When the query finishes, a summary could be printed followed by the data previously stored in the array. SQR creates arrays before a program starts to execute. The CREATE-ARRAY command can be used in any section of a program. Commands to process arrays include the following:
CREATE-ARRAY CLEAR-ARRAY GET PUT ARRAY-ADD ARRAY-SUBTRACT ARRAY-MULTIPLY ARRAY-DIVIDE LET
The maximum number of arrays in a program is 128; the maximum number of fields per array is 200. The following code is a representation of an array emps with three fields where the CREATE-ARRAY command defines the array:
create-array name=emps size=10 field=name:char=Unknown
62
Chapter 2
field=rate:number:2=10.50 field=phone:char=None
The name is a simple field (one occurrence), rate has two occurrences, and phone is a simple field. Both array elements and field occurrences are referenced beginning with zero (0). The rate is referenced by rate(0) or rate(1). The emps array will contain 10 elements, 0 through 9. All name fields are initialized to Unknown, all phone fields are initialized to None, and all rate fields are initialized to 10.50.
Parameters
Parameter NAME SIZE FIELD Description Names the array. The name is referenced in other array commands. Defines the number of elements in the array. Defines each field or column in the array. Each field must be defined as type: DECIMAL[(p)]: Decimal numbers with an optional precision (p). FLOAT: Double precision floating point numbers. INTEGER: Whole numbers. NUMBER: Uses the DEFAULT-NUMERIC type. See the DECLARE-VARIABLE command. CHAR (or TEXT): Character string. DATE: Same as date variable. You can specify an initialization value for each field. Each field is set to this value when the array is created and when the CLEAR-ARRAY command is executed. If no initialization value is specified, numeric fields (DECIMAL, FLOAT, INTEGER) are set to zero, character fields are set to null, and date fields are set to null. All occurrences of a multiply occurring field are set to the same value. For dates, the initialization string must be formatted as SYYYYMMDD[HH24[MI[SS[NNNNNN]]]]. Fields can optionally have a number of occurrences (occurs ), that is, they can be repeated any number of times.
OCCURS
Example
The following example illustrates the CREATE-ARRAY command
create-array name=custs size=100 field=name:char field=no:number field=state:char field=zip:char field=contacts:char:5 field=last-contacted:date
See Also
The sample report CUSTOMR4.SQR included with SQR. DECLARE-VARIABLE, ARRAY-ADD, ARRAY-DIVIDE, ARRAY-MULTIPLY, ARRAY-SUBTRACT, GET, PUT, LET, CLEAR-ARRAY. The LOAD-LOOKUP command for an alternative way to store database tables in memory.
63
Chapter 2
CREATE-COLOR-PALETTE
Syntax
CREATE-COLOR-PALETTE NAME = {palette_name_txt_lit} COLOR_1 = {rgb_value} COLOR_2 = {rgb_value} [COLOR_n] = {rgb_value}
Description
Create a color palette. This command enables you to create a palette of colors. There is no limit to the number of palettes that can be defined in a program. No gaps are permitted in the palette.
Parameters
Parameter NAME COLOR_1 COLOR_2 COLOR_n {rgb} Description Specifies the name of the color palette. Specifies the first color in the palette. Specifies the second color in the palette. Specifies the nth color in the palette. You can specify up to 64 colors in the palette. Designates a color reference. This can be expressed as (r,g,b) where r, g, and b are either a numeric literal (0 to 255), a numeric variable, or a numeric column. It can also be expressed as a (c) where c is a string literal, column, or variable that is the name of a color.
Example
The following example illustrates the CREATE-COLOR-PALETTE command
begin-report create-color-palette name = funky color_1 = (blue) color_2 = (red) color_3 = (orange) Print-Chart Groovy Color-Palette = Funky end-report
See Also
DECLARE-CHART, PRINT-CHART
64
Chapter 2
#DEBUG
Syntax
#DEBUG[x...]SQR_Command
Description
Causes the current command to be processed during a debugging session. A -DEBUG[xx] flag in the SQR command line enables conditional compilation of SQR commands. When this flag is used, any command (including other compiler directives) preceded by the word #DEBUG is processed; other commands are ignored. This is useful for placing DISPLAY, SHOW, PRINT or other commands in your program for testing and for deactivating them when the report goes into production. The -DEBUG flag can contain a suffix up to 10 letters or digits. These characters are used to match any letters or digits appended to the #DEBUG preprocess command inside the program. #DEBUG commands with one or more matching suffix characters are processed; other commands are ignored. Commands without any suffix always match. In addition, for each -DEBUGxx letter, a substitution variable is defined. For example, if the flag -DEBUGab is used on the command line, three substitution variables are defined: debug, debuga, and debugb. These variables can be referenced in #IFDEF commands to turn whole sections of code on or off for debugging.
Parameters
Parameter x Represents any letter or digit. Description
Example
The following SQR command line contains the -DEBUG flag with no suffixes:
sqr myprog sammy/baker -debug
The following SHOW command in the program executes if invoked with the previous command line because the -DEBUG flag was used:
#debug show The total is #grand-tot 999,999,999
In the following code example, the command line contains the -DEBUG flag with the suffixes a, b, and c:
sqr myprog sammy/baker -debugabc
In the following code example, the first three #DEBUG commands are compiled, but the fourth, beginning #debuge, is not because its suffix does not match any of the suffixes on the -DEBUG flag:
#debuga #debug #debugb #debuge show show show show Now selecting rows... Finished query. Inserting new row. Deleting row.
The following code example shows the use of an #IF with a #DEBUG:
#debuga #debuga #debuga #if {platform}=unix show Platform is UNIX #endif
65
Chapter 2
See Also
DECLARE-CHART
Syntax
DECLARE-CHART chart_name [DATA-LABELS=data_labels_lit] [COLOR-PALETTE=color_palette_lit] [ITEM-COLOR=(chart_item_keyword_lit, color_value_lit |(r,g,b)] [CHART-SIZE=(chart_width_int_lit,chart_depth_int_lit)] [TITLE=title_txt_lit] [SUB-TITLE=subtitle_txt_lit] [FILL=fill_lit] [3D-EFFECTS=3d_effects_lit] [BORDER=border_lit] [POINT-MARKERS=point_markers_lit] [TYPE=chart_type_lit] [LEGEND=legend_lit] [LEGEND-TITLE=legend_title_txt_lit] [LEGEND-PLACEMENT=legend_placement_lit] [LEGEND-PRESENTATION=legend_presentation_lit] [PIE-SEGMENT-QUANTITY-DISPLAY= pie_segement_quantity_display_lit] [PIE-SEGMENT-PERCENT-DISPLAY= pie_segement_percent_display_lit] [PIE-SEGMENT-EXPLODE=pie_segement_explode_lit] [X-AXIS-LABEL=x_axis_label_txt_lit] [X-AXIS-MIN-VALUE={x_axis_min_value_lit|_num_lit}] [X-AXIS-MAX-VALUE={x_axis_max_value_lit|_num_lit}] [X-AXIS-SCALE=x_axis_scale_lit] [X-AXIS-MAJOR-TICK-MARKS=x_axis_major_tick_marks_lit] [X-AXIS-MINOR-TICK-MARKS=x_axis_minor_tick_marks_lit] [X-AXIS-MAJOR-INCREMENT= {x_axis_major_increment_lit|_num_lit}] [X-AXIS-MINOR-INCREMENT= x_axis_minor_increment_num_lit] [X-AXIS-TICK-MARK-PLACEMENT= x_axis_tick_mark_placement_lit] [X-AXIS-GRID=x_axis_grid_lit] [Y-AXIS-LABEL=y_axis_label_lit] [Y-AXIS-MIN-VALUE={y_axis_min_value_lit|_num_lit}] [Y-AXIS-MAX-VALUE={y_axis_max_value_lit|_num_lit}] [Y-AXIS-SCALE=y_axis_scale_lit] [Y-AXIS-MAJOR-TICK-MARKS=y_axis_major_tick_marks_lit] [Y-AXIS-MINOR-TICK-MARKS=y_axis_minor_tick_marks_lit] [Y-AXIS-MAJOR-INCREMENT= {y_axis_major_increment_lit|_num_lit}] [Y-AXIS-MINOR-INCREMENT=
66
Chapter 2
Description
Defines the attributes of a chart that can later be displayed using PRINT-CHART. The DECLARE-CHART command can define the attributes of a chart to be printed as part of a report. This command may only appear in the SETUP section. A chart defined using DECLARE-CHART is printed by referencing its name in the PRINT-CHART command. Some or all of the chart attributes may be overridden at runtime with the PRINT-CHART command. As such, DECLARE-CHART is useful when the basic properties of a chart are common to many PRINT-CHART commands. Note. All DECLARE-CHART attributes can be overridden as part of the PRINT-CHART command. Columns are not supported within the DECLARE-CHART command or the PRINT-CHART command. Attributes that are specified more than once produce a warning, and the first instance is regarded as the actual value. Attributes can be used in any order, with the exception of chart-name, which must follow the DECLARE-CHART keyword. Also, the FILL specification in the DECLARE-PRINTER command can influence the appearance of the chart. The following table lists the final appearance of the chart with a combination of values for PRINTER.COLOR and CHART.FILL options.
CHART.FILL= GRAYSCALE COLOR CROSSHATCH NONE PRINTER.COLOR=Y GRAYSCALE COLOR COLOR-CROSSHATCH NONE PRINTER.COLOR=N GRAYSCALE GRAYSCALE CROSSHATCH NONE
67
Chapter 2
Users can specify any number of palettes, with up to 64 colors defined in each palette. If there are more data points in the data sets than defined colors in the palette, the palette resets and continues to set the data point colors from Color_1 to Color_n. After a color palette has been defined, it can be used within the DECLARE-CHART and PRINT-CHART commands to specify the color palette to be used. The following code example demonstrates the use of a color palette:
Print-Chart test_Chart COLOR-PALETTE = Test-Palette
Parameters
Parameter chart_name CHART-SIZE Description A unique name to be used for referencing a chart. The size of the chart frame in standard SQR coordinate units.
The following DECLARE-CHART Command Arguments table describes other arguments for the DECLARE-CHART command. Note. PeopleSoft does not currently support setting NewGraphics to Yes. You should not use the DATA-LABELS, COLOR-PALETTE, and ITEM-COLOR attributes listed below as they are only valid when NewGraphics=Yes.
68
Chapter 2
Values
Description If NewGraphics is set to Yes, use this argument to specify whether SQR prints the numeric value above the individual data points. Specify NO to suppress the numeric values. If NewGraphics is set to Yes, use this argument to specify the name of the color palette to be used to color the individual data points in each chart (example: bar, slice, point). A valid SQR color-palette must be defined to use COLOR-PALETTE. If NewGraphics is set to Yes, use this argument to specify the color of an individual item in a chart. Specify a chart item and a valid (r,g,b) color to set the color of the chart item.
COLORPALETTE
palette_name
ITEM-COLOR
TITLE
NONE | text
Specifies a title for the chart. That text is placed at the top of the chart. Specifies a subtitle for the chart. That text is placed below the title regardless of whether TITLE is specified. Specifies the type of filling that is applied to the shapes (bars, pie-segments, and so on.) in the chart. GRAYSCALE varies the density of black dots. COLOR sends color instructions to the current printer. If the current printer does not support color, then color can appear in a GRAYSCALE fashion. CROSSHATCH uses patterns to fill the shapes representing each data set. With NONE, all graph shapes are filled with white. Specifies whether the chart depth appears with 3-D effects. If set to NO, the chart is displayed in the default 2D mode. If set to YES, a border is drawn around the chart. If set to NO, no border is displayed around the chart.
SUB-TITLE
NONE | text
FILL
3D-EFFECTS
YES | NO
BORDER
YES | NO
69
Chapter 2
Values
Description Specifies whether point markers appear on line charts. If set to YES, point markers appear on line charts. If set to NO, point markers do not appear. Specifies the type of chart. See Enterprise PeopleTools 8.49 PeopleBook: SQR for PeopleSoft Developers, Using Business Charts.
TYPE
LINE | PIE | BAR, STACKED-BAR | 100%-BAR | OVERLAPPED-BAR | FLOATING-BAR | HISTOGRAM | AREA | STACKED-AREA | 100%-AREA | XY-SCATTER-PLOT | HIGH-LOW-CLOSE YES | NO NONE | text
LEGEND LEGEND-TITLE
Specifies whether to display a legend. Specifies the title for the legend. If set to NONE, no title is displayed in the legend box. Places the legend in the specified location on the chart. The first portion of the placement parameter (CENTER, UPPER, or LOWER) is the vertical position, and the second portion (RIGHT, LEFT, or CENTER) is the horizontal. Specifies where the legend appears on the chart. If set to INSIDE, the legend is presented inside the area defined by the two axes. If set to OUTSIDE, the legend is presented within the chart border, but outside of the region represented by the two axes. Specifies whether quantity is presented for each pie segment. If set to YES, the quantity is presented. Specifies whether the percent-of-total number is presented for each pie segment. If set to YES, the percent-of-total figures is presented.
LEGENDPLACEMENT
LEGENDPRESENTATION
INSIDE | OUTSIDE
PIE-SEGMENTQUANTITYDISPLAY PIE-SEGMENTPERCENTDISPLAY
YES | NO
YES | NO
70
Chapter 2
Argument PIE-SEGMENTEXPLODE
Description Controls which pie segments are exploded (selected) within the pie chart. MAX selects the largest segment. MIN selects the smallest segment. USE-3RD-DATA-COLUMN uses the third field in the DATA-ARRAY to determine which pie segments are exploded. This third field should be a CHAR and values of YES or Y indicate that the segment should be exploded. Specifies a line of text to be presented below (or alongside) the tick-mark labels on the axis. Specifies the minimum value on the axis. If there are data values that are less than X-AXIS- MIN-VALUE, they are not presented. AUTOSCALE directs SQR to calculate an appropriate minimum value. Specifies the minimum value on the axis. If there are data values that are less than Y-AXIS- MIN-VALUE, then they are not presented. AUTOSCALE directs SQR to calculate an appropriate minimum value. Specifies the maximum value on the axis. If there are data values that are greater than XAXIS-MAX-VALUE, they are not presented. AUTOSCALE directs SQR to calculate an appropriate maximum value. Specifies the maximum value on the axis. If there are data values that are greater than YAXIS-MAX-VALUE, they are not presented. AUTOSCALE directs SQR to calculate an appropriate maximum value. Specifies the scale for the axis. LOG specifies a logarithmic scale for the axis. Otherwise, the scale is linear.
NONE | text
AUTOSCALE | number
Y-AXIS-MINVALUE
AUTOSCALE | number
X-AXIS-MAXVALUE
AUTOSCALE | number
Y-AXIS-MAXVALUE
AUTOSCALE | number
X-AXIS-SCALE or Y-AXISSCALE
LOG | LINEAR
71
Chapter 2
Values
Description Specifies whether to display tick-marks for major increments on the X-axis. If set to YES, tick-marks appear on the axis between X-AXIS-MIN-VALUE and X-AXIS-MAX-VALUE, according to the X-AXIS-SCALE setting spaced by X-AXIS-MAJOR-INCREMENT. Specifies whether to display tick-marks for major increments on the Y-axis. If set to YES, tick-marks appear on the axis between Y-AXIS-MIN-VALUE and Y-AXIS-MAX-VALUE, according to the Y-AXIS-SCALE setting spaced by Y-AXIS-MAJOR-INCREMENT. Specifies whether to display tick-marks for minor increments on the X-axis. If set to YES, tick-marks appear on the axis between X-AXIS-MIN-VALUE and X-AXIS-MAX-VALUE, according to the X-AXIS-SCALE setting spaced by X-AXIS-MINOR-INCREMENT. Specifies whether to display tick-marks for minor increments on the Y-axis. If set to YES, tick-marks appear on the axis between Y-AXIS-MIN-VALUE and Y-AXIS-MAX-VALUE, according to the Y-AXIS-SCALE setting spaced by Y-AXIS-MINOR-INCREMENT. Specifies, for SQR, the increment used for spacing the major tick-marks on the axis. AUTOSCALE directs SQR to determine an appropriate increment. Specifies, for SQR, the increment used for spacing the minor tick-marks on the axis. These arguments must be set for the X-AXISMINOR-TICK-MARKS and the Y-AXISMINOR-TICK-MARKS to appear.
Y-AXIS-MAJORTICK- MARKS
YES | NO
X-AXIS-MINORTICK- MARKS
YES | NO
Y-AXIS-MINORTICK- MARKS
YES | NO
AUTOSCALE | number
number
72
Chapter 2
Description Specifies where to place the tick-marks on the axis. INSIDE (or OUTSIDE) directs SQR to place the tick-marks on the inside (or outside) of the axis only. BOTH directs SQR to draw the tick-marks such that they appear on both sides of the axis. Specifies whether a grid line is drawn for each major tick-mark on the axis. If set toYES, a dashed grid line is drawn for each major tick-mark. If set to NO, no grid line is drawn on the axis.
YES | NO
Example
This code example declares a basic sales chart using DECLARE-CHART. For each region, the SUB-TITLE, DATA-ARRAY, and other elements are overridden to provide the chart with the specific features desired.
begin-setup
declare-chart base_sales_chart = (30, 20 ) chart-size title = Quarterly Sales sub-title = none = color fill 3d-effects = yes type = stacked-bar = Product legend-title x-axis-grid = yes end-declare
end-setup begin-program
print-chart base_sales_chart sub-title = Region I = reg1_sales data-array data-array-row-count = #rows_reg1 data-array-column-count = 2 = #max_of_all_regions y-axis-max-value y-axis-min-value = #min_of_all_regions legend = no
73
Chapter 2
print-chart base_sales_chart sub-title = Region II data-array = reg2_sales data-array-row-count = #rows_reg2 data-array-column-count = 2 = #max_of_all_regions y-axis-max-value y-axis-min-value = #min_of_all_regions legend = no
print-chart base_sales_chart (20, 15 ) sub-title = $sub data-array = all sales data-array-row-count = #rows = #cols data-array-column-count data-array-column-labels = (Q1, Q2, Q3, Q4 ) y-axis-max-value = #max_of_all_regions = #min_of_all_regions y-axis-min-value chart-size = (50, 30)
end-procedure
See Also
DECLARE-COLOR-MAP
Syntax
In the SETUP section:
DECLARE-COLOR-MAP color_name = ({rgb}) color_name = ({rgb}) . . . END-DECLARE
74
Chapter 2
Description
Defines colors in an SQR report. The DECLARE-COLOR-MAP command in the BEGIN-SETUP section defines or redefines colors in an SQR report. You can define an endless number of entries.
Parameters
Parameter color_name Description A color_name is composed of alphanumeric characters (A-Z, 0-9), the underscore (_) character, and the hyphen (-) character. It must start with an alphabetical (A-Z) character and is not case-sensitive. The name none is reserved and cannot be assigned a value. A name in the format (RGBredgreenblue) cannot be assigned a value. The name default is reserved and cannot be assigned a value. Default is used during execution when a referenced color is not defined in the runtime environment. red_lit | _var | _col, green_lit | _var | _col, blue_lit | _var | _col where each component is a value in the range of 000 to 255. In the BEGIN-SETUP section, only literal values are allowed. The default colors implicitly installed with SQR include: black=(0,0,0) white=(255,255,255) gray=(128,128,128) silver=(192,192,192) red=(255,0,0) green=(0,255,0) blue=(0,0,255) yellow=(255,255,0) purple=(128,0,128) olive=(128,128,0) navy=(0,0,128) aqua=(0,255,255) lime=(0,128,0) maroon=(128,0,0) teal=(0,128,128) fuchsia=(255,0,255)
{rgb}
Example
The following example illustrates the DECLARE-COLOR-MAP command
begin-setup declare-color-map light_blue = (193, 222, 229) end-declare end-setup
See Also
DECLARE-CONNECTION
Syntax
In the SETUP section:
75
Chapter 2
Description
Defines the datasource logon parameters prior to logon. Can be used to override the default connection logon parameters.
Parameters
Parameter connection_name USER, PASSWORD PARAMETERS = keyword_str=attr_str; Description A user-defined name for describing a datasource connection. Traditional logon semantics. Defines a list of keyword-attribute pairs required by a datasource driver for logon. There is no syntax restriction on these entries apart from the delimiting semicolons (;) and equal signs (=). The keywords must match the logon property names listed for a datasource. This optional keyword prevents SQR from automatically creating additional logins to datasources that are busy handling a previous query. Creating a new login in such cases is the default behavior for SQR, which allows a single CONNECTION declaration to be used in a subquery. The behavior, while allowing dynamic logins as-needed, causes problems when doing both DDL (BEGIN-SQL) and DML (BEGIN-SELECT) against temporary tables in certain vendors datasources. In such cases, you must fetch from the temporary table using the same login in which it was created. Here, you should code the CONNECTION as NO-DUPLICATE=TRUE, and then use that connection in both the table creation logic of BEGIN-SQL and the row fetching logic of BEGIN-SELECT.
Example
The following example illustrates the DECLARE-CONNECTION command
declare-connection SAPR3-1 dsn=SAPR3 username=guest password=guest end-declare
76
Chapter 2
DECLARE-IMAGE
Syntax
DECLARE-IMAGE image_name [TYPE=image_type_lit] [IMAGE-SIZE=(width_num_lit,height_num_lit)] [SOURCE=file_name_lit] END-DECLARE
Note. If TYPE, IMAGE-SIZE, and SOURCE are not defined in DECLARE-IMAGE, they must be defined in PRINT-IMAGE.
Description
Declares the type, size, and source of an image to be printed. The DECLARE-IMAGE command defines and names an image. This image can then be placed in a report at the position specified in the PRINT-IMAGE command. Note. If the image file is unrecognizable, or has incomplete header information, a box (either shaded, for HP printers, or having a diagonal line through it in the case of postscript) appears where the image is expected.
Parameters
Parameter image_name TYPE IMAGE-SIZE SOURCE Description Specifies a unique name for referencing the image declaration. Specifies the image type. Types can be EPS-FILE, HPGL-FILE, GIF-FILE, JPEG-FILE, or BMP-FILE (for Windows). Specifies the width and height of the image in SQR coordinates. Specifies the name of a file containing the image. The file must be in the SQRDIR directory or you must specify the full path. Note. If the file is not in the SQRDIR directory, the full path or no path should be given. You cannot specify a relative path, because you must know where to execute the file from.
Example
The following example illustrates the DECLARE-IMAGE command
declare-image officer-signature type = eps-file source = off_sherman.eps image-size = (40, 5) end-declare
See Also
PRINT-IMAGE.
77
Chapter 2
DECLARE-LAYOUT
Syntax
DECLARE-LAYOUT layout_name [PAPER-SIZE=({paper_width_num_lit[uom], paper_depth_num_lit[uom]}|{paper_name})] [FORMFEED=form_feed_lit] [ORIENTATION=orientation_lit] [LEFT-MARGIN=left_margin_num_lit[uom]] [TOP-MARGIN=top_margin_num_lit[uom]] [RIGHT-MARGIN=right_margin_num_lit[uom] |LINE-WIDTH=line_width_num_lit[uom] |MAX-COLUMNS=columns_int_lit] [BOTTOM-MARGIN=bottom_margin_num_lit[uom] |PAGE-DEPTH=page_depth_num_lit[uom] |MAX-LINES=lines_int_lit] [CHAR-WIDTH=char_width_num_lit[uom]] [LINE-HEIGHT=line_height_num_lit[uom]] END-DECLARE
Description
Defines the attributes for the layout of an output file . The DECLARE-LAYOUT command describes the characteristics of a layout to be used for an output file. A layout can be shared by more than one report. If no DECLARE-LAYOUT is defined or if a DECLARE-REPORT does not reference a defined layout, a layout named DEFAULT is created with the default attribute values shown in the DECLARE-LAYOUT Command Arguments table. For an example of how DECLARE-LAYOUT relates to DECLARE-REPORT, see the DECLARE-REPORT examples in this document. You can define as many layouts as are necessary for the requirements of the application. You can override the DEFAULT layout attributes by defining a layout called DEFAULT in your program. Each layout name must be unique. SQR maps its line and column positions on the page by using a grid determined by the LINE-HEIGHT and CHAR-WIDTH arguments. That is, SQR calculates the number of columns per row by dividing the LINE-WIDTH by the CHAR-WIDTH and calculates the number of lines by dividing the PAGE-DEPTH by the LINE-HEIGHT. Each printed segment of text is placed on the page using this grid. Because the characters in proportional fonts vary in width, it is possible that a word or string is wider than the horizontal space you have allotted, especially in words containing uppercase letters or boldfaced characters. To account for this behavior, you can either move the column position in the PRINT or POSITION statements or indicate a larger CHAR-WIDTH in the DECLARE-LAYOUT command. The DECLARE-LAYOUT command selects the proper fonts. In addition, the parameter interacts with PAPER-SIZE as follows: When you do not specify ORIENTATION=LANDSCAPE or the PAPER-SIZE dimensions, SQR creates a page with the dimensions set to 11 inch by 8.5 inch. This results in a page of 100 columns by 45 lines with 0.5 inch margins. When you specify PAPER-SIZE=(paper_name) the page orientation is set according to the paper_name specified. If you also specify ORIENTATION and the value differs from the PAPER-SIZE value, the ORIENTATION value overrides the PAPER-SIZE value.
78
Chapter 2
When you specify PAPER-SIZE=(page_width, page_depth), SQR does not swap the page width and page depth if ORIENTATION=LANDSCAPE.
Parameters
Parameter layout_name uom (unit of measure) paper_name Description A unique layout name to be used for referencing the layout and its attributes. An optional suffix which denotes the unit of measure to apply to the preceding value. An option of PAPER-SIZE. This name is associated with predefined dimensions.
This table lists valid paper names for the paper_name parameter.
Name Letter Legal A4 Executive B5 Com-10 Monarch 8.5 in 8.5 in 8.27 in 7.25 in 7.17 in 4.125 in 3.875 in Width 11 in 14 in 11.69 in 10.5 in 10.12 in 9.5 in 7.5 in Depth Orientation Portrait Portrait Portrait Portrait Portrait Landscape Landscape
79
Chapter 2
Depth
PAPER-SIZE
8.5 in, 11 in
Physical size of the page. The first parameter is the width of the page. The second parameter is the depth or length. It may also be a predefined name. (See the table of valid paper names..) Note that when ORIENTATION= LANDSCAPE the default values are 11 in, 8.5 in. Specifies whether formfeeds are to be written at the end of each page. Portrait pages are printed vertically. Landscape pages are printed horizontally. Printing in landscape for the printer type HPLASERJET requires landscape fonts. Amount of blank space to leave at the left side of the page. Amount of blank space to leave at the top of the page.
FORMFEED
YES, NO
YES
ORIENTATION
PORTRAIT, LANDSCAPE
PORTRAIT
LEFT-MARGIN
inches
0.5 in
TOP-MARGIN
inches
0.5 in
80
Chapter 2
Argument
Default Value
Description
RIGHT-MARGIN
0.5 in
Amount of blank space to leave at the right side of the page. If you specify LINE-WIDTH or MAX-COLUMNS, you cannot use this parameter. Length of the line. If you specify RIGHT-MARGIN or MAX-COLUMNS, you cannot use this parameter. Maximum number of columns in a line. If you specify RIGHT-MARGIN or LINE-WIDTH, you cannot use this parameter. Amount of blank space to leave at the bottom of the page. If you specify PAGE-DEPTH or MAX-LINES, you cannot use this parameter. Depth of the page. If you specify BOTTOM-MARGIN or MAX-LINES, you cannot use this parameter. Maximum number of lines printed on the page. If you specify PAGE-DEPTH or BOTTOM-MARGIN, you cannot use this parameter.
LINE-WIDTH
inches
7.5 in
MAX-COLUMNS
75
BOTTOM-MARGIN
inches
0.5 in
PAGE-DEPTH
inches
10 in
MAX-LINES
60
81
Chapter 2
Argument
Default Value
Description
LINE-HEIGHT
Size of each SQR line on the page. There are 72 points per inch. If LINE-HEIGHT is not specified, it follows the value for POINT-SIZE, if specified. The default value of 12 points yields 6 lines per inch. For the printer type LINEPRINTER, this value is used only to calculate the TOP-MARGIN and BOTTOM-MARGIN (for example, not in computing the position on the page). Size of each SQR horizontal character column on the page (for example, the distance between the locations (1, 12) and (1, 13)). For the printer type LINEPRINTER, this value is used only to calculate the TOP-MARGIN and BOTTOM-MARGIN (not in computing the position on the page).
CHAR-WIDTH
points
7.2 pt
Example
This example illustrates the ability to specify these parameters using a different measurement system, such as metric:
! declare-layout my-layout paper-size=(a4) left-margin=12.7 mm right-margin=25.4 mm end-declare ! Results in: ! ! ! ! ! paper-size=(210mm, 297mm) top-margin=12.7mm left-margin=12.7mm right-margin=25.4mm bottom-margin=12.7mm
82
Chapter 2
! ! !
This example changes the page dimensions and also changes the left and right margins to be 1 inch:
! declare-layout large-paper paper-size=(14, 11) left-margin=1 right-margin=1 end-declare ! Results in: ! ! ! ! ! ! ! ! paper-size=(14in, 11in) top-margin=0.5in left-margin=1.0in right-margin=1.0in bottom-margin=0.5in orientation=portrait columns=120 lines=60
This example retains the default page dimensions and changes the left and right margins to be 1 inch:
declare-layout default left-margin=1 right-margin=1 end-declare ! Results in: ! ! ! ! ! ! ! ! paper-size=(8.5in, 11in) top-margin=0.5in left-margin=1.0in right-margin=1.0in bottom-margin=0.5in orientation=portrait columns=65 lines=60
This example changes the orientation to landscape; the default page dimensions of (8.5in and 11in) are swapped, the columns and rows are recalculated, and all other values remain the same:
declare-layout default orientation=landscape ! Results in: ! paper-size=(11in, 8.5in)
83
Chapter 2
end-declare
! ! ! ! ! ! !
This example changes the orientation to landscape; the default page dimensions of (8.5in and 11in) are swapped, and the top margin is set to 1 inch:
declare-layout my_landscape orientation=landscape top-margin=1 end-declare ! Results in: ! ! ! ! ! ! ! ! paper-size=(11in, 8.5in) top-margin=1.0in left-margin=0.5in right-margin=0.5in bottom-margin=0.5in orientation=landscape columns=100 lines=43
This example illustrates how to specify the page dimensions using one of the predefined names (note that the orientation has also changed because this example is an envelope):
declare-layout envelope paper-size=(com-10) end-declare ! Results in: ! ! ! ! ! ! paper-size=(4.125in, 9.5in) top-margin=0.5in left-margin=0.5in right-margin=0.5in bottom-margin=0.5in orientation=landscape
84
Chapter 2
! !
columns=85 lines=18
See Also
DECLARE-REPORT
DECLARE-PRINTER
Syntax
DECLARE-PRINTER printer_name [FOR-REPORTS=(report_name1[,report_namei]...)] [TYPE=printer_type_lit] [INIT-STRING=initialization_string_txt_lit] [RESET-STRING=reset_string_txt_lit] [COLOR=color_lit] [POINT-SIZE=point_size_num_lit] [FONT-TYPE=font_type_int_lit] [SYMBOL-SET=symbol_set_id_lit] [STARTUP-FILE=file_name_txt_lit] [PITCH=pitch_num_lit] [FONT=font_int_lit] [BEFORE-BOLD=before_bold_string_txt_lit] [AFTER-BOLD=after_bold_string_txt_lit] END-DECLARE
Description
Overrides the printer defaults for the specified printer type. Each printer has a set of defaults as listed in the DECLARE-PRINTER Command Arguments table. The DECLARE-PRINTER command overrides these defaults. Use the DECLARE-PRINTER command in the SETUP section to define the characteristics of the printer or printers to be used. If you need to change some of the arguments depending on the runtime environment, you can use the ALTER-PRINTER command in any part of the program except the PROGRAM and SETUP sections. A program can contain no more than one DECLARE-PRINTER command for each printer type for each report. If you do not provide a printer declaration, the default specifications are used. The default printer attributes can be overridden by providing a DECLARE-PRINTER specification for each printer. The names are: DEFAULT-LP for line printer. DEFAULT-HP for HP LaserJet. DEFAULT-HT for HTML. DEFAULT-PS for PostScript This table lists the arguments, provides the possible choices or measure, lists the default values, and describes the arguments.
85
Chapter 2
Argument FOR-REPORTS
Default
Description The name of the reports that use this printer definition. The default is ALL, for all reports. This argument is required only for a program with multiple reports. If you are writing a program that produces only a single report, you can ignore this argument. The output type specific to each printer. LINEPRINTER (LP) files can be viewed by a text editor. POSTSCRIPT (PS) files require you to know PostScript to understand what will be shown on the printer. HPLASERJET (HP) files are binary files and cannot be edited or viewed. HTML (HT) files can be viewed by a browser. Sends control or other characters to the printer at the beginning of the report. This parameter is designed primarily for the LINEPRINTER and has limited use with other printer types. Specify nondisplay characters by placing their decimal values inside angle brackets. For example, <27> is the ESC or escape character.
TYPE
LP
INIT-STRING
(none)
86
Chapter 2
Argument RESET-STRING
Default
Description Sends control or other characters to the printer at the end of the report. This parameter is designed primarily for the LINEPRINTER and has limited use with other printer types. Specify nondisplay characters by placing their decimal values inside angle brackets. For example, <27> is the ESC or escape character. Specifies whether this printer can print in color. This argument does not apply to LINEPRINTER printers. The beginning size of the selected font. This argument applies only to HPLASERJET printers and needs to be specified only for font types not defined in the Fonts Available for HP LaserJet Printers in SQR table. This argument applies only to HPLASERJET printers. The default value of 0U is for the USASCII symbol set. For a complete list of the symbol sets, see the HP
COLOR
Yes, No
No
POINT-SIZE
points
12
FONT-TYPE
PROPORTIONAL, FIXED
SYMBOL-SET
HP defined sets
0U
87
Chapter 2
Argument STARTUP-FILE
Default POSTSCRI.STR
Description This argument applies only to POSTSCRIPT printers. This argument is used to specify an alternate startup file. Unless otherwise specified, the default startup file is located in the directory pointed to by the environment variable SQRDIR. This argument is for HPLASERJET printers only. If you specify a fixed pitch font, you should also indicate the pitch.
PITCH
characters/inch
10
88
Chapter 2
Argument FONT
Default
Description This is the font number of the typeface to use. For HPLASERJET printers, this is the typeface value as defined by Hewlett-Packard. For a complete list of the typeface numbers, see the
For POSTSCRIPT printers, SQR supplies a list of fonts and arbitrary font number assignments in the file POSTSCRI.STR. The font numbers are the same as those for HP LaserJet printers, wherever possible, so that you can use the same font number for reports to be printed on both types of printers. You can modify the font list in POSTSCRI.STR to add or delete fonts. Read the POSTSCRI.STR file for instructions. The Fonts Available for HP LaserJet Printers in SQR table lists the fonts available in SQR internally. The Fonts Available for PostScript Printers table lists the fonts available in the SQR POSTSCRI.STR file.
89
Chapter 2
Argument BEFORE-BOLD
Default
Description The BEFORE-BOLD and AFTER-BOLD arguments are for LINEPRINTER printers only. They specify the character string to turn boldfacing on and off. If the string contains blank characters, enclose it in single quote marks (...). To specify nonprintable characters, such as ESC, enclose the decimal value inside angle brackets as shown: BEFORE-BOLD=<27> [r ! Turn on bold AFTER-BOLD=<27>[u ! Turn it off These arguments work with the BOLD argument of the PRINT command.
AFTER-BOLD
any string
(none)
See BEFORE-BOLD.
This table lists the fonts available in SQR for use with the FONT argument for HPLASERJET printer types.
Value 0 1 2 3 4 5 6 8 Line printer Pica Elite Courier Helvetica Times Roman Letter Gothic Prestige Typeface Fixed Fixed Fixed Fixed Proportional Proportional Fixed Fixed Style
90
Chapter 2
Value 11 17 18 19 20 21 22 23 24
Typeface Presentations Optima Garamondi Cooper Black Coronet Bold Broadway Bauer Bodini Black Condensed Century Schoolbook University Roman Fixed Proportional Proportional Proportional Proportional Proportional Proportional Proportional Proportional
Style
The font you choosein orientation, typeface, and point sizemust be an internal font, available in a font cartridge, or downloaded to the printer. For fonts not listed in the Fonts Available for HP LaserJet Printers in SQR table, you must indicate the font style using the FONT-TYPE argument to ensure that the correct typeface is selected by the printer. This table lists the fonts available in SQR for use with the FONT argument for PostScript printer types:
Value 3 4 5 6 8 11 Courier Helvetica Times Roman Avant Garde Book Palatino Roman Symbol Typeface Y Y Y N/A Y N/A Boldface Type Available
91
Chapter 2
Value 12 17 18 23 30 31 32 33 34 35 36 37 38 39 40 41 42
Typeface Zapf Dingbats Zapf Chancery Medium Italic Bookman Light New Century Schoolbook Roman Courier Oblique Helvetica Oblique Times Italic Avant Garde Demi Avant Garde Book Oblique Avant Garde Demi Oblique Palatino Oblique New Century Schoolbook Italic Helvetica Narrow Helvetica Narrow Oblique Bookman Demi Bookman Light Italic Bookman Demi Italic
Boldface Type Available N/A N/A N/A Y Y Y Y N/A N/A N/A Y Y Y Y N/A N/A N/A
92
Chapter 2
There are different fonts available in SQR for Windows when printing with Microsoft Windows printer drivers (using the -PRINTER:WP command-line flag). When you use the -PRINTER:WP flag, your report is sent directly to the default Microsoft Windows printer. To specify a nondefault Microsoft Windows printer, enter -PRINTER:WP:{printer name}. The {printer name} is the name assigned to your printer. For example, to send output to a Windows printer named NewPrinter, you would use -PRINTER:WP:NewPrinter. If your printer name has spaces, enclose the entire argument in quotes. Fonts are specified by number in the FONT qualifier of the ALTER-PRINTER command. This table lists the fonts available when printing with Microsoft Windows printer drivers:
Value 3 300 4 400 5 500 6 8 800 11 Windows Font/Name Courier New Courier New Arial Arial Times New Roman Times New Roman AvantGarde Palatino Palatino Symbol Fixed Bold Proportional Bold Proportional Bold Proportional Proportional Bold Proportional Style
Note. Fonts 6, 8, and 800 are not supplied with Microsoft Windows. You can get these fonts by purchasing the ADOBE Type Manager (ATM). The advantage of using ATM fonts is the compatibility for PostScript printer fonts. The Symbol font uses the SYMBOL_CHARSET instead of the usual ANSI_CHARSET character set. You can add more fonts by editing the appropriate Fonts section in the sqr.ini file. See Chapter 7, Using the PSSQR.INI File and the PSSQR Command Line, page 285.
Parameters
Parameter printer_name Description A unique name to be used for referencing a printer definition and its attributes.
93
Chapter 2
Note. The DECLARE-PRINTER Command Arguments table describes the other arguments of the DECLARE-PRINTER command. The table lists the options, default values, and description of each of the arguments.
Example
The following example illustrates the DECLARE-PRINTER command
declare-printer HP-definition type=HP font=4 symbol-set=12U end-declare declare-printer PS-Sales for-reports=(sales) type=PS font=5 end-declare ! Times-Roman ! Default HP definition ! for all reports ! Helvetica ! PC-850 Multilingual ! PS definition ! for the Sales report
See Also
ALTER-PRINTER, DECLARE-REPORT
DECLARE-PROCEDURE
Syntax
DECLARE-PROCEDURE [FOR-REPORTS=(report_name1[,report_namei]...)] [BEFORE-REPORT=procedure_name[(arg1[,argi]...)]] [AFTER-REPORT=procedure_name[(arg1[,argi]...)]] [BEFORE-PAGE=procedure_name[(arg1[,argi]...)]] [AFTER-PAGE=procedure_name[(arg1[,argi]...)]] END-DECLARE
Description
Declares procedures that are triggered when a specified event occurs. The DECLARE-PROCEDURE command can be used to define SQR procedures that are to be invoked before or after a report is printed or before the beginning or end of each page. Issue the DECLARE-PROCEDURE in the SETUP section. For multiple reports, you can use the command as often as required to declare procedures required by all the reports. If you issue multiple DECLARE-PROCEDURE commands, the last one takes precedence. In this way, you can use one command to declare common procedures for ALL reports and others to declare unique procedures for individual reports. The referenced procedures can accept arguments.
94
Chapter 2
If there are no FOR-REPORTS specified, ALL is assumed. Initially, the default for each of the four procedure types is NONE. If a procedure is defined in one DECLARE-PROCEDURE for a report, that procedure is used unless NONE is specified. Use the USE-PROCEDURE command to change the procedures to be used at runtime. To turn a procedure off, specify NONE in the USE-PROCEDURE statement.
Parameters
Parameter FOR-REPORTS Description Specifies one or more reports that use the given procedures. This argument is required only for a program with multiple reports. If you are writing a program that produces only a single report, you can ignore this argument. Specifies a procedure to be executed at the time of the execution of the first command which causes output to be generated (PRINT). It can be used, for example, to create a report heading. Specifies a procedure to be executed just before the report file is closed at the end of the report. It can be used to print totals or other closing summary information. If no report was generated, the procedure does not execute. Specifies a procedure to be executed at the beginning of every page, just before the first output command for the page. It can be used, for example, to set up page totals. Specifies a procedure to be executed just before each page is written to the file. It can be used, for example, to display page totals. You can optionally specify arguments to be passed to any of the procedures. Arguments can be any variable, column, or literal.
BEFORE-REPORT
AFTER-REPORT
BEFORE-PAGE AFTER-PAGE
Example
The following example illustrates the DECLARE-PROCEDURE command
declare-procedure before-report=report_heading after-report=report_footing end-declare declare-procedure for-reports=(customer) before-page=page_setup after-page=page_totals end-declare ! These procedures will ! be used by all reports
See Also
USE-PROCEDURE
95
Chapter 2
DECLARE-REPORT
Syntax
DECLARE-REPORT report_name [TOC=toc_name] [LAYOUT=layout_name] [PRINTER-TYPE=printer_type] END-DECLARE
Description
Defines reports and their attributes. Issue the DECLARE-REPORT in the SETUP section. You can use the DECLARE-REPORT command to declare one or more reports to be produced in the application. You must use this command when developing applications to produce more than one report. Multiple reports can share the same layout and the same printer declarations or each report can use its own layout or printer definitions if the report has unique characteristics. When you are printing multiple reports, unless report names are specified using the -F command-line flag, the first report declared is generated with the name of program.lis, where program is the application name. Additional reports are generated with names conforming to the rules dictated by the OUTPUT-FILE-MODE setting in the sqr.ini file. When the -KEEP or -NOLIS flags are used, the first intermediate print file (.spf file) is generated with a name of program.spf and additional reports are generated with names conforming to the rules dictated by the OUTPUT-FILE-MODE setting in the sqr.ini file..
Parameters
Parameter report_name TOC LAYOUT PRINTER-TYPE Specifies the name of the report. Specifies the name of the table of contents for this report. Specifies the name of the layout for this report. If no layout is specified, the default layout is used. Specifies the type of printer to be used for this report. If no printer type is specified, the default, LINEPRINTER, is used for this report. If no DECLARE-PRINTER is specified, DEFAULT-LP is used. Valid values for PRINTER-TYPE are: HT, HP, PD, PS, LP, HTML, HPLASERJET, POSTSCRIPT, and LINEPRINTER Description
Example
The following example illustrates the DECLARE-REPORT command
declare-layout customer_layout left-margin right-margin end-declare
96
Chapter 2
declare-layout summary_layout orientation=landscape end-declare declare-report customer_detail toc=detailed layout=customer_layout printer-type=postscript end-declare declare-report customer_summary layout=summary_layout printer-type=postscript end-declare . . . use-report customer_detail ...print customer detail... use-report customer_summary ...print customer summary...
See Also
DECLARE-TOC
Syntax
DECLARE-TOC toc_name [FOR-REPORTS=(report_name1[,report_namei]...)] [DOT-LEADER=YES|NO] [INDENTATION=position_count_num_lit] [BEFORE-TOC=procedure_name[(arg1[,argi]...)]] [AFTER-TOC=procedure_name[(arg1[,argi]...)]] [BEFORE-PAGE=procedure_name[(arg1[,argi]...)]] [AFTER-PAGE=procedure_name[(arg1[,argi]...)]] [ENTRY=procedure-name [(argi [,argi] ...)]] END-DECLARE
Description
Defines the table of contents and its attributes. Use DECLARE-TOC in the SETUP section.
97
Chapter 2
You can use DECLARE-TOC command to declare one or more table of contents for the application. A table of contents can be shared between reports.
Parameters
Parameter toc_name FOR-REPORTS DOT-LEADER INDENTATION BEFORE-TOC AFTER-TOC BEFORE-PAGE AFTER-PAGE ENTRY Description Specifies the name of the table of contents. Specifies one or more reports that uses this table of contents. Specifies whether a dot leader precedes the page number. The default setting is NO. Specifies the number of spaces by which each level is indented. The default setting is 4. Specifies a procedure to be executed before generating the table of contents. If no table of contents is generated, the procedure does not execute. Specifies a procedure to be executed after generating the table of contents. If no table of contents is generated, the procedure does not execute. Specifies a procedure to be executed at the start of every page. Specifies a procedure to be executed at the end of each page. Specifies a procedure that is executed to process each table of contents entry (instead of SQR doing it for you). When this procedure is invoked, the following SQR-reserved variables are populated with data about the TOC entry: #SQR-TOC-LEVEL contains the level. #SQR-TOC-TEXT contains the text. #SQR-TOC-PAGE contains the page number. These are global variables. If the procedure is local, you must precede it with an underscore (for example, #_sqr-toc-page). These three SQR-reserved variables are only valid within the scope of the ENTRY procedure. They can be referenced outside the scope, but their contents are undefined.
Example
The following example illustrates the DECLARE-TOC command
begin-setup declare-toc common for-reports=(all) dot-leader=yes indentation=2 end-declare end-setup . . . toc-entry level=1 text=$Chapter toc-entry level=2 text=$Heading . .
98
Chapter 2
See Also
DECLARE-VARIABLE
Syntax
DECLARE-VARIABLE [DEFAULT-NUMERIC={DECIMAL[(prec_lit)]|FLOAT|INTEGER}] [DECIMAL[(prec_lit)]num_var[(prec_lit)][num_var [(prec_lit)]]...] [FLOAT num_var[num_var]...] [DATE date_var[date_var]...] [INTEGER num_var[num_var]...] [TEXT string_var[string_var]...] END-DECLARE
Description
Enables the user to explicitly declare a variable type. You can set the default numeric type externally, using the -DNT command-line flag or the DEFAULT-NUMERIC setting in the Default-Settings section of the sqr.ini file. However, the setting in the DECLARE-VARIABLE command takes precedence over all other settings. If the command has not been used, then the -DNT command-line flag takes precedence over the setting in the sqr.ini file. In addition to FLOAT, INTEGER, or DECIMAL, you can set DEFAULT-NUMERIC in the sqr.ini file and -DNT command-line flag to V30. With V30, the program acts in the same manner as in pre-version 4.0 releases; that is, all variables are FLOAT. V30 is not a valid setting for the DEFAULT-NUMERIC setting in the DECLARE-VARIABLE command. The DECLARE-VARIABLE command enables the user to determine the type of variables to use. This command can only appear in the SETUP section or as the first statement of a local procedure. The placement of the command affects its scope. When used in the SETUP section, it affects all variables in the entire program. Alternately, when it is placed in a local procedure, its effect is limited to the scope of the procedure. If the command is in both places, the local declaration takes precedence over the SETUP declaration. In addition to declaring variables, this command enables the default numeric type to be specified using the DEFAULT-NUMERIC setting as FLOAT, INTEGER, or DECIMAL. When dealing with money or where more precision is required, use the DECIMAL qualifier. The DECLARE-VARIABLE command, the -DNT command-line flag, and the DEFAULT-NUMERIC setting in the sqr.ini file affect the way numeric literals are typed. If V30 is specified, then all numeric literals are FLOAT (just as in pre-version 4.0 releases); otherwise, the use or lack of a decimal point determines the type of the literal as either FLOAT or INTEGER, respectively. Finally, not specifying DECLARE-VARIABLE command, the -DNT command- line flag, and the DEFAULT-NUMERIC setting in the sqr.ini file is the same as specifying V30.
99
Chapter 2
Parameters
Parameter DEFAULT-NUMERIC Description Specifies the default type for numeric variables. Unless explicitly declared otherwise, a numeric variable assumes the variable type. This qualifier overrides any setting from the command-line flag -DNT or the DEFAULT- NUMERIC entry in the [Default-Settings] section of the sqr.ini file. If -DNT was not specified on the command line and the sqr.ini file entry has no DEFAULT-NUMERIC entry, then the default numeric type is FLOAT. Specifies that the numeric variables that follow are decimal variables with a precision specified with prec_lit. The precision can be assigned to the group of variables or to each individual variable. The precision is the total number of digits used to represent the number. This precision can range from 1 to 38. The default value is 16. The range of decimal numbers is from -9.9999999999999999999999999999999999999E4096 to +9.9999999999999999999999999999999999999E4096 Specifies that the numeric variables that follow are used as double precision floating point. The range and precision of these numbers are machine-dependent. Specifies that the date variables that follow can contain a date in the range of January1, 4713 BC to December 31, 9999 AD. Specifies that the numeric variables that follow are used as integers with a range of -2147483648 to +2147483647. Specifies that the string variables that follow are text variables.
DECIMAL
Example
The following example illustrates the DECLARE-VARIABLE command
begin-setup declare-variable default-numeric=float decimal #decimal(10) integer #counter date $date end-declare end-setup . . let $date = strtodate(Jan 01 2004,Mon DD YYYY) print $date (1,1) position (+2,1) let #counter = 0 while #counter < 10 let #decimal = sqrt(#counter) add 1 to counter print #decimal (+1,1) 9.999999999 end-while do sub1($date, day, 10)
100
Chapter 2
do sub2 . . begin-procedure sub1(:$dvar, $units, #uval) declare-variable date $dvar integer #uval end-declare let $dvar = dateadd($dvar, $units, #uval) print $dvar (+1,1) position (+2,1) end-procedure . . begin-procedure sub2 LOCAL declare-variable date $mydate end-declare let $mydate = dateadd($_date, year, 5) print $mydate (+1,1) position (+2,1) end-procedure . .
#DEFINE
Syntax
#DEFINE substitution_variable value
Description
Declares a value for a substitution variable within the body of the report (rather than using the ASK command). #DEFINE is useful for specifying constants such as column locations, printer fonts, or any number or string that is used in several locations in the program. When the value of the number or string must be changed, you need only change the #DEFINE command. All references to that variable change automatically, which makes modifying programs much simpler. If the ASK command is used to obtain the value of a substitution variable that has already been defined, ASK uses the previous value and the user is not prompted. This enables you to predefine some variables and not others. When the report runs, ASK requests values for only those variables that have not had a value assigned. You can use #DEFINE commands inside an include file. This is a method of gathering commonly used declarations into one place, and reusing them for more than one report. The value in the #DEFINE command can have embedded spaces and does not need to be enclosed within quotes. The entire string is used as is. The #DEFINE command cannot be broken across program lines.
101
Chapter 2
Parameters
Parameter substitution_variable Value Description The variable to be used as the substitution variable. The substitution variable is used to substitute any command, argument, or part of a SQL statement at compile time. The value to be substituted.
Example
This code example defines several constants:
#define #define #define #define #define #define #define #define page_width 8.5 page_depth 11 light LS^10027 bold LS^03112 col1 1 col2 27 col3 54 order_by state, county, city, co_name
This code example from a report uses the definitions from the preceding example:
begin-setup declare-printer contacts type=hp paper-size=({page_width}, {page_depth}) end-declare end-setup begin-heading 5 print Company Contacts (1,1) center print Sort: {order_by} (2,1) center (4,{col1}) print Company print Contact (4,{col2}) print Phone (4,{col3}) end-heading begin-procedure main begin-select company (1,{col1}) print {bold} (0,{col2}) ! Print contact in boldface. contact () () ! Back to lightface. print {light} phone (0,{col3}) ! Note: There must be enough next-listing ! space between col2 from customers ! and col3 for both order by {order_by} ! font changes and the end-select ! contact field.
102
Chapter 2
end-procedure
See Also
ASK
DISPLAY
Syntax
DISPLAY {any_lit|_var|_col} [[:$]edit_mask|NUMBER|MONEY|DATE][NOLINE]
Description
Displays the specified column, variable, or literal. The DISPLAY command can display data to a terminal. The data is displayed to the current location on the screen. If you want to display more than one field on the same line, use NOLINE on each display except the last. Dates can be contained in a date variable or column, or a string literal, column, or variable. When a date variable or column is displayed without an edit mask, the date appears in the following manner: For DATETIME columns and SQR DATE variables, SQR uses the format specified by the SQR_DB_DATE_FORMAT setting. If this has not been set, SQR uses the first database-dependent format as listed in the Default Database Formats table. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT setting. If this has not been set, SQR uses the format listed in the DATE Column Formats table. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_FORMAT setting. If this has not been set, SQR uses the format listed in the TIME Column Formats table. When displaying a date in a string literal, column, or variable using EDIT or DATE, the string uses the format specified by the SQR_DB_DATE_FORMAT setting, one of the database-dependent formats as listed in the Default Database Formats table, or the database-independent format SYYYYMMDD[HH24[MI[SS[NNNNNN]]]]. If you require more control over the display, use the SHOW command.
103
Chapter 2
Parameters
Parameter any_lit|_var|_col edit_mask NUMBER MONEY DATE Description The text, number, or date to be displayed. Causes the field to be edited before being displayed. For additional information regarding edit masks, see the PRINT command. Indicates that any_lit|_var|_col is to be formatted using the NUMBER-EDIT-MASK of the current locale. This option is not valid with date variables. Indicates that any_lit|_var|_col is to be formatted using the MONEY-EDIT-MASK of the current locale. This option is not valid with date variables. Indicates that any_lit|_var|_col is to be formatted using the DATE-EDIT-MASK of the current locale. This option is not valid with numeric variables. If DATE-EDIT-MASK has not been specified, the date is displayed using the default format for that database (see the Default Database Formats table). Suppresses the carriage return after the field is displayed.
NOLINE
Example
The following segments illustrate the various features of the DISPLAY command:
! ! Display a string using an edit mask ! display 123456789 xxx-xx-xxxx
104
Chapter 2
105
Chapter 2
See Also
The SHOW command for information about screen control. The LET command for information about copying, editing, or converting fields. The EDIT parameter of the PRINT command for a description of the edit masks. The ALTER-LOCALE command for a description of the arguments NUMBER-EDIT-MASK, MONEY-EDIT-MASK, and DATE-EDIT-MASK.
DIVIDE
Syntax
DIVIDE {src_num_lit|_var|_col} INTO dst_num_var [ON-ERROR={HIGH|ZERO}][ROUND=nn]
Description
Divides one number into another. The source field is divided into the destination field and the result is placed in the destination. The source is always first, the destination always second. When dealing with money-related values (dollars and cents), use decimal variables rather than float variables. Float variables are stored as double precision floating point numbers, and small inaccuracies can appear when dividing many numbers in succession. These inaccuracies can appear due to the way different hardware and software implementations represent floating point numbers.
Parameters
Parameter src_num_lit|_var|_col dst_num_var ON-ERROR Description Divided into the contents of dst_num_var. Contains the result after execution. Sets the result to the specified number when a division by zero is attempted. If ON-ERROR is omitted and a division by zero is attempted, SQR halts with an error message. Rounds the result to the specified number of digits to the right of the decimal point. For float variables, this value can be from 0 to 15. For decimal variables, this value can be from 0 to the precision of the variable. For integer variables, this argument is not appropriate.
ROUND
Example
The following example illustrates the DIVIDE command
divide divide divide 37.5 into #price ! #price / 37.5 &rate into #tot on-error=high #j into #subtot on-error=zero
Note. In the preceding example, High is the maximum value and zero is the lowest value.
See Also
106
Chapter 2
DO
Syntax
DO procedure_name[(arg1[, argi]...)]
Description
Invokes the specified procedure. When the procedure ends, processing continues with the command following the DO command. You can use arguments to send values to or receive values from a procedure. Arguments passed by a DO command to a procedure must match in number: Database text columns, string variables, and literals can be passed to procedure string or date arguments. Database numeric columns, numeric variables, and numeric literals can be passed to procedure numeric arguments. Numeric variables (DECIMAL, INTEGER, FLOAT) can be passed to procedure numeric arguments without regard to the argument type of the procedure. SQR automatically converts the numeric values upon entering and leaving the procedure as required. Date variables can be passed to procedure date or string arguments. When a field in a DO command receives a value back from a procedure (a colon indicates it is a back value, that is, a value that is being returned), it must be a string, numeric, or date variable, depending on the procedure argument; however, a date can be returned to a string variable and vice versa. When a date is passed to a string, the date is converted to a string according to the following rules: For DATETIME columns and SQR DATE variables, SQR uses the format specified by the SQR_DB_DATE_FORMAT setting. If this has not been set, SQR ues the first database-dependent format as listed in the Default Database Formats table. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT setting. If this has not been set, SQR uses the format listed in the DATE Column Formats table. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_FORMAT setting. If this has not been set, SQR uses the format as listed in the TIME Column Formats table.
Parameters
Parameter procedure_name arg1 [, argi ] Description Specifies the name of the procedure to be executed. Specifies the arguments to be passed to the procedure. Arguments can be any type of variable or constant value.
Example
The following example illustrates the DO command
do get_names do add_to_list ($name)
107
Chapter 2
See Also
The BEGIN-PROCEDURE command for information about passing arguments. The PRINT command for information about date and time formats.
#ELSE
Syntax
#ELSE
Description
Compiles the code following the #ELSE command when a preceding #IF, #IFDEF, or #IFNDEF command is FALSE. (#ELSE is a compiler directive that works with the #IF, #IFDEF, and #IFNDEF compiler directives.)
See Also
The #IF, #IFDEF, and #IFNDEF commands for a description of each compiler directive.
ELSE
Syntax
ELSE
Description
ELSE is an optional command in an IF command.
See Also
ENCODE
Syntax
ENCODE src_code_string_lit INTO dst_txt_var
Description
Assigns a nondisplay or display character to a string variable. The ENCODE command can define nondisplay characters or escape sequences sent to an output device. These characters or sequences can perform complex output device manipulations. The ENCODE command also displays characters not in the keyboard. If your keyboard does not have the Euro symbol, use the ENCODE feature to create a string variable for it. The encode characters can be included in a report at the appropriate location using a PRINT or PRINT-DIRECT command. Unicode (UCS-2) code points from <1> to <65535> can be defined in ENCODE command.
108
Chapter 2
Parameters
Parameter src_code_string_lit dst_txt_var Description Specifies a string of characters to be encoded and placed in dst_txt_var. Contains the result after execution.
Example
The following example illustrates the ENCODE command
encode <27>L11233 into $bold print $bold () code-printer=lp ! Code sequence to turn bold on.
See Also
The chr function described in the Miscellaneous Functions table under the LET command. PRINT, PRINT-DIRECT
Description
Completes a section or paragraph. The END-DECLARE command completes a paragraph started with:
DECLARE-CHART DECLARE-IMAGE DECLARE-LAYOUT DECLARE-PRINTER DECLARE-PROCEDURE DECLARE-REPORT DECLARE-VARIABLE
Example
The following example illustrates the BEGIN-FOOTING and END-FOOTING commands
109
Chapter 2
(1)
center
See Also
DECLARE-paragraph, BEGIN-section
#END-IF, #ENDIF
Syntax
#END-IF
Description
Ends an #IF, #IFDEF, or #IFNDEF command. (#END-IF is a compiler directive.) #ENDIF (without the dash) is a synonym for #END-IF.
Example
The following example illustrates the #END-IF compiler directive:
#ifdef debuga show DebugA: #j = = show Cust_num #end-if #j edit 9999.99 &cust_num
See Also
The #IF, #IFDEF, and #IFNDEF commands for a description of each compiler directive.
END-IF
Syntax
END-IF
Ends an IF command.
See Also
110
Chapter 2
Description
Completes the corresponding section or paragraph. Each END- command completes the corresponding BEGIN- command:
BEGIN-PROCEDURE BEGIN-PROGRAM BEGIN-SELECT BEGIN-SETUP BEGIN-SQL WHILE
Example
The following example illustrates the END-PROGRAM command
begin-program do main end-program
See Also
BEGIN-section, WHILE
EVALUATE
Syntax
EVALUATE {any_lit|_var|_col}
This command is equivalent to case/switch in C or Java. The general format of an EVALUATE command is the following:
EVALUATE {any_lit|_var|_col} WHEN comparison_operator {any_lit|_var|_col} SQR_Command... [BREAK] [WHEN comparison_operator {any_lit|_var|_col} SQR_Command... [BREAK]] [WHEN-OTHER SQR_Command... [BREAK]] END-EVALUATE
Description
Determines the value of a column, literal, or variable and takes action based on that value. The EVALUATE command is useful for branching to different commands depending on the value of a specified variable or column. EVALUATE commands can be nested.
111
Chapter 2
Evaluating a date variable or column with a string results in a date comparison (chronological, not a byte by byte comparison as is done for strings). The string must be in the proper format as follows: For DATETIME columns and SQR DATE variables in the format specified by the SQR_DB_DATE_FORMAT setting, SQR uses one of the database-dependent formats (see the Default Database Formats table), or the database-independent format SYYYYMMDD[HH24[MI[SS[NNNNNN]]]]. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT setting, or the format listed in the DATE Column Formats table. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_FORMAT setting, or the format as listed in the TIME Column Formats table.
Parameters
Parameter any_lit|_var|_col comparison_operator Description Specifies a text or numeric column; a text, numeric, or date variable; or a text or numeric literal to be used in the evaluation. In short, an evaluation argument. Any valid comparison operator. See the list of operators in the #IF command. . See Chapter 2, SQR Command Reference, #IF, page 124. WHEN Specifies the evaluation expression. The evaluation argument is compared with the argument, beginning from the first WHEN. If the expression is TRUE, SQR processes the commands after the WHEN. If the expression is FALSE, SQR processes the next WHEN expression. Each WHEN must be on its own line. If more than one WHEN expression appears directly before a set of commands, any one of them, if TRUE, causes the commands to execute. Causes an immediate exit of the EVALUATE command. Use BREAK at the end of a set of commands. Signifies the start of default commands to be processed if all other WHEN expressions are FALSE. WHEN-OTHER must appear after all other WHEN expressions.
BREAK WHEN-OTHER
Example
The following example illustrates the EVALUATE command
evaluate &code when = A move 1 to #j break when = B when = C move 2 to #j break when > D move 3 to #j when > H add 1 to #j when > W add 2 to #j break
112
Chapter 2
when-other if isnull (&code) do null_code else move 0 to #j ! Unknown code. end-if break end-evaluate
See Also
The syntax of this command generally follows that of the Sybase Transact-SQL EXECUTE command, with the exception of optional arguments and the INTO argument.
Description
Executes a stored procedure in Sybase or Microsoft SQL Server database. If the stored procedure specified in stored_procedure_name contains a SELECT query, the EXECUTE command must specify an INTO argument to process the values from the query. If no INTO argument is specified, then the values from the query are ignored. EXECUTE retrieves just the first row when the following instances are true: The DO procedure is not specified. The stored procedure, stored_procedure_name selects one or more rows. An INTO argument is specified. This is useful for queries returning a single row.
113
Chapter 2
Parameters
Parameter -XC Description (Sybase only) Specifies that the EXECUTE command shares the same connection as the DO=procedure it can invoke. This argument is required to share Sybase temporary tables. Declares an SQR procedure to execute if an error occurs. If ON-ERROR is omitted and an error occurs, SQR halts with an error message. For severe errors (for example, passing too few arguments) SQR halts, even if an error procedure is specified. You can specify arguments to be passed to the ON-ERROR procedure. Arguments can be any variable, column, or literal. Specifies an SQR procedure to execute for each row selected in the query. Processing continues until all rows have been retrieved. You can specify arguments to be passed to the procedure. Arguments can be any variable, column, or literal. Returns the procedure status in the specified numeric variable. The status is returned only after selected rows are retrieved. Names the stored procedure to execute. Names the parameter to pass to the stored procedure. Parameters can be passed with or without names. If used without names, they must be listed in the same sequence as defined in the stored procedure. Specifies the value passed to the stored procedure. It can be a string, numeric, or date variable, a previously selected column, a numeric literal, or a string literal. Indicates that the parameter receives a value from the stored procedure. The parameter must be a string, numeric, or date SQR variable. Output parameters receive their values only after rows selected have been retrieved. If you specify multiple output parameters, they must be in the same sequence as defined in the stored procedure. Indicates where to store rows that are retrieved from the stored procedures SELECT statement. The INTO argument contains the names of the columns with data types and lengths (if needed). You must specify the columns in the same sequence and match the data type used in the stored procedures SELECT statement. If the stored procedure contains more than one SELECT query, only the first query is described with the INTO argument. Rows from subsequent queries are ignored. Causes the query to recompile each time it is executed rather than using the plan stored with the procedure. Normally, this is not required or recommended.
ON-ERROR
DO
any_lit|_var|_col OUT[PUT]
INTO
WITH RECOMPILE
Example
The following code example invokes the stored procedure get_total with two parameters: a string literal and a string variable. The result from the stored procedure is stored in the variable #total.
execute get_total S. Q. Reporter $State #Total Output
The following code example invokes the stored procedure get_products with two parameters. The stored procedure selects data into five column variables. The SQR procedure print_products is called for each row retrieved. The return status from the stored procedure is placed in the variable #proc_return_status.
execute do=print_products
114
Chapter 2
@#proc_return_status= get_products @max=#maximum @prodcode=&code, INTO &prod_code int, &description char (45), &discount float, &restock char, &expire_date datetime begin-procedure print_products print &prod_code (+1,1) (+5,45) print &description print &discount (+5) edit 99.99 print &restock (+5) match Y 0 5 Yes N 0 5 No (+5,) edit Month dd, yyyy print &expire_date end-procedure
EXIT-SELECT
Syntax
EXIT-SELECT
Description
Exits a SELECT paragraph immediately. EXIT-SELECT causes SQR to jump to the command immediately following the END-SELECT command. Use EXIT-SELECT when you need to end a query before all rows have been retrieved.
Example
The following example illustrates the EXIT-SELECT command
begin-select cust_num, co_name, contact, city, state, zip, employees add &employees to #tot_emps if #tot_emps >= 5000 exit-select ! Have reached required total emps. end-if do print_company from customers order by employees desc end-select
See Also
BEGIN-SELECT
EXTRACT
Syntax
EXTRACT {dst_txt_var|date_var} FROM {{src_txt_lit|_var|_col}|{src_date_var|_col}}
115
Chapter 2
{start_num_lit|_var}{length_num_lit|_var}
Description
Copies a portion of a string into a string variable. You must specify the starting location of the string as an offset from the beginning of the string and its length. An offset of zero (0) begins at the leftmost character; an offset of 1 begins one character beyond that, and so on. If the source is a date variable or column, it is converted to a string before the extraction according to the following rules: For DATETIME columns and SQR DATE variables, SQR specifies the SQR_DB_DATE_FORMAT setting. If this has not been set, SQR uses the first database-dependent format as listed in the Default Database Formats table. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT setting. If this has not been set, SQR uses the format listed in the DATE Column Formats table. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_FORMAT setting. If this has not been set, SQR uses the format as listed in the TIME Column Formats table. If the destination is a date variable, the string extracted from the source must be in one of the following formats: The format specified by the SQR_DB_DATE_FORMAT setting. One of the database-dependent formats (see the Default Database Formats table). The database-independent format SYYYYMMDD[HH24[MI[SS[NNNNNN]]]].
Parameters
Parameter dst_txt_var | date_var {src_txt_lit|_var|_col}| {src_date_var|_col} start_num_lit|_var length_num_lit|_var Description Specifies a text or date variable into which the extracted string is placed. Specifies a text or date variable, column, or literal from which the string is to be extracted. Specifies starting location of the string to be extracted. Specifies length of the string to be extracted.
Example
The following example illustrates the EXTRACT command
extract extract $state from $record 45 2 $foo from "SQR Rocks" 0 4 ! $foo=SQR
code from &phone 0 3 extract $zip_four from &zip 5 4 extract $rec from $tape_block #loc
#rec_len
Note. PeopleSoft recommends that you do not use the EXTRACT command when processing strings.
116
Chapter 2
See Also
The substr function described in Miscellaneous Functions table under the LET command. FIND The PRINT command for information about default date and time formats
FIND
Syntax
FIND {{obj_txt_lit|_var|_col}|{date_var|_col}} IN {{src_txt_var|_col}|{date_var|_col}} {start_int_lit|_var} dst_location_int_var
Description
Determines the location of a character sequence within a string. FIND searches the specified string for a character sequence and, if the string is found, returns its location as an offset from the beginning of the specified string. If the sequence is not found, FIND returns -1 in dst_location_int_var. You must specify an offset from which to begin the search and supply a numeric variable for the return of the location. If the source or search object is a date variable or column, it is converted to a string before the search according to the following rules: For DATETIME columns and SQR DATE variables, SQR uses the format specified by the SQR_DB_DATE_FORMAT setting. If this has not been set, SQR uses the first database-dependent format as listed in the Default Database Formats table. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT setting is used. If this has not been set, SQR uses the format listed in the DATE Column Formats table. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_FORMAT setting. If this has not been set, SQR uses the format as listed in the TIME Column Formats table.
Parameters
Parameter {obj_txt_lit|_var|_col}|{date_ var|_col} {src_txt_var|_col}| {date_var|_col} start_int_lit|_var dst_location_int_var Description Specifies a text variable, column, or literal that is to be sought in src_txt_var|_col. Specifies a text variable or column to be searched. Specifies the starting location of the search. Specifies the returned starting location of the leftmost character of the matching text in {src_txt_var|_col| date_var|_col }.
117
Chapter 2
Example
The following example illustrates the FIND command
find aw.2 in &code5 0 #loc find , in &name 0 #comma_loc if #comma_loc = -1 ...comma not found...
See Also
The instr function described in the Miscellaneous Functions table under the LET command. EXTRACT The PRINT command for information about default date and time formats.
GET
Syntax
GET dst_any_var...FROM src_array_name(element) [field[(occurs)]]...
Description
Retrieves data from an array and places it into a date, string, or numeric variable.
Parameters
Parameter dst_any_var Description Date, string, or numeric variables (not database columns) can be destination variables. Numeric variables (decimal, float, integer) are copied from number fields. String variables are copied from char, text, or date fields. Date variables are copied from char, text, or date fields. When a date field is copied to a string variable, SQR converts the date to a string in the format specified by the SQR_DB_DATE_FORMAT setting. If this has not been set, SQR uses the first database-dependent format listed in the Default Database Formats table. If the destination is a date variable, the string extracted from the source must be in the format specified by the SQR_DB_DATE_FORMAT setting, or one of the database-dependent formats (see the Default Database Formats table), or the databaseindependent format SYYYYMMDD[HH24[MI[SS[NNNNNN]]]]. If the arrays field names are listed, SQR takes the values from the fields and occurrences specified. If the arrays field names are not listed, the values are taken from consecutively defined fields in the array. Array element and field occurrence numbers can be numeric literals (such as 123) or numeric variables (such as #j). If no field occurrence is stated, occurrence zero is used.
src_array_name(element)
field[(occurs)]
Example
The following code example copies $name, $start_date, and #salary from the first three fields in the #jth element of the emps array:
get $name $start_date #salary from emps(#j)
118
Chapter 2
The following code example copies #city_tot and #county_tot from the fields cities and counties in the #jth element of the states array:
get #city_tot #county_tot from states(#j) cities counties
The following code example copies $code from the #jth occurrence of the code field in the #nth element of the codes array:
get $code from codes(#n) code(#j)
See Also
The PUT command for information about moving data into an array.
GET-COLOR
Syntax
GET-COLOR [PRINT-TEXT-FOREGROUND=({color_name_var |{rgb})] [PRINT-TEXT-BACKGROUND=({color_name_var |{rgb})]
Description
Retrieves the current colors. The GET-COLOR command is allowed wherever the PRINT command is allowed. If the requested color settings do not map to a defined name, the name is returned as RGBredgreenblue, where each component is a three digit numberfor example, RGB127133033. You can use this format wherever you use a color name. The color name none is returned if no color is associated with the specified area.
119
Chapter 2
Parameters
Parameter PRINT-TEXTFOREGROUND PRINT-TEXTBACKGROUND {color_name_var} Description Defines the color in which the text prints. Defines the color to print as a background behind the text. A color_name is composed of alphanumeric characters (A-Z, 0-9), the underscore (_) character, and the hyphen (-) character. The name must start with an alphabetical (A-Z) character and is not case-sensitive. The name none is reserved and cannot be assigned a value. A name in the format (RGBredgreenblue) cannot be assigned a value. The name default is reserved and can be assigned a value. Default is used during execution when a referenced color is not defined in the runtime environment. red_lit | _var | _col, green_lit | _var | _col, blue_lit | _var | _col where each component is a value in the range of 000 to 255. In the BEGIN-SETUP section, only literal values are allowed. The default colors implicitly installed with SQR include: black=(0,0,0) white=(255,255,255) gray=(128,128,128) silver=(192,192,192) red=(255,0,0) green=(0,255,0) blue=(0,0,255) yellow=(255,255,0) purple=(128,0,128) olive=(128,128,0) navy=(0,0,128) aqua=(0,255,255) lime=(0,128,0) maroon=(128,0,0) teal=(0,128,128) fuchsia=(255,0,255)
{rgb}
Example
The following example illustrates the GET-COLOR command
begin-setup declare-color-map light_blue = (193, 222, 229) end-declare end-setup begin-program alter-color-map name = light_blue value = (193, 233, 230) print Yellow Submarine () foreground = (yellow) background = (light_blue) get-color print-text-foreground = ($print-foreground)
120
Chapter 2
set-color print-text-foreground = (purple) print Barney (+1,1) set-color print-text-foreground = ($print-foreground) end-program
See Also
GOTO
Syntax
GOTO label
Description
Skips to the specified label. Labels must end with a colon (:) and can appear anywhere within the same section or paragraph as the GOTO command.
Parameters
Parameter label Description Specifies a label within the same section or paragraph.
Example
The following example illustrates the GOTO command
begin-select price if &price < #old_price goto next end-if print &price (2,13,0) edit 999,999.99 ... next: add 1 to #count from products end-select
121
Chapter 2
GRAPHIC ({line_int_lit|_var},{column_int_lit|_var}, {length_int_lit|_var}) HORZ-LINE [rule_width_int_lit|_var] GRAPHIC ({line_int_lit|_var},{column_int_lit|_var}, {length_int_lit|_var}) VERT-LINE [rule_width_int_lit|_var]
Description
Draws a box or line. After GRAPHIC commands execute, SQR changes the current print location to the starting location of the graphic. This is different from the way the PRINT command works. The GRAPHIC command has the following variations: BOX HORZ-LINE VERT-LINE The following sections describe the individual GRAPHIC commands:
122
Chapter 2
Parameters
Parameter BOX width and depth Description BOX draws a box of any size at any location on the page. Boxes can be drawn with any size rule and can be shaded or left empty. The width is the horizontal size in character columns; depth is the vertical size in lines. The top left corner of the box is drawn at the line and column specified. The bottom right corner is calculated using the width and depth. You can specify relative placement with (+), (-), or numeric variables, as with regular print positions. The default rule width is 2 decipoints (there are 720 decipoints per inch). The top horizontal line is drawn just below the base of the line above the starting point. The bottom horizontal line is drawn just below the base of the ending line. Therefore, a one-line deep box surrounds a single line. A number between 1 and 100, specifying the percentage of shading to apply. 1 is very light, and 100 is black. If no shading is specified, the box is blank. Specify a rule-width of zero, if a border is not desired. HORZ-LINE draws a horizontal line from the location specified, for the length specified. Horizontal lines are drawn just below the base. The default rule width is 2 decipoints. VERT-LINE draws a vertical line from the location specified for the length (in lines) specified. Vertical lines are drawn just below the base line of the line position specified to just below the base line of the line reached by the length specified. To draw a vertical line next to a word printed on line 27, position the vertical line to begin on line 26, for a length of 1 line. The default rule width is 2 decipoints.
rule_width
shading
rule_width
Example
The following code example shows the GRAPHIC BOX command:
graphic graphic box graphic graphic (1,1,66) box 58 20 (30,25,10) box 10 (1,1,66) box 5 0 8 (50,8,30) box 1 ! Draw box around page ! Draw a 10-characters-wide-by-10- characters-long ! Draw 5 line shaded box (without border) ! Draw box around 1 line
123
Chapter 2
See Also
The ALTER-PRINTER and DECLARE-PRINTER commands for information about setting and changing the FONT, FONT-TYPE, POINT-SIZE, and PITCH.
#IF
Syntax
#IF {txt_lit|num_lit}comparison_operator {txt_lit|num_lit}
Description
Indicates that the commands following are to be compiled when the expression is TRUE. (#IF is a compiler directive.) SQR has five compiler directives that enable different pieces of SQR code to be compiled, depending on the existence or value of substitution variables (not program variables, such as string, numeric, or date). Substitution variables defined automatically for each -DEBUGxxx letter can also be used with the #IF, #IFDEF, and #IFNDEF directives. They can turn entire sections of an SQR program on or off from the command line, depending on the -DEBUGxxx flag. You can nest #IF, #IFDEF, or #IFNDEF directives to a maximum of 10 levels. The #IF, #IFDEF, or #IFNDEF directives cannot be broken across program lines. The following table lists the compiler directives.
Directive #IF Example #IF {option}=A Description Compiles the commands following the #IF directive if the substitution variable option is equal to A. The test is not case-sensitive. Only one simple expression is allowed per #IF command. Compiles the commands following the #ELSE directive when the #IF expression is FALSE. Ends the #IF directive. #ENDIF can also be typed #END-IF (with a hyphen).
#ELSE
#ELSE
#ENDIF
#ENDIF
124
Chapter 2
Directive #IFDEF
Description Compiles the commands following the #IFDEF directive if the substitution variable option is defined. Compiles the command following the #IFNDEF directive if the substitution variable option is not defined.
#IFNDEF
#IFNDEF option
Parameters
Parameter txt_lit | num_lit comparison_operator Any text or numeric literal. Any of the comparison operators as follows: =Equal !=Not Equal <>Not Equal <Less than >Greater than <=Less than or equal >=Greater than or equal Description
Example
The following example illustrates the #IF compiler directive:
begin-setup ask type Use Male, Female or Both (M,F,B) end-setup begin-procedure Main #if {type} = M ...code for M here #else #if {type} = F ...code for F here #else #if {type} = B ...code for B here #else show M, F or B not selected. Report not created. stop #endif ! for B #endif ! for F ! for M #endif #ifdef debug
125
Chapter 2
Cust_num =
&cust_num
edit
099999
See Also
The #DEBUG command for information about the -DEBUG command-line flag.
IF
Syntax
IF logical_expression
Description
Executes commands depending on the value of a condition. The expression is evaluated as a logical TRUE or FALSE. A value or expression that evaluates to nonzero is TRUE. Each IF command must have a matching END-IF command. IF commands can be nested. Comparing a date variable or column with a string, results in a date comparison (chronological, not a byte by byte comparison as is done for strings). The string must be in the proper format as follows: For DATETIME columns and SQR DATE variables, SQR uses the format specified by the SQR_DB_DATE_FORMAT setting, one of the database-dependent formats (see the Default Database Formats table), or the database-independent format SYYYYMMDD[HH24[MI[SS[NNNNNN]]]]. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT setting, or the format listed in the Date Column Formats table. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_FORMAT setting, or the format as listed in Time Column Formats table.
Parameters
Parameter logical_expression Description Any valid logical expression. See the LET command for a description of logical expressions.
126
Chapter 2
Example
The following example illustrates the IF command
if &price > &old_price and instr(&code, M, 1) > 0 add 1 to #price_count if #price_count > 50 show More than 50 prices found. noline input $x Continue? (Y/N) if upper($x) = N stop end-if end-if else add 1 to #old_price_count end-if if #rows ! Will be TRUE if #rows is non-zero. do print-it end-if if $date1 > Apr 21 2004 23:59 do past_due end-if
See Also
#IFDEF
Syntax
#IFDEF substitution_variable
Description
Indicates that the following commands are to be compiled when the substitution variable has been declared by an ASK or #DEFINE command, or by the -DEBUG flag on the SQR command line. (#IFDEF is a compiler directive.)
Parameters
Parameter substitution_variable Description Is the variable to be used as the substitution variable.
See Also
#IFNDEF
Syntax
#IFNDEF substitution_variable
127
Chapter 2
Description
Indicates that the following commands are to be compiled when the substitution variable has not been declared by an ASK or #DEFINE command, or by the -DEBUG flag on the SQR command line. (#IFNDEF is a compiler directive.)
Parameters
Parameter substitution_variable Description Is the variable to be used as the substitution variable.
See Also
#INCLUDE
Syntax
#INCLUDE filename_lit
Description
Includes an external source file into the SQR report specification. You may want to keep commonly used routines in a single file and reference or include that file in programs that use the routine. For example, you might have a set of #DEFINE commands for different printers to control initialization, font changes, and page size declarations. You can reference the appropriate include file depending on which printer you want to use. Include files can be nested up to four levels. Variable substitution scanning takes place before the #INCLUDE command is processed. This enables you to substitute all or part of the include file name at runtime, adding flexibility to controlling which file is included for the run.
Parameters
Parameter filename_lit Description A file name that is valid for the platform on which the application is to be compiled.
Example
The following example illustrates the #INCLUDE command
#include gethours.dat #include XYZheader.dat #include printer{num}.dat ! ! ! ! ! ! ! ! ! ! ! Common procedure. Common report heading for XYZ Company. Include printer definitions for printer {num}, which is passed on the command line: SQR REP1A SAM/JOE 18 where 18 is the arbitrary number assigned your printer definition file, printer18.dat. The report would contain the command: ASK num
128
Chapter 2
INPUT
Syntax
INPUT input_var[MAXLEN=nn][prompt] [TYPE={CHAR|TEXT|NUMBER|INTEGER|DATE}] [STATUS=num_var][NOPROMPT][BATCH-MODE] [FORMAT={txt_lit|_var|_col}]
Description
Accepts data entered by the user at a terminal. Use MAXLEN to prevent the user from entering data that is too long. If an INSERT or UPDATE command references a variable whose length is greater than the length defined in the database, the SQL is rejected and SQR halts. If the maximum length is exceeded, the terminal beeps (on some systems, this may cause the screen to flash instead). If prompt is omitted, SQR uses the default prompt, Enter [$|#]var:. In either case, a colon (:) and two spaces are added to the prompt. Specifying TYPE causes data type checking to occur. If the string entered is not the type specified, the terminal beeps and an error message is displayed. The INPUT command is then re-executed. If TYPE=DATE is specified, then input_var can be a date or text variable; however, TYPE=DATE is optional if input_var is a date variable. If a numeric variable is used, it is validated as a numeric variable. The types CHAR, TEXT, and DATE are invalid types. The data types supported are described in the following table:
Data Type CHAR, TEXT NUMBER Description Any character. This is the default datatype. A floating point number in the format [+|-]9999.999[E [+|- ]99] An integer in the format [+|-]99999 A date in one of the following formats: MM/DD/YYYY [BC|AD] [HH:MI[:SS[.NNNNNN]] [AM|PM]] MM-DD-YYYY [BC|AD] [HH:MI[:SS[.NNNNNN]] [AM|PM]] MM.DD.YYYY [BC|AD] [HH:MI[:SS[.NNNNNN]] [AM|PM]] SYYYYMMDD[HH24[MI[SS[NNNNNN]]]]
INTEGER DATE
129
Chapter 2
Specifying STATUS causes the INPUT command to complete regardless of what the user enters. No error message is displayed. A nonzero error code is stored in the indicated numeric variable if the length or datatype entered is incorrect. The following table lists the values of the INPUT commands STATUS argument:
Status Value 0 1 2 Successful. Bad type (did not match the datatype of TYPE). Too long (longer than MAXLEN or the input for an INTEGER variable is < -2147483648 or > +2147483647). No arguments remain on the command line. The command was ignored. Indicates
By using NOPROMPT and STATUS with the SHOW command, you can write a sophisticated data entry routine. FORMAT can only be used with dates. It can be a date edit mask or the keyword DATE. Use the keyword DATE if the date must be in the format as specified with INPUT-DATE-EDIT-MASK setting for the current locale. If FORMAT has not been set, use a database-independent format for the data as listed in the datatypes table.
Parameters
Parameter input_var MAXLEN prompt TYPE STATUS NOPROMPT BATCH-MODE FORMAT Description Specifies a text, numeric, or date variable for the input data. Specifies the maximum length for the data. Specifies the prompt displayed to the user. Specifies the datatype required for the input. Specifies a numeric variable for a return status code. Prevents the prompt from being displayed before the INPUT command is processed. If BATCH-MODE is specified and no more arguments are in the command line, a value of 3 is returned in the STATUS variable and the user is not prompted for input. Specifies the format for entering a date. The Date Edit Format Codes table lists date edit format codes.
Example
The following example shows several INPUT commands:
130
Chapter 2
$state maxlen=2 Please enter state abbreviation #age Enter lower age boundary type=integer $start_date Enter starting date for report type=date $date_in format=Mon dd yyyy $date format=date
See Also
ALTER-LOCALE The INPUT-DATE-EDIT-MASK setting in the chapter Using the PSSQR.INI File and the PSSQR Command Line.
LAST-PAGE
Syntax
LAST-PAGE position [pre_txt_lit[post_txt_lit]]
Description
Places the last page number on each page, as in page n of m. The text strings specified in pre_txt_lit and post_txt_lit are printed immediately before and after the number. Using LAST-PAGE causes SQR and SQRT to delay printing until the last page has been processed so that the number of the last page is known.
131
Chapter 2
Parameters
Parameter position pre_txt_lit post_txt_lit Description Specifies the position for printing the last page number. See the POSITION command for a description of the position parameter. Specifies a text string to be printed before the last page number. Specifies a text string to be printed after the last page number.
Example
The following example illustrates the LAST-PAGE command
begin-footing 1 page-number last-page end-footing (1,37) Page () of . ! Will appear as ! "Page 12 of 25."
See Also
LET
Syntax
LET dst_var=expression
Description
Assigns the value of an expression to a string, numeric, or date variable. Valid expressions are formed as a combination of operands, operators, and functions. String, numeric, date, and array field operands can be used in an expression and embedded functions. SQR supports a standardized set of mathematical operators and logical comparison operators working within a carefully defined set of precedence rules. SQR also provides a rich set of mathematical, string, date, and file manipulation functions along with a number of special purpose utility functions. All combined, the SQR expression provides a powerful tool that can be tailored to suit any information processing need. The following detail outlines the specific behavior of each expression component: (1) the operand, (2) the operator, and (3) the function.
Parameters
Parameter dst_var expression Description A string, numeric, or date variable or array field to which the result of the expression is assigned. The expression to evaluate.
132
Chapter 2
Operands
Operands form the backbone of an SQR expression. Operands do not have to be the same type. You can combine string, numeric, and array field operands to form a valid expression. SQR performs a sequence of automatic operand conversions as it evaluates expressions that contain dissimilar operand types. As the expression is evaluated, operands of lower precision are converted to match the operand of higher precision. Consider the following code example:
let #answer = #float * #decimal / #integer
Because the multiply and divide operators are equal in precedence, the expression is evaluated as (#float * #decimal) / #integer. Working from the inside out, the #float variable is converted to a decimal type where a multiply is performed yielding the simplified expression, (#decimal)/#integer. SQR now converts the #integer operand to a decimal type before performing the final divide. When finished with the expression evaluation, SQR converts the result to match the type of the #answer variable. Converting operands of lower precision to operands of higher precision preserves the number of significant digits. The number of significant digits is not lost when an integer is converted to float or decimal. In a similar manner, the number of significant digits is preserved when floating point operands are converted to the decimal type. The number of significant digits is only sacrificed when the final result is converted to match the type of the #answer variable and this variable is less precise than the highest of the operands being evaluated. In the example, precision is not lost if the #answer is declared as a decimal type. SQR considers integer variables as the lowest in the precision hierarchy, followed by float and then decimal. Here are a few simple expression examples:
let #discount = round (&price * #rate / 100, 2) let $name = $first_name || || $last_name let customer.total (#customer_id) = customer.total (#customer_id) + #invoice_total if not range(upper($code), A, G) ...processing when out of range... let store.total (#store_id, #qtr) = store.total (#store_id, #qtr) + #invoice_total let $date1 = strtodate (Apr 10 2004, MON DD YYYY)
Operators
Operators of the same precedence are processed in the sequence in which they appear in the expression, from left to right. Use parentheses to override the normal precedence rules. All numeric types (decimal, float, integer) are supported for all operators. This table lists operators in descending order of precedence (operators listed in the same row within the table have the same precedence):
Operator || Explanation Concatenate two strings or dates
133
Chapter 2
Operator +, ^ *, /, %
Explanation Sign prefix (positive or negative) Exponent Multiply, divide, remainder: a % b = mod(a,b) for integers Plus, minus Note. SQR distinguishes between a sign prefix and arithmetic operation by the context of the expression.
+, -
Comparison operators: greater than, less than, greater or equal to, less than or equal to, not equal (!= or <>), equal Logical NOT Logical AND Logical OR, XOR (exclusive OR)
Functions
This section lists numeric, file-related, and miscellaneous functions. The functions are listed in alphabetical order. Function arguments are enclosed in parentheses and can be nested. Arguments referenced as x, y, or z indicate the first, second, or third argument of a function. Otherwise, functions take a single argument or no arguments. All arguments are evaluated before a function is evaluated. Not all functions support all numeric types (decimal, float, integer). Certain functions do not support the decimal type directly, but convert input decimal operands to the float type before the function is evaluated. The following table annotates the functions that directly support the decimal type and the ones that do not. Use parentheses to override the normal precedence rules. This table describes numeric functions:
134
Chapter 2
Function
abs
Description Returns the absolute value of num_value. This function returns a value of the same type as num_value. Syntax:
dst_var = abs(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. dst_var = decimal, float, or integer variable. Example:
let #dabsvar = abs(#dvar)
acos
Returns the arccosine of num_value in the range of 0 to p radians. The value of num_value must be between -1 and 1. This function returns a float value. Syntax:
dst_var = acos(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #facosvar = acos(#fvar)
asin
Returns the arcsine of num_value in the range of -p/2 to p/2 radians. The value of num_value must be between -1 and 1. This function returns a float value. Syntax:
dst_var = asin(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #fasinvar = asin(#fvar)
135
Chapter 2
Function
atan
Description Returns the arctangent of num_value in the range of -p/2 to p/2 radians. The value of num_value must be between -1 and 1. This function returns a float value. Syntax:
dst_var = atan(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #fatanvar = atan(#fvar)
ceil
Returns a value representing the smallest integer that is greater than or equal to num_value. This function returns a value of the same type as num_value. Syntax:
dst_var = ceil(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. dst_var = decimal, float, or integer variable. Example:
let #fceilvar = ceil(#fvar)
cos
Returns the cosine of num_value. This function returns a float value. Syntax:
dst_var = cos(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #fcosvar = cos(#fvar)
136
Chapter 2
Function
cosh
Description Returns the hyperbolic cosine of num_value. This function returns a float value. Syntax:
dst_var = cosh(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #fcoshvar = cosh(#fvar)
deg
Returns a value expressed in degrees of num_value which is expressed in radians. This function returns a float value. Syntax:
dst_var = deg(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #fdegvar = deg(#fvar)
e10
Returns the value of 10 raised to num_value. This function returns a float value. Syntax:
dst_var = e10(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #fe10var = e10(#fvar)
137
Chapter 2
Function
exp
Description Returns the value of e raised to num_value. This function returns a float value. Syntax:
dst_var = exp(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #fexpvar = exp(#fvar)
floor
Returns a value representing the largest integer that is less than or equal to num_value. This function returns a value of the same type as num_value. Syntax:
dst_var = floor(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. dst_var = decimal, float, or integer variable. Example:
let #ffloorvar = floor(#fvar)
log
Returns the natural logarithm of num_value. This function returns a float value. Syntax:
dst_var = log(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #flogvar = log(#fvar)
138
Chapter 2
Function
log10
Description Returns the base-10 logarithm of num_value. This function returns a float value. Syntax:
dst_var = log10(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #flog10var = log10(#fvar)
mod
Returns the fractional remainder, f, of x_value/ y_value such that x_value = i * y_value + f, where i is an integer, f has the same sign as x_value, and the absolute value of f is less than the absolute value of y_value. The arguments are promoted to the type of the greatest precision and the function returns a value of that type. Syntax:
dst_var = mod(x_value, y_value)
x_value = decimal, float, or integer literal, column, variable, or expression. y_value = decimal, float, or integer literal, column, variable, or expression. dst_var = decimal, float, or integer variable. Example:
let #fmodvar = mod(#fxvar, #fyvar)
power
Returns the value of x_value raised to the power of y_value. This function returns a float value. Syntax:
dst_var = power(x_value, y_value)
x_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. y_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #fpowervar = power(#fxvar, #fyvar)
139
Chapter 2
Function
rad
Description Returns a value expressed in radians of num_value which is expressed in degrees. This function returns a float value. Syntax:
dst_var = rad(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. place_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #fradvar = rad(#fvar)
round
Returns a value that is num_value rounded to place_value digits after the decimal separator. This function returns a value of the same type as num_value. Syntax:
dst_var = round(num_value, place_value )
num_value = decimal, float, or integer literal, column, variable, or expression. place_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #frndvar = round(#fvar, #fplace) (#x, #y)
140
Chapter 2
Function
sign
Description Returns a -1, 0, or +1 depending on the sign of num_value. This function returns a float value. Syntax:
dst_var = sign(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. dst_var = decimal, float, or integer variable. Example:
let #fsignvar = sign(#fvar)
sin
Returns the sine of num_value. This function returns a float value. Syntax:
dst_var = sin(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #fsinvar = sin(#fvar)
sinh
Returns the hyperbolic sine of num_value. This function returns a float value. Syntax:
dst_var = sinh(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #fsinhvar = sinh(#fvar)
141
Chapter 2
Function
sqrt
Description Returns the square root of num_value. This function returns a float value. Syntax:
dst_var = sqrt(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #fsqrtvar = sqrt(#fvar)
tan
Returns the tangent of num_value. This function returns a float value. Syntax:
dst_var = tan(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #ftanvar = tan(#fvar)
142
Chapter 2
Function
tanh
Description Returns the hyperbolic tangent of num_value. This function returns a float value. Syntax:
dst_var = tanh(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #ftanhvar = tanh(#fvar)
trunc
Returns a value that is num_value truncated to place_value digits after the decimal separator. This function returns a value of the same type as num_value. Syntax:
dst_var = trunc(num_value, place_value )
num_value = decimal, float, or integer literal, column, variable, or expression. place_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = decimal, float, or integer variable. Example:
let #ftruncvar = trunc(#fvar, #fplace)
The transcendental functions sin, cos, tan, sinh, cosh, and tanh take their arguments in radians. The functions asin, acos, and atan return radian values. To convert from radians to degrees or degrees to radians, use the rad or deg functions as follows:
let #x = sin(rad(45)) let #y = deg(asin(#x)) ! Sine of 45 degrees. ! Convert back to degrees.
If arguments or intermediate results passed to a numeric function are invalid for that function, SQR halts with an error message. For example, passing a negative number to the sqrt function causes an error. Use the cond function described in the Miscellaneous Functions table to prevent division by zero or other invalid function or operator argument values.
143
Chapter 2
The following table lists file-related functions. These functions return zero (0) when successful; otherwise, they return the system error code.
Function delete Description Deletes the file filename. The function returns either a zero (0) to indicate success or the value returned from the operating system to indicate an error. Syntax:
stat_var = delete(filename)
filename = text literal, column, variable, or expression. stat_var = decimal, float, or integer variable. Example:
let #fstatus = delete($filename)
exists
Determines if the file filename exists. The function returns either a zero (0) to indicate success or the value returned from the operating system to indicate an error. Syntax:
stat_var = exists(filename)
filename = text literal, column, variable, or expression. stat_var = decimal, float, or integer variable. Example:
let #fstatus = exists($filename)
rename
Renames old_filename to new_filename. The function returns either a zero (0) to indicate success or the value returned from the operating system to indicate an error. Syntax:
stat_var = rename(old_filename, new_filename)
old_filename = text literal, column, variable, or expression. new_filename = text literal, column, variable, or expression. stat_var = decimal, float, or integer variable. Example:
let #fstatus = rename($old_filename, $new_ filename)
The following table lists miscellaneous functions. These functions return a string value unless otherwise indicated. In these functions where a string argument is expected and a date variable, column, or expression is entered, SQR converts the date to a string according to the following rules:
144
Chapter 2
For DATETIME columns and SQR DATE variables, SQR uses the format specified by the SQR_DB_DATE_FORMAT setting. If this has not been set, SQR uses the first database-dependent format as listed in the Default Database Formats table. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT setting. If this has not been set, SQR uses the format listed in the DATE Column Formats table. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_FORMAT setting. If this has not been set, SQR uses the format as listed in the TIME Column Formats table. Except where noted in an individual function, if a string variable, column, or expression is entered where a date argument is expected, the string must be in the format specified by the SQR_DB_DATE_FORMAT setting, one of the database-dependent formats listed in the Default Database Formats table, or the database-independent format SYYYYMMDD[HH24[MI[SS[NNNNNN]]]].
Function array Explanation Returns a pointer to the starting address of the specified array field. The value returned from this function can only be used by a user-defined function. See the routine printarray in the file UFUNC.C for complete instructions on how to use this function. Syntax:
array_var = array(array_name, field_name)
array_name = text literal, column, variable, or expression field_name = text literal, column, variable, or expression array_var = text variable Example:
let #fstatus = printarray(array(products, name), 10, 2, c)
ascii
Returns the numeric value for the first character in str_value. This function returns a float value. Syntax:
ascii_var = ascii(str_value)
str_value = date or text literal, column, variable, or expression ascii_var = decimal, float, or integer variable Example:
let #fascii = ascii($filename)
145
Chapter 2
Function asciic
Explanation Returns the numeric value for the first character (rather than byte) of the specified string. Syntax:
ascii_var = asciic(str_value)
str_value = date or text literal, column, variable, or expression ascii_var = decimal, float, or integer variable Example:
let #fascii = asciic($filename)
chr
Returns a string that is composed of a character with the numeric value of num_value. Syntax:
dst_var = chr(num_value)
num_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = text variable. Example:
let $svar = chr(#num)
cond
Returns y_value if the x_value is nonzero (0); otherwise returns z_value. If y_value is numeric, the z_value must also be numeric; otherwise, date and textual arguments are compatible. If either the y_value or z_value is a date variable, column, or expression, a date is returned. The return value of the function depends on which value is returned. Syntax:
dst_var = cond(x_value, y_value, z_value)
x_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. y_value = Any literal, column, variable, or expression z_value = Any literal, column, variable, or expression dst_var = Any variable Example:
let #avg = #total / cond(&rate != 0, &rate, 1)
146
Chapter 2
Function dateadd
Explanation Returns a date after adding (or subtracting) the specified units to the date_value. Syntax:
dst_var = dateadd(date_value, units_value, quantity_value)
date_value = date variable or expression units_value = text literal, column, variable, or expression. Valid units are year, quarter, week, month, day, hour, minute, and second quantity_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to float. dst_var = date variable Example:
let $date = dateadd($startdate, day, 7.5)
datediff
Returns the difference between the specified dates expressed in units_value. The function returns a float value. The result can be negative if the first date is earlier than the second date. Syntax:
dst_var = datediff(date1_value, date2_value, units_value)
date1_value = date variable or expression date2_value = date variable or expression units_value = text literal, column, variable, or expression. Valid units are year, quarter, week, month, day, hour, minute, and second dst_var = decimal, float, or integer variable Example:
let #diff = datediff($date1, $date2, hour)
datenow
Returns the current local date and time from the client machine. Syntax:
dst_var = datenow()
147
Chapter 2
Function datetostr
Explanation Converts the date date_value to a string in the format format_mask. Syntax:
dst_var = datetostr(date_value [, format_mask])
date_value = date variable or expression format_mask = text literal, column, variable, or expression. The keyword DATE can be used to specify the DATE-EDIT-MASK setting from the current locale. If this argument is not specified, the format specified by the SQR_DB_DATE_FORMAT setting is used. If this has not been set, the first database-dependent format listed in the Default Database Formats table is used. dst_var = text variable Example: let $formdate = datetostr($date, Day Mon DD, YYYY) let $localedate = datetostr($date, DATE) edit Formats source_value according to edit_mask and returns a string containing the result. Syntax:
dst_var = edit(source_value, edit_mask)
source_value = Any literal, column, variable, or expression edit_mask = text literal, column, variable, or expression dst_var = text variable Example: )
let $phone = edit(&phone, (xxx) xxx-xxxxx) let $price = edit(#price, 999.99) let $today = edit($date, DD/MM/YYYY
getenv
Returns the value of the specified environment variable. If the environment variable does not exist, an empty string is returned. Syntax:
dst_var = getenv(env_value)
env_value = text literal, column, variable, or expression dst_var = text variable Example:
let $myuser = getenv(USER)
148
Chapter 2
Function instr
Explanation Returns the numeric position of sub_value in source_value or zero (0) if not found. The search begins at offset offset_value. This function returns a float value. Syntax:
dst_var = instr(source_value, sub_value, offset_ value)
source_value = date or text literal, column, variable, or expression sub_value = text literal, column, variable, or expression offset_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to integer. dst_var = decimal, float, or integer variable Example:
let #offset = instr(&description, auto, 10)
instrb
Performs the same functionality as the instr function except that the starting point and returned value are expressed in bytes rather than in characters. Syntax:
dst_var = instrb(source_value, sub_value, offset_ value)
source_value = date or text literal, column, variable, or expression sub_value = text literal, column, variable, or expression offset_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to integer. dst_var = decimal, float, or integer variable Example:
let #offset = instrb(&description, auto, 10)
isblank
Returns a value of one (1) if source_val is an empty string, null string, or composed entirely of whitespace characters; otherwise, returns a value of zero (0). Syntax:
dst_var = isblank(source_value)
source_value = date or text literal, column, variable, or expression dst_var = decimal, float, or integer variable Example:
let #blank = isblank(&description)
149
Chapter 2
Function isnull
Explanation Returns a value of one (1) if source_val is null; otherwise, returns a value of zero (0). Syntax:
dst_var = isnull(source_value)
source_value = date or text literal, column, variable, or expression dst_var = decimal, float, or integer variable Example:
let #null = isnull($date)
length
source_value = date or text literal, column, variable, or expression dst_var = decimal, float, or integer variable Example:
let #length = length(&description)
Note. PeopleSoft recommends that you use either the lengthp or lengtht function instead of the length function. lengthb (Multibyte versions of SQR only.) Has the same functionality as the length function except that the return value is expressed in bytes, rather than in characters. Syntax:
dst_var = lengthb(source_value)
source_value = date or text literal, column, variable, or expression dst_var = decimal, float, or integer variable Example:
let #length = lengthb(&description)
Note. PeopleSoft recommends that you use either the lengthp or lengtht function instead of the lengthb function.
150
Chapter 2
Function lengthp
source_value = date or text literal, column, variable, or expression dst_var = decimal, float, or integer variable Example:
let #printlen = lengthp(&string)
lengtht
Returns the length of a given string in bytes when converted (transformed) to a specified encoding. Syntax:
dst_var = lengtht(source_value, encoding_value)
source_value = date or text literal, column, variable, or expression encoding_value = text literal, column, variable, or expression. dst_var = decimal, float, or integer variable Example:
let #sjislen = lengtht($string, Shift-JIS)
lower
Converts the contents of source_value to lowercase and returns the result. Syntax:
dst_var = lower(source_value)
source_value = date or text literal, column, variable, or expression dst_var = text variable Example:
let $lower = lower(&description)
151
Chapter 2
Function lpad
Explanation Pads the source_value on the left to a length of length_value using pad_value and returns the result. Syntax:
dst_var = lpad(source_value, length_value, pad_ value)
source_value = date or text literal, column, variable, or expression length_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to integer. pad_value = text literal, column, variable, or expression dst_var = text variable Example:
let $lpad = lpad($notice, 25, .)
ltrim
Trims characters in source_value from the left until a character is not in set_value and returns the result. Syntax:
dst_var = ltrim(source_value, set_value)
source_value = date or text literal, column, variable, or expression set_value = text literal, column, variable, or expression dst_var = text variable Example:
let $ltrim = ltrim(&description, .)
152
Chapter 2
Function nvl
Explanation Returns y_value if the x_value is null; otherwise, returns x_value. If x_value is numeric, y_value must also be numeric; otherwise, date and textual arguments are compatible. In any case, the x_value determines the type of expression returned. The return value of the function depends on which value is returned. Syntax:
dst_var = nvl(x_value, y_value)
x_value = Any literal, column, variable, or expression y_value = Any literal, column, variable, or expression dst_var = Any variable Example:
let $city = nvl(&city, -- not city --)
If x_value is a date and y_value is textual, y_value is validated according to the following rules: For DATETIME columns and SQR DATE variables, SQR uses the format specified by the SQR_DB_DATE_FORMAT setting, one of the database-dependent formats (see the Default Database Formats table), or the database-independent format SYYYYMDD[HH24[MI[SS[NNNNNN]]]]. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT setting, or the format listed in the DATE Column Formats table. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_FORMAT setting, or the format as listed in the TIME Column Formats table.
153
Chapter 2
Function range
Explanation Returns a value of one (1) if x_value is between y_value and z_value; otherwise, returns a value of zero (0). If the first argument is text or numeric, the other arguments must be of the same type. If the first argument is a date, the remaining arguments can be dates and/or text. It is also possible to perform a date comparison on a mix of date and text arguments, for example, where x_value is a date and y_value and z_value are text arguments. In a comparison of this sort, y_value must represent a date that is earlier than that of z_value. Syntax:
dst_var = range(x_value, y_value, z_value)
x_value = Any literal, column, variable, or expression y_value = Any literal, column, variable, or expression z_value = Any literal, column, variable, or expression dst_var = decimal, float, or integer variable Example:
let #inrange = range(&grade, A, D) let #inrange = range($date, $startdate, $enddate) let #inrange = range($date, $startdate, 15-Apr- 04) let #inrange = range(#price, #low, #high)
If x_value is a date and y_value and/or z_value is textual, then y_value and/or z_value is validated according to the following rules: For DATETIME columns and SQR DATE variables, SQR uses the format specified by the SQR_DB_DATE_FORMAT setting, one of the database-dependent formats (see the Default Database Formats table), or the database-independent format SYYYYMMDD[HH24[MI[SS[NNNNNN]]]]. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT setting, or the format listed in the table DATE Column Formats. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_FORMAT setting, or the format as listed in table TIME Column Formats.
154
Chapter 2
Function replace
Explanation Inspects the contents of source_value and replaces all occurrences of from_string with to_string and returns the modified string. Syntax:
dst_var = replace(source_value, from_string, to_ string)
source_value = date or text literal, column, variable, or expression from_string = text literal, column, variable, or expression to_string = text literal, column, variable, or expression dst_var = text variable
Example: let $replaced = replace($paragraph, good, excellent)
roman
Returns a string that is the character representation of source_value expressed in lowercase roman numerals. Syntax:
dst_var = roman(source_value)
source_value = text literal, column, variable, or expression. dst_var = text variable Example:
let $roman = roman(#page-count)
rpad
Pads the source_value on the right to a length of length_value using pad_value and returns the result. Syntax:
dst_var = rpad(source_value, length_value, pad_ value)
source_value = date or text literal, column, variable, or expression length_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to integer. pad_value = text literal, column, variable, or expression dst_var = text variable Example:
let $rpad = rpad($notice, 25, .)
155
Chapter 2
Function rtrim
Explanation Trims characters in source_value from the right until a character is not in set_value and returns the result. Syntax:
dst_var = rtrim(source_value, set_value)
source_value = date, or text literal, column, variable, or expression set_value = text literal, column, variable, or expression dst_var = text variable Example:
let $rtrim = rtrim(&description, .)
strtodate
Converts the string source_value in the format format_mask to a date type. Syntax:
dst_var = strtodate(source_value [, format_mask])
source_value = text literal, column, variable, or expression format_mask = text literal, column, variable, or expression that describes the exact format of the source_value. The keyword DATE can be used to specify the DATE-EDIT-MASK setting from the current locale. If this argument is not specified, then source_value must be in the format specified by the SQR_DB_DATE_FORMAT setting, one of the database-dependent formats (see the Default Database Formats table), or the database-independent format SYYYYMDD[HH24[MI[SS[NNNNNN]]]]. Valid format codes are specified in the Date Edit Format Codes table. dst_var = date variable Example: let $date = strtodate($str_date, Mon DD, YYYY) let $date = strtodate($str_date, DATE)
156
Chapter 2
Function substr
Explanation Extracts the specified portion source_value. The extraction begins at offset_value (origin is 1) for a length of length_value characters. Syntax:
dst_var = substr(source_value, offset_value, length_value)
source_value = date or text literal, column, variable, or expression. offset_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to integer. length_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to integer. dst_var = text variable. Example:
let $piece = substr(&record, 10, #len)
Note. PeopleSoft recommends that you use either the substrp or substrt function instead of the substr function. substrb Has the same functionality as the substr function except that the starting point and length are expressed in bytes, rather than in characters. Syntax:
dst_var = substrb(source_value, offset_value, length_value)
source_value = date or text literal, column, variable, or expression. offset_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to integer. length_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to integer. dst_var = text variable. Example:
let $piece = substrb(&record, 10, #len)
Note. PeopleSoft recommends that you use either the substrp or substrt function instead of the substrb function.
157
Chapter 2
Function substrp
Explanation Returns a substring of a given string starting at a specified print position into the string and of a specified print length. Syntax:
dst_var = substrp(source_value, offset_value, length_value)
source_value = date or text literal, column, variable, or expression. offset_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to integer. length_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to integer. dst_var = decimal, float, or integer variable. Example:
let $sub = substrp(&string, #printpos, #printlen)
substrt
Returns a substring of a given string starting at a specified byte and byte length in a given encoding. Syntax:
dst_var = substrt(source_value, offset_value, length_value, encoding_value)
source_value = date or text literal, column, variable, or expression. offset_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to integer. length_value = decimal, float, or integer literal, column, variable, or expression. The value is always converted to integer. encoding_value = text literal, column, variable, or expression. dst_var = text variable. Example:
let $sjisPrep = substrt(&string, 1, 10, Shift- JIS)
to_char
source_value = decimal, float, or integer literal, column, variable, or expression dst_var = text variable Example:
let $string = to_char(#number)
158
Chapter 2
Function to_multi_byte
Explanation Converts the specified string as follows: Any occurrence of a double-byte character that also has a single-byte representation (numerals, punctuation, roman characters, and katakana) is converted. Syntax:
dst_var = to_multi_byte (source_value)
to_number
source_value = date or text literal, column, variable, or expression. dst_var = decimal, float, or integer variable Example:
let #value = to_number($number)
to_single_byte
Converts the specified string as follows: For SJIS, EBCDIK290, and EBCDIK1027, any occurrence of a single-byte character that also has a multi-byte representation (numerals, punctuation, roman characters, and katakana) is converted. This function also converts a sequence of kana characters followed by certain grammatical marks into a single-byte character that combines the two elements. For all other encodings, the string is not modified. Syntax:
dst_var = to_single_byte(source_value)
159
Chapter 2
Function translate
Explanation Inspects the contents of source_value and converts characters that match those in from_set to the corresponding character in to_set and returns the translated string. Syntax:
dst_var = translate(source_value, from_set, to_ set)
source_value = date or text literal, column, variable, or expression from_set = text literal, column, variable, or expression to_set = text literal, column, variable, or expression dst_var = text variable Example:
let $translated = translate(edit(&price, 999,999.99),,,,)
transform
source_value = date or text literal, column, variable or expression transform_value = text literal, column, variable, or expression dst_var = text variable Example:
let $hiragana = transform($string, ToHiragana)
unicode
Returns a Unicode string from the string of hexadecimal values provided. Syntax:
dst_var = unicode(source_value)
source_value = text literal, column, variable or expression dst_var = text variable Example:
let $uniStr = unicode(u+5e73 u+2294)
160
Chapter 2
Function upper
Explanation Converts the contents of source_value to uppercase and returns the result. Syntax:
dst_var = upper(source_value)
source_value = date or text literal, column, variable, or expression dst_var = text variable Example:
let $upper = upper(&description)
wrapdepth
Returns the number of print lines required by source_value. See the PRINTWRAP command for detailed descriptions of the parameters to this function. This function returns a float value. Syntax:
dst_var = wrapdepth(source_value, wrap_width, line_height, on, strip)
source_value = text literal, column, variable, or expression wrap_width = decimal, float, or integer literal, column, variable, or expression line_height = decimal, float, or integer literal, column, variable, or expression on = text literal, column, variable, or expression. strip = text literal, column, variable, or expression dst_var = decimal, float, or integer variable Example:
let #depth = wrapdepth(&description,40,1,<13>,)
161
Chapter 2
- (int) Number of arguments. - (char *) or (double *) Array of argument pointers, to either char[ ] or double. - (char *) Address for result string. If unchanged, function returns a NULL string. - (int) Maximum length of result string, in bytes. Numeric functions require the following arguments: - (int) Number of arguments. - (char *) or (double *) Array of argument pointers, to either char[ ] or double. - (double *) Address for result numeric value. If unchanged, function returns zero. To add the random function to SQR, add the following modifications to the UFUNC.C file that was provided with SQR: Add the prototype for the random function: static void random CC_ARGS((char *, char *)); Add the function name to the declaration list. The name of the function called from SQR is random. The return type is n for numeric. The number of arguments passed is 1, and the argument type is n for numeric. The function name in UFUNC.C is random. The characters PVR must be entered before the function name.
Name Return_type Number of Arguments 0, 0, 0, 4, 1, Arg_Types Function
n, n, n, n, n,
PVR max, PVR max, PVR split, PVR printarray, PVR random,
At the end the of UFUNC.C file, add the following random routine. The routine name must be lowercase; however, in your SQR program it can be referenced in either uppercase or lowercase.
static void random CC_ARGL((argc, argv, result)) CC_ARG(int, argc) /* The number arguments passed /* The argument list CC_ARG(double *, argv[]) CC_LARG(double *, result) /* Where to store result { if (*argv[0] != 0) srand(*argv[0]); *result = rand(); */ */ */
162
Chapter 2
return; }
After these modifications, recompile UFUNC.C and relink SQR. See the programmers reference manual for details about your particular machine. This is a simple SQR program that uses the random function:
begin-program do get-random-number do process-calculations end-program begin-procedure let #seed = 44 let #ran = random(#seed) end-procedure begin-procedure process-calculations . . .
Example
These examples show some complex expressions:
let #j = ((#a + #b) * #c) ^ 2 if #j > 2 and sqrt(#j) < 20 or #i + 2 > 17.4 while upper(substr(&descrip,1,#j+2)) != XXXX and not isnull(&price) let #len = length(&fname || &initial || &lname) + 2 let $s = edit(&price * &rate, 99999.99) let summary.total(#j) = summary.total(#j) + (&price * &rate) if summary.total(#j) > 1000000 let store.total (#store_id, #dept) = store.total (#store_id, #dept) + #total let #diff = datediff(datenow(), strtodate(1995,YYYY),day) let $newdate = dateadd(datenow(),month,50) let $date1 = datetostr(strtodate(&sale_date), Day Month DD, YYYY)
SQR analyzes LET, IF, and WHILE expressions when it compiles your code and saves the result in an internal format so that repetitive execution is at maximum speed.
LOAD-LOOKUP
Syntax
In the SETUP section:
163
Chapter 2
LOAD-LOOKUP NAME=lookup_table_name TABLE=database_table_name KEY=key_column_name RETURN_VALUE=return_column_name [ROWS=initial_row_estimate_int_lit] [EXTENT=size_to_grow_by_int_lit] [WHERE=where_clause_txt_lit] [SORT=sort_mode] [QUIET] [SCHEMA=schema_name] [PROCEDURE=procedure_name] [COMMAND=command_string] [GETDATA=getdata_string] [PARAMETERS=(...)] [FROM-ROWSET=(m,n,-n,m-,all)] [FROM-PARAMETER=rowset_name]
Description
Loads an internal table with columns from the database. Enables a quick search using the LOOKUP command. Use the LOAD-LOOKUP command in conjunction with one or more LOOKUP commands. LOAD-LOOKUP retrieves two columns from the database, the KEY field and the RETURN_VALUE field. Rows are ordered by KEY and stored in an array. LOAD-LOOKUP commands specified in the SETUP section are always loaded and cannot reference variables for the ROWS, EXTENT, and WHERE arguments. When you use the LOOKUP command, SQR searches the array (with a binary search) to find the RETURN_VALUE corresponding to the KEY referenced in the lookup.
164
Chapter 2
Usually this type of lookup can be done with a database join , but joins take substantially longer. However, if your report is small and the number of rows to be joined is small, a lookup table can be slower because the entire table has to be loaded and sorted for each report run. By default, SQR lets the database sort the data. This works fine if the database and SQR both use the same character set and collating sequence. The SORT argument enables you to specify the sorting method if this is not true. Additionally, if the machine that SQR is running on is faster than the machine the database is running on, letting SQR perform the sort could decrease the execution time of the report. The only limit to the size of a lookup table is the amount of memory your computer has available. You could conceivably load an array with many thousands of rows. The binary search is performed quickly regardless of how many rows are loaded. Except for the amount of available memory, there is no limit to the number of lookup tables that can be defined.
Parameters
Parameter NAME TABLE KEY Description The name of the lookup table. The array name is referenced in the LOOKUP command. The name of the table in the database, where the KEY and RETURN_VALUE columns or expressions are stored. The name of the column that is used as the key in the array that is used for looking up the information. Keys can be character, date, or numeric data types. If numeric, SQR permits only integers with 12 digits or fewer for the KEY column. Keys can be any database-supported expression. See the RETURN_VALUE argument. The name of the column (expression) that is returned for each corresponding key. The following example is for ORACLE. See your database manual for the correct syntax. RETURN_VALUE=name||-||country||-||population The initial size of the lookup table. This argument is optional, and if not specified, a value of 100 is used. The amount to increase the array when it becomes full. This argument is optional, and if not specified, a value of 25% of the ROWS value is used. A WHERE clause used to select a subset of all the rows in the table. If specified, the selection begins after the word WHERE. The WHERE clause is limited to 255 characters. The sorting method to be used. The following values are permitted: DC: Database sorts data, case-sensitive sort DI: Database sorts data, case-insensitive sort SC: SQR sorts data, case-sensitive sort SI: SQR sorts data, case-insensitive sort The default is SC or the method specified by the -LL command-line flag. The DI method is applicable only to databases that provide this feature and have been installed in that manner. Suppresses the message Loading lookup array... when the command executes. The warning message stating the number of duplicate keys found is also suppressed.
RETURN_VALUE
SORT
QUIET
165
Chapter 2
Example
The following command loads the array, states, with the columns abbr and name from the database table stateabbrs, where country is USA.
load-lookup name=states rows=50 table=stateabbrs key=abbr return_value=name where=country=USA
The preceding array is used in the example for the LOOKUP command to retrieve the full text of a state name from the abbreviation. The following example uses the LOOKUP command to validate data entered by a user using an INPUT command:
get_state: input $state Enter state abbreviation uppercase $state lookup states $state $name if $name = ! Lookup didnt find a match show No such state. goto get_state end-if
Surround any command argument with embedded spaces by single quotes, as shown in the following example:
where=country=USA and region = NE
The entire WHERE clause is surrounded by quotes. The two single quotes around USA and NE are translated to one single quote in the SQL statement. The following example uses joins in a LOAD-LOOKUP command by including two tables in TABLE and the join in WHERE:
load-lookup name=states rows=50 sort=sc table=stateabbrs s, regions r
166
Chapter 2
LOOKUP
Syntax
LOOKUP lookup_table_name{key_any_lit|_var|_col} {ret_txt_var|_date_var}
Description
Searches a lookup table (an array) for a key value and returns the corresponding text string. Speeds up processing for long reports. For example, if you want to print the entire state name rather than the abbreviation, you could use LOAD-LOOKUP and then LOOKUP to do this.
Parameters
Parameter lookup_table_name key_any_lit | _var | _col ret_txt_var | _date_var Description Specifies the lookup table. This table must be previously loaded with a LOADLOOKUP command. The key used for the lookup. A string variable into which the corresponding value is returned.
Example
The following example works in conjunction with the example for the LOAD-LOOKUP command:
lookup states &state_abbr $state_name
This example searches the states lookup table for a matching &state_abbr value; if found, it returns the corresponding state name in $state_name. If not found, a null is placed in $state_name.
See Also
LOWERCASE
Syntax
LOWERCASE txt_var
Description
Converts the contents of a text variable to lowercase.
167
Chapter 2
Parameters
Parameter txt_var Description Specifies a text variable to be converted to lowercase.
Example
The following example illustrates the LOWERCASE command
input $answer Type EXIT to stop ! Allows user to enter lowercase $answer ! upper or lowercase. if $answer = exit ...etc...
See Also
MBTOSBS
Syntax
MBTOSBS {txt_var}
Description
Converts a double-byte string to its single-byte equivalent. This command converts the specified string as follows: any occurrence of a double-byte character that also has a single-byte representation (numerals, punctuation, roman characters, and katakana) is converted.
Parameters
Parameter txt_var Specifies the string to be converted. Description
See Also
MOVE
Syntax
MOVE {src_any_lit|_var|_col} TO dst_any_var [[:$]format_mask|NUMBER|MONEY|DATE]
Description
Moves the source field to the destination field. Optionally, you can reformat the field using the format_mask argument. Source and destination fields can be different types, numeric, text, or date. MOVE is also useful for converting from one type to another; however, date and numeric variables are incompatible.
168
Chapter 2
When a date variable or column is moved to a string variable, the date is converted according to the following rules: For DATETIME columns and SQR DATE variables, SQR uses the format specified by the SQR_DB_DATE_FORMAT setting. If this has not been set, SQR uses the first database-dependent format as listed the Default Database Formats table. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT setting. If this has not been set, SQR uses the format listed in the DATE Column Formats table. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_FORMAT setting. If this has not been set, SQR uses the format as listed in the TIME Column Formats table. Finally, as this example shows, the edit mask can be contained in a string variable.
Parameters
Parameter src_any_lit | _var | _col Description Specifies any source column, variable, or literal. Note that a date can be stored in a date variable or column, or a string literal, column, or variable. When using a date format_mask or the keyword DATE with the MOVE command, the source, if a string literal, column, or variable, must be in the format specified by the SQR_DB_DATE_FORMAT setting, one of the database-dependent formats as listed in the Default Database Formats table, or the database-independent format SYYYYMMDD[HH24[MI[SS[NNNNNN]]]]. Specifies a destination variable. Specifies an optional format mask. For additional information regarding edit masks, see the PRINT command. Indicates that src_any_lit|_var|_col is to be formatted using the NUMBER-EDIT-MASK from the current locale. This option is not legal with date variables. (See the ALTER_LOCALE command.) Indicates that src_any_lit|_var|_col is to be formatted using the MONEY-EDIT-MASK from the current locale. This option is not legal with date variables. (See the ALTER_LOCALE command.) Indicates that src_any_lit|_var|_col is to be formatted using the DATE-EDIT-MASK from the current locale. This option is not legal with numeric variables. (See the ALTER_LOCALE command.)
MONEY
DATE
Example
The following example illustrates the various features of the MOVE command:
! ! Convert a string in place ! move 123456789 to $ssn move $ssn to $ssn xxx-xx-xxxx show $SSN = $ssn
169
Chapter 2
! ! Convert a number to a string using a variable edit mask ! move 123 to #counter move 099999 to $mask move #counter to $counter :$mask show $Counter = $counter
170
Chapter 2
$NVar =
123,456.78
! ! Convert the money value to a string using the locale default ! money edit mask ! alter-locale money-edit-mask = $9,999,999.99 move 123456.78 to #mvar move #mvar to $mvar money show $MVar = $mvar
! ! Convert the date column to a string using the locale default ! date edit mask ! begin-select dcol from tables end-select alter-locale date-edit-mask = Mon-DD-YYYY move &dcol to $dvar date show $DVar = $dvar
Produces the following output if the report was run in October of 2004:
$Date2 = 10/01/04 00:00 ! ! Convert date to a string ! ($date1 has been defined as a date variable) ! move $date1 to $str_date DD-MON-YYYY show $Str_Date = $str_date
171
Chapter 2
The LET command for information about copying, editing, or converting fields. The EDIT parameter of the PRINT command for a description of the edit masks. The ALTER-LOCALE command for a description of the arguments NUMBER-EDIT-MASK, MONEY-EDIT-MASK, and DATE-EDIT-MASK. The PRINT command regarding the default date-time components as a result of moving an incomplete date to a date variable.
See Also
MULTIPLY
Syntax
MULTIPLY {src_num_lit|_var|_col} TIMES dst_num_var [ROUND=nn]
Description
Multiplies the first field by the second and places the result into the second field. When dealing with money-related values (dollars and cents), use decimal variables rather than float variables. Float variables are stored as double precision floating point numbers, and small inaccuracies can appear when multiplying many numbers in succession. These inaccuracies can appear due to the way different hardware and software implementations represent floating point numbers.
Parameters
Parameter src_num_lit | _var | _col dst_num_var ROUND Description Specifies a numeric source column, variable, or literal. Specifies a destination numeric variable. Rounds the result to the specified number of digits to the right of the decimal point. For float variables, this value can be from 0 to 15. For decimal variables, this value can be from 0 to the precision of the variable. For integer variables, this argument is not appropriate.
Example
The following example illustrates the MULTIPLY command
172
Chapter 2
multiply multiply
See Also
The ADD command for more information. The LET command for a discussion of complex arithmetic expressions.
NEW-PAGE
Syntax
NEW-PAGE [erase_from_line_num_lit|_var|_col]
Description
Writes the current page and begins a new one. For line printers, this command can optionally erase the old page starting at a specified line. After this action is performed, the location on the page is unchangedthat is, the value of #current-line is the same. The default action is to erase the entire page and reset #current-line to its initial value for the page. In reports where an overflow page is needed, sometimes it is useful to retain information from the first page on succeeding pages. Each NEW-PAGE occurrence adds a form feed character to the output file unless you specify FORMFEED=NO in the DECLARE-LAYOUT for this program in the SETUP section. Note. A NEW-PAGE automatically occurs if page overflow is detected. Tabular reports do not require explicit NEW-PAGE commands; use NEXT-LISTING instead.
Parameters
Parameter erase_from_line_num_lit | _var | _col Description Specifies a numeric column, variable, or literal for line printers.
Example
The following example illustrates the NEW-PAGE command
! Write current page, then erase it ! beginning at line 5. new-page 5
NEW-REPORT
Syntax
NEW-REPORT {report_filename_txt_lit|_var|_col}
Description
Closes the current report output file and opens a new one with the specified file name.
173
Chapter 2
This command is normally used with single reports only. When used with multiple report declarations, this command affects the current report only. The internal page counter is reset to 1 when NEW-REPORT is executed. Note. SQR does not create a report output file until the first page is completed. It is possible that NEW-REPORT will not create a new file, for example, if no data is selected and nothing is printed on the page.
Parameters
Parameter {report_filename_txt_lit | _var | _col} Specifies a new file name. Description
Example
The following example shows the NEW-REPORT command:
new-report new-report rep2a.lis $next-file
Assign the report file name within an SQR report by issuing the NEW-REPORT command before printing. You might even prompt for the file name to use, as shown in the following example:
begin-report input $file Enter report file name new-report $file ...
After execution of this command, the reserved variable $sqr-report is updated to reflect the new report name.
See Also
NEXT-COLUMN
Syntax
NEXT-COLUMN [AT-END={NEWLINE|NEWPAGE}] [GOTO-TOP={num_lit|_var|_col}] [ERASE-PAGE={num_lit|_var|_col}]
Description
Sets the current position on the page to the next column defined with the COLUMNS command.
174
Chapter 2
Parameters
Parameter AT-END GOTO-TOP ERASE-PAGE Description Takes effect if the current column is the last one defined when NEXT-COLUMN is invoked. Causes the current line in the next column to be num_lit|_var|_col. This argument is useful when printing columns down the page. Specifies where to begin erasing the page when an AT-END=NEWPAGE occurs.
Example
The following example prints columns across the page:
columns 10 50 ! begin-select name (0,1,20) phone (0,+3,0) edit (xxx)bxxx-xxxx next-column at-end=newline ! ! from phonelist ! order by name end-select Define two columns
See Also
COLUMNS, USE-COLUMN
NEXT-LISTING
Syntax
NEXT-LISTING[NO-ADVANCE] [SKIPLINES={num_lit|_var|_col}] [NEED={num_lit|_var|_col}]
175
Chapter 2
Description
Ends the current set of detail lines and begins another. NEXT-LISTING is used in tabular reports. This command causes a new vertical offset in the page to begin. After NEXT-LISTING is executed, line 1 is reset one line below the deepest line previously printed in the page body. That is, if you then write PRINT (1, 5), the string is printed on the next available line starting in column 5. Note that the SQR reserved variable #current-line still reflects the actual line number within the page body. The value of SKIPLINES must be a nonnegative integer. If it is less than 0, then 0 is assumed. The value of NEED must be an integer greater than 0. If it is less than or equal to 0, then 1 is assumed.
Parameters
Parameter NO-ADVANCE Description Suppresses any line movement when no printing has occurred since the previous NEXT-LISTING or NEW-PAGE. The default increments the line position even when nothing was printed. Causes the specified number of lines to be skipped before setting up the new offset. Specifies the minimum number of lines needed to begin a new listing or set of detail lines. If this number of lines does not exist, a new page is started. You can use NEED to prevent a group of detail lines from being broken across two pages.
SKIPLINES NEED
Example
The following example shows the NEXT-LISTING command:
begin-select cust_num (1,1) edit 099999 city (,+3) name (2,10,30) address (,+2) next-listing skiplines=1 need=2 from customers order by cust_num end-select ! ! ! ! ! ! ! Each detail group prints starting on line 1 since NEXT-LISTING keeps moving line 1 down the page. NEED=2 keeps 2 line detail groups from breaking across pages.
Note. The NEXT-LISTING command automatically issues a Use-Column 1 command if columns are active.
OPEN
Syntax
OPEN {filename_lit|_var|_col} AS {filenum_num_lit|_var|_col} {FOR-READING|FOR-WRITING|FOR-APPEND} {RECORD=length_num_lit[:FIXED|:FIXED_NOLF|:VARY]} [STATUS=num_var]
176
Chapter 2
Description
Opens an operating system file for reading or writing. After a file is opened, it remains open until explicitly closed by the CLOSE command. A maximum of 256 files can be opened at one time.
Parameters
Parameter {filename_lit | _var | _col} {filenum_num_lit | _var | _col} Description Specifies the file name. The file name can be literal, variable, or column. This makes it easy to prompt for a file name at runtime. Specifies a number that identifies the file in the application. All file commands use the file number to reference the file. File numbers can be numeric variables and literals. The number can be any positive integer less than 64,000. When a file is opened for reading, SQR procures all data sequentially. SQR does not allow for random access of information. When a file is opened for writing, a new file is created. If a file of the same name already exists, it can be overwritten (this depends on the operating system). When a file is opened in append mode, the current file contents are preserved. All data written is placed at the end of the file. SQR creates the file if one does not already exist. For existing files, make sure the attributes used are the same as those used when the file was created. Failure to do this can produce unpredictable results. For the VARY file type , this is the maximum size for a record. For the FIXED file type , this is the size of each record without the line terminator. For the FIXED_NOLF file type , this is the size of each record. This file type assumes that all records contained within the file are the same length. Terminate each record by a line terminator (system dependent). You can use this file type when writing or reading binary data. This file type specifies that all records contained within the file are the same length with no line terminators. When writing records, SQR pads short records with blank characters to ensure each record is the same length. This file type can be used when writing or reading binary data. This file type specifies that the records can be of varying length. Each record is terminated by a line terminator (system-dependent). Only records containing display characters (no binary data) can be used safely. When reading records, any data beyond the maximum length specified is ignored. This is the default file type. Sets the numeric variable to zero if the OPEN succeeds and to -1 if it fails. Without the STATUS argument, a failure on OPEN causes SQR to halt. By using a STATUS variable, you can control what processing should occur when a file cannot be opened.
RECORD
FIXED
FIXED_NOLF
VARY
STATUS
Example
This section contains two examples: a regular open command and an expanded command:
open open open open stocks.dat log.dat $filename $filename as as as as 1 5 #j 2 for-reading for-writing for-append for-reading record=100 record=70 record=80:fixed record=80:fixed_nolf
177
Chapter 2
open $filename as 6 for-reading record=132:vary status=#filestat if #filestat != 0 ... error processing ... end-if
An encoding directive added to the OPEN command allows differently encoded files to be managed in a single run of SQR. When no ENCODING is specified on the OPEN command, SQR uses the file input or output encoding specified in the INI file unless the file is UCS-2 encoded and auto-detection of UCS-2 files is enabled. The complete syntax of the OPEN command is:
OPEN {filename_lit | _var | _col} AS {filenum_num_lit | _var | _col} { FOR-READING | FOR-WRITING | FOR-APPEND } { RECORD = length_num_lit[:FIXED | :FIXED_NOLF | :VARY]} [ STATUS = num_var ] [ ENCODING = { _var | _col | ASCII | ANSI | SJIS | JEUC | EBCDIC | EBCDIK290 | EBCDIK1027 | UCS-2 | UTF-8 | others... }
See Also
The READ, WRITE, and CLOSE commands for information about using files.
PAGE-NUMBER
Syntax
PAGE-NUMBER position[pre_txt_lit[post_txt_lit]]
Description
Places the current page number on the page. The text specified in pre_txt_lit and post_txt_lit are printed immediately before and after the number.
Parameters
Parameter position pre_txt_lit post_txt_lit Description Specifies the position of the page number. See the POSITION command for a description and examples of the position parameter. Specifies a text string to be printed before the page number. Specifies a text string to be printed after the page number.
Example
The following example shows the PAGE-NUMBER command:
begin-footing 1 page-number last-page (1,37) Page () of . ! Will appear as ! "Page 12 of 25."
178
Chapter 2
end-footing
See Also
LAST-PAGE
POSITION
Syntax
POSITION position [@document_marker[COLUMNS{num_lit|_var|_col} [num_lit|_var|_col]...]]
Description
Sets the current position on a page.
Parameters
Parameter position Description A position qualifier consisting of (line, column, width), where column and width are numbers that denote characters and spaces. Line, column, and width are all optional. If line or column are omitted, the print position is set by default to the current position, which is the position following the last printed item. Width is set by default to the width of the text that is being printed. A plus sign or minus sign indicates relative positioning in SQR. A plus sign moves the print position forward from the current position, and a minus sign moves it back. References a location defined in a document paragraph . In this case, the position used is the location of that marker in the text of the document. Defines columns beginning at the location of the document marker. The columns defined are relative to the position of the document marker. When COLUMNS is used, the entire command cannot be broken across more than one program line.
@document_markerg COLUMNS
Example
The following example shows the POSITION command:
position (12,5) ! Set current position to line 12, column 5. position (+2,25) ! Set position 2 lines down, at 25th column. ! Set position to document position () @total_location print #total () edit 999,999,999 ! marker @total_location. position () @name_loc columns 1 30 ! Columns are defined at @name_loc and print name () next-column ! 29 characters to the right of @name_loc print title ()
See Also
The COLUMNS command for more information. Enterprise PeopleTools 8.49 PeopleBook: SQR for PeopleSoft Developers, Creating Form Letters
179
Chapter 2
PRINT
Syntax
PRINT {any_lit|_var|_col} position[format_command[format_cmd_params]...]...
Description
Puts data on the page at a specified position. See Enterprise PeopleTools 8.49 PeopleBook: SQR for PeopleSoft Developers, Changing Fonts.
Parameters
Parameter {any_lit | _var | _col} Description Specifies the data to be printed. Dates can be contained in a date column or variable or, in a string literal, column, or variable. When using EDIT or DATE with the PRINT command, a date in a string literal, column, or variable must be in an acceptable format. See the description of EDIT for further details. A position qualifier consisting of (line, column, width), where column and width are numbers that denote characters and spaces. Line, column, and width are all optional. If line or column are omitted, the print position is set by default to the current position, which is the position following the last printed item. Width is set by default to the width of the text that is being printed. Position can be relative. See the POSITION command for a full description and examples of relative positioning. Specifies optional formatting commands and parameters.
position
format_command [format_cmd_params]
Format Commands
The PRINT command has the following format commands: BACKGROUND BOLD BOX CENTER CODE-PRINTER DATE EDIT FILL FOREGROUND MONEY NOP NUMBER ON-BREAK SHADE
180
Chapter 2
UNDERLINE WRAP Some of these format commands can be used in combination with others and some are mutually exclusive. The following tables shows which can be used together. An X indicates that they can be used together.
181
182
CODEPRINTER
BACKGROUND/ FOREGROUND X X X X X X X X X X X X
BOLD
BOX
CENTER
CODE-PRINTER X X X X
FILL
MATCH
NOP
X X X X
Chapter 2
ON-BREAK
SHADE
UNDERLINE
WRAP
Chapter 2
FILL X X X X X X
MATCH
NOP
ON-BREAK
SHADE
UNDERLINE
WRAP
BACKGROUND/ FOREGROUND X X X X X X X X X X X X X X X X X X X X X X X X
BOLD
BOX
CENTER
CODE- PRINTER
FILL
X X X X X
MATCH
NOP
X X X X X
ON- BREAK
SHADE
UNDERLINE
WRAP
183
Chapter 2
BOLD
BOLD causes the string or number to print in bold type. For HP LaserJet printers, the appropriate boldface font must be loaded in the printer. For PostScript printers, the appropriate boldface must be defined in the PostScript startup file, postscri.str. See the DECLARE-PRINTER Command Arguments table for information about which font can be boldfaced. For line printers, when the BEFORE-BOLD and AFTER-BOLD arguments on the DECLARE-PRINTER command are used, the specified strings are added before and after the data to be boldfaced. If BEFORE-BOLD and AFTER-BOLD are not specified, BOLD has no effect. For example:
print &name (+1, 20) bold print Your account is in arrears (1,1) bold
BOX
BOX draws a one-line deep graphical box around the printed data. This option has no effect for line printers. For example:
print &grand_total (+5, 20) box print Happy Birthday !! (1,1) box
Note. For HP LaserJet printers using proportional fonts, BOX and SHADE are not able to determine the correct length of the box because it varies with the width of the characters printed. BOX and SHADE work well with fixed-pitch fonts and with all PostScript fonts.
CENTER
CENTER centers the field on a line. The position qualifier for column is ignored. For example:
print Quarterly Sales (1) center
CODE-PRINTER
Valid values for printer_type are HT, HP, PS, LP, HTML, HPLASERJET, POSTSCRIPT, and LINEPRINTER.
CODE-PRINTER
Adds nondisplay characters to the program for the purpose of sending a sequence to the printer. CODE-PRINTER causes the string to be placed behind the page buffer, rather than within it, so alignment of printed data is not affected by the white space consumed by the nondisplay characters. Only strings can be printed using CODE-PRINTER. Because the report might be printed on different types of printers, you should specify for which type this data is to be used. The report is ignored if printed to a different type. If necessary, you can send a different sequence to another type with a second PRINT statement. For example:
184
Chapter 2
encode <27>[5U into $big_font encode <27>[6U into $normal_font ... print $big_font (0, +2) code-printer=lp print &phone () edit (xxx) xxx-xxxx print $normal_font () code-printer=lp
In the previous example, the two CODE-PRINTER arguments put the $big_font and $normal_font sequences into the output, without overwriting any data in the page buffer. Sequences printed with the CODE- PRINTER argument are positioned using the regular line and column positioning. However, unlike the PRINT command, the current print location after execution is the beginning location where the CODE-PRINTER string was placed. Multiple coded strings printed using the same line and column location appear in the output in the same sequence in which they were printed.
DATE
You cannot use DATE with numeric columns or variables. DATE indicates that the field is to be formatted using the DATE-EDIT-MASK from the current locale. (See the ALTER_LOCALE command.) If this entry is not set, then the date is printed according to the following rules shown in the Date table.
Column Type DATETIME Default Mask SQR_DB_DATE_FORMAT If not set See the Default Database Formats table for the format that is used. See the DATE Column Formats table for the format that is used. See the TIME Column Formats table for the format that is used.
DATE
SQR_DB_DATE_ONLY_FORMAT
TIME
SQR_DB_TIME_ONLY_FORMAT
EDIT
EDIT has the following syntax:
EDIT edit_format
EDIT causes each field to be edited before it is printed. The three types of edits are: Text edit Numeric edit Date edit The following table lists the text edit format characters.
185
Chapter 2
Description Use character in field. Insert blank. Skip character in field. Reverse sequence of string, for languages such as Hebrew. The optional number indicates right justification within length indicated.
Any other character, such as punctuation, in a text edit mask is treated as a constant and is included in the edited field. The characters 8, 9, 0, V, and $ are illegal in a text edit mask because they are used to indicate that the mask is for a numeric edit. The following table lists the numeric edit format characters.
Character 8 Description Digit, zero fill to the right of the decimal point, trim leading blanks (left justify the number). Digit, zero fill to the right of the decimal point, space fill to the left. Digit, zero fill to the left. Dollar sign, optionally floats to the right. Treated as a 9, but if a value is zero, the field is converted to blanks. Entered at the end of the mask, causes the comma and period characters to be transposed when the edit occurs. This is to support monetary values where periods delimit thousands and commas delimit decimals. (Example: 1.234,56). Scientific format. The number of 9s after the decimal point determines the number of significant digits displayed. The E can be uppercase or lowercase; the display follows the case of the mask.
0 $ B
186
Chapter 2
Character V MI
Description Implied decimal point. Entered at the end of the mask, causes a minus to display at the right of the number. Entered at the end of the mask, causes angle brackets (< >) to be displayed around the number if the number is negative. Entered at the end of the mask, causes parentheses to be displayed around the number if the number is negative. Entered at the end of the mask, causes floating parentheses to be displayed around the number if the number is negative. Entered at the end of the mask, causes N/A to be displayed if the numeric column variable is null. The case of N/A follows that of the mask. Entered at the end of the mask, causes blanks to be displayed if the numeric column variable is null. Decimal point. Comma.
PR
PS
PF
NA
NU
. ,
Characters other than those listed in the Numeric Edit Format Characters table are illegal for numeric edit masks and cause errors during processing. The following table shows sample edit masks and resulting fields.
Mask 999.99 9,999,999V9999 8,888,888.888 9,999 34.568 123,456.7890 123,456.789 1234 Value 34.57 123,4567890 123,456.789 1,234 Display
187
Chapter 2
Mask 9,999 09999 9999 9999 9999 9999mi 9999pr 999999ps 999999pf 9999na 9999nu $$9,999.99c $$9,999.99 $$9,999.99 $$$,$$9.99 9.999e B9,999 B9,999 (xxx)bxxx-xxxx 123 1234 -123 -1234 12345 -123 -123 -123 -123 (null) (null) 1234.56 1234.56 12.34 12.34 123456 0 12345 2169910551
Value 123 01234 -123 **** **** 123< 123> ( 123) (123) n/a (blank) $1.234,56 $1,234.56 $ 12.34 $12.34 1.235e+05 (blank) 12,345
Display
(216) 991-0551
188
Chapter 2
Display
ABCDEFGHIJ ABCDEFG
YYYY SYYYY RR
CC or SCC BC AD Q RM WW
189
Chapter 2
Character W
Description Week of the month (15) where week 1 starts on the first day of the month and ends on the seventh. Day of year (1366). Day of month (131). Day of week (17). Sunday is first day of week. Name of day. Abbreviated name of day. Japanese Imperial Era. Returns the name of the of the Japanese Imperial Era in the appropriate kanji (Heisei is the current era). Year of the Japanese Imperial Era. Returns the current year within the Japanese Imperial Era. Note. The common Japanese date format is: YYYY<nen>MM<gatsu>DD<nichi> where <nen>, <gatsu>, and <nichi> are the kanji strings for year, month, and day respectively.
DDD DD D DAY DY ER
EY
Julian day; the number of days since Jan 1, 4713 BC. Numbers specified with J must be integers. Meridian indicator. Assumes 24-hour clock unless meridian indicator specified. Hour of day (112). Hour of day (023). Seconds past midnight (086399). Fractions of a second. Precise to microseconds; however, for most hardware and databases, this much accuracy is not attainable.
AM PM HH
190
Chapter 2
Description
Abbreviated name of month. Month (0112; JAN=01). Minute (059). Second (059). Used to concatenate different masks.
Note. If the last two digits of the year are between 00 and 49, the return date is in the current century. If the last two digits of the year are between 50 and 99, the return date is in the century after the current one.
Last 2 Digits of Current Year 0049 5099 2-Digit Year is 0049 The return date is in the current century. The return date is in the century after the current one. 2-Digit Year is 5099 The return date is in the century before the current one. The return date is in the current century.
All masks can be used by the strtodate function except for CC, SCC, Q, W, and WW. A backslash forces the next character into the output from the mask. For example, a mask of The cu\rre\nt \mo\nth is Month results in the output string of The current month is January. Without the backslashes the output string would be The cu04e7t january is January. A vertical bar can be used as a delimiter between format codes; however, in most cases the bar is not necessary. For example, the mask YYYY|MM|DD is the same as YYYYMMDD. Any other character, such as punctuation, in a date edit mask is treated as a constant and is included in the edited field. If the edit mask contains spaces, it must be enclosed in single quotes (). The masks MON, MONTH, DAY, DY, AM, PM, BC, AD, and RM are case-sensitive and follow the case of the mask entered. For example, if the month is January, the mask Mon yields "Jan" and MON yields "JAN". All other masks are case-insensitive and can be entered in either uppercase or lowercase. In addition, National Language Support is provided for the following masks: MON, MONTH, DAY, DY, AM, PM, BC, and AD. See the ALTER-LOCALE command in the SQR Samples section for additional information. If the value of the date field being edited is "Mar 14 2004 9:35", the edit masks produce the results in the following table.
191
Chapter 2
Edit Mask dd/mm/yy DD-MON- YYYY Month dd, YYYY MONTH-YYYY HH:MI HH:MI PM YYYYMMDD MM.DD.YYYY Mon DD|D|DDD 14/03/04 14-MAR-2004 March 14, 2004 MARCH-2004 09:35 09:35 AM 20040314 03.14.2004 Mar 143073
Result
In addition to being used with the EDIT argument, edit masks can be used with the MOVE, CONCAT, DISPLAY, and SHOW commands, and with the edit function of the LET command. You edit the field using the supplied mask before storing or displaying it. When a date with missing date and/or time components is displayed or printed, the defaults are as follows: The default year is the current year. The default month is the current month. The default day is one. The default time is zero (00:00:00.000000). For example, assuming today is September 7, 2004, the following assignment would produce an equivalent date-time of September 1, 2004 13:21:00.000000:
let $date1 = strtodate(13:21,HH:MI)
Edit masks can be changed dynamically by storing them in a string variable and referencing the variable name preceded by a colon (:). For example:
move $999,999.99 to $mask print #total (5,10) edit :$mask show #total edit :$mask
When a date that is stored in a string literal, column, or variable is printed with an edit mask, it must be in one of the following formats:
192
Chapter 2
The format specified by the environment variable SQR_DB_DATE_FORMAT, or the corresponding setting in the sqr.ini file. One of the database-dependent formats, as listed in the Default Database Formats table. The database-independent format, SYYYYMMDD[HH24[MI[SS[NNNNNN]]]]. When a date column or variable is printed without an edit mask, the date is printed in the format specified by the environment variable SQR_DB_DATE_FORMAT or the corresponding setting in the sqr.ini file. If this has not been set, then the date is printed in the primary database format (the first entry) listed in the Default Database Formats table. This applies to DISPLAY, MOVE, and SHOW commands as well as PRINT. The following table lists default date formats for each database.
Database Oracle Informix Default Database Formats DD-MON-YY YYYY-MM-DD HH:MI:SS.NNN MM/DD/YYYY MM-DD-YYYY MM.DD.YYYY MM-DD-YYYY YYYY-MM-DD- HH:MI:SS.NNNNNN YYYY-MM-DD MON DD YYYY HH:MIPM MON DD YYYY [HH:MI[:SS[:NNN]][PM] MON DD YYYY [HH:MI[:SS[.NNN]][PM] YYYYMMDD [HH:MI[:SS[:NNN]]PM] YYYYMMDD [HH:MI[:SS[.NNN]]PM]
ODBC DB2
Sybase
193
Chapter 2
FILL
FILL fills the page with the specified character or string as indicated by the print position and length. The following example prints a line of stars and then a line of dashes followed by stars:
print print * (1,1,79) fill -* (+1,20,40) fill ! Fill line with *s ! Fill with -* characters.
FOREGROUND/BACKGROUND
When you specify a color on the PRINT command its scope is that of the PRINT command. If you do not define the specified color name, then the setting for default is used. Use the color name none to turn off color for the specified area.
PRINT {any_lit|_var|_col} [FOREGROUND =({color_name_lit|_var|_col}|{rgb})] [BACKGROUND =({color_name_lit|_var|_col}|{rgb})]
MATCH
MATCH has the following syntax:
MATCH match_text { line_num_lit|_var|_col } { column_num_lit|_var|_col } print_text ...
MATCH compares a field to a list of key values and if a match is found, prints the corresponding string at the specified line and column. If the match_text contains white space, it must be enclosed in single quotes (). Any number of match text(s) can be tested, but each must have its own line, column, and print_text. If a match is not found, the unmatched field is printed at the position specified in the parentheses. Line and column positions for each matched string are treated as fixed or relative positions depending on the type of positioning used in the position qualifier for the PRINT command. For example:
print &type_buyer A 20 12 Casual B 20 22 Impulsive C 21 12 Informed D 21 22 Choosey (20,12) match
To use relative line and fixed column positioning, for example, you could use the following example:
print $state (0,25) OH 0 25 Ohio MI 0 37 Michigan NY 0 25 New York match
194
Chapter 2
The column positions are treated as fixed locations due to the fixed 25 position declared in parentheses.
MONEY
MONEY indicates that the column or variable is to be formatted using the MONEY-EDIT-MASK from the current locale. (See the ALTER_LOCALE command.) This can only be used with a numeric column or variable.
NOP
NOP suppresses the print command, causing no operation to be executed. This argument is useful for temporarily preventing a field from printing. For example:
print &ssn (1,1) nop Hide the social security number.
NUMBER
NUMBER indicates that the column or variable is to be formatted using the NUMBER-EDIT-MASK from the current locale. (See the ALTER-LOCALE command.) This argument can only be used with a numeric column or variable.
ON-BREAK
ON-BREAK has the following syntax:
ON-BREAK [PRINT={ALWAYS|CHANGE|CHANGE/TOP-PAGE|NEVER}] [SKIPLINES={num_lit|_var|_col}] [PROCEDURE=procedure_name[(arg1[ ,argi]...)]] [AFTER=procedure_name[(arg1[ ,argi]...)]] [BEFORE=procedure_name[(arg1[ ,argi]...)]] [SAVE=txt_var] [LEVEL=nn] [SET=nn]
ON-BREAK causes the specified action in a tabular report when the value of a field changes (a break occurs). The default action prints the field only when its value changes (PRINT=CHANGE). ON-BREAK has the following qualifiers: PRINT specifies when the break field is printed. - ALWAYS duplicates the break field for each detail group. - CHANGE prints the value only when it changes. This is the default. - CHANGE/TOP-PAGE prints the value both when it changes and at the top of each new page. - NEVER suppresses printing. SKIPLINES specifies how many lines to skip when the value changes. PROCEDURE specifies the procedure to be invoked when the value changes. This qualifier cannot be used with either the AFTER or BEFORE qualifier. AFTER and BEFORE procedures specify procedures to invoke either after or before the value changes.
195
Chapter 2
If no rows are fetched, neither procedure is executed. AFTER and BEFORE can be used only within a SELECT paragraph. The sequence of events is shown here: - SAVE indicates a string variable where the previous value of a break field is stored. - LEVEL specifies the level of the break for reports containing multiple breaks. For example, a report sorted by state, county, and city might have three break levels: state is level 1 (the most major), and city is level 3 (the most minor). When a break occurs, other breaks with equal or higher level numbers are cleared. The level number also affects the sequence in which AFTER and BEFORE procedures are processed. - SET assigns a number to the set of leveled breaks in reports with more than one set of independent breaks. Following is the sequence of events for a query containing ON-BREAK fields: 1. Any BEFORE procedures are processed in ascending LEVEL sequence before the first row of the query is retrieved. 2. When a break occurs in the query, the following happens: AFTER procedures are processed in descending sequence from the highest level to the level of the current break field. SAVE variables are set with the new value. BEFORE procedures are processed in ascending sequence from the current level to the highest level break. Any breaks with the same or higher level numbers are cleared so they do not break on the next value. If a PROCEDURE has been declared, the procedure is invoked. If SKIPLINES was specified, the current line position is advanced. The value is printed (unless PRINT=NEVER was specified). 3. After the query finishes (at END-SELECT) any AFTER procedures are processed in descending level sequence, for example:
begin-select state (+1,1,2) county (,+2,14) city (,+2,14) ... end-select on-break level=1 on-break level=2 on-break level=3 after=state-tot skiplines=2 after=cnty-tot skiplines=1 after=city-tot
The breaks are processed as follows: When city breaks, the city-tot procedure is executed. When county breaks, first the city-tot procedure is executed, then the cnty-tot procedure is executed.
196
Chapter 2
When state breaks, the city-tot, cnty-tot, and state-tot procedures are processed in that sequence. If any BEFORE breaks were indicated, they would also be processed automatically, after all of the AFTER breaks and in sequence from lower to higher level numbers, for example:
begin-select state (+1,1,2) on-break level=1 before=bef-state after=state-tot county (,+2,14) on-break level=2 before=bef-cnty after=cnty-tot city (,+2,14) on-break level=3 before=bef-city after=city-tot ... end-select
Now when state breaks, this sequence of procedures is executed: City-tot Cnty-tot State-tot Bef-state Bef-cnty Bef-city Upon entering the query at BEGIN-SELECT, the three BEFORE procedures are executed in sequence: Bef-state Bef-cnty Bef-city After the last row is retrieved, at END-SELECT, the three AFTER procedures are executed in sequence: City-tot Cnty-tot State-tot The SAVE qualifier saves the previous break value in the specified string variable for use in an AFTER procedure. You may want to print the previous break field with a summary line:
print &state (+1,1) on-break after=state-tot save=$old-state
The SET qualifier enables you to have sub-reports with leveled breaks. By separating the ON-BREAKs into sets, the associated leveled breaks in each set do not interfere with each other.
begin-select state (+1,1,2) on-break set=1 after=state-tot level=1
SET=1 associates this leveled break with other breaks having the same set number.
SHADE
Draws a one-line deep, shaded graphical box around the printed data. For line printers this argument has no effect.
print Company Confidential (1,1) print &state (+2, 40) shade shade
197
Chapter 2
Note. For HP LaserJet printers using proportional fonts, BOX and SHADE are not able to determine the correct length of the box because it varies with the width of the characters printed. BOX and SHADE work well with fixed pitch fonts and with all PostScript fonts.
UNDERLINE
UNDERLINE prints the specified data with underlined characters. For line printers, UNDERLINE causes backspace and underscore characters to be output, which emulates underlining, for example:
print &name (+1, 45) underline print Your account is in arrears (1,1) underline
WRAP
WRAP wraps text at word spaces. Additional text is moved to a new line. WRAP has the following syntax:
WRAP {line_length_lit|_var|_col} {max_lines_lit|_var|_col}[KEEP-TOP] [STRIP=strip_chars][ON=break_chars][R] [LINE-HEIGHT={line_height_lit|_var|_col}] line_length_lit|_var|_col
Specifies the maximum paragraph width in characters. Note. After a string wraps, the current position is one character to the right of the last character in the column. When a string ends on the last position of a line, an implicit line feed causes the new current position to be the first character of the following line. In the SETUP section, use the DECLARE-LAYOUT command to make the page width one character wider than the right edge of the wrapped text to avoid generating an implicit line feed. In this example, the line position is 1 for each of the three wrapped fields:
print &comment (48,20,0) wrap 50 3 ! ! ! ! print print print ¬e1 ¬e2 ¬e3 (1,20,30) (1,+2,30) (1,+2,30) wrap wrap wrap 30 30 30 Paragraph is 50 characters wide, with a maximum depth of 3 lines. 4 4 4
In this example, the line position is 1 for each of the three wrapped fields: note1, note2, and note3. The current print position after a wrap occurs at the bottom right edge of the wrapped paragraph. To continue printing on the same line, you must use a fixed line number for the next field.
max_lines_lit|_var|_col
Specifies the maximum paragraph depth in lines. Usually, the line length and maximum lines are indicated with numeric literals. However, WRAP can also reference numeric variables or columns. This is useful when you want to change the width or depth of a wrapped paragraph during report processing. The numeric variable can optionally be preceded by a colon (:), for example:
198
Chapter 2
print print
$comments $message
KEEP-TOP retains the current line position except if a page break occurs, in which case, line 1 is used as the current line position. The default action is to set the next print position at the bottom of the wrapped data. In the following example, the column &resolution prints on the same line as the first line of the column &instructions:
print &phone (+1,10) edit (xxx) xxx-xxxx print &instructions (+1,10,30) wrap 6 30 keep-top print &resolution (0,+3,25)
The STRIP and ON arguments affect which characters are to be converted before wrapping, and which characters force a wrap to occur. Characters in the STRIP string argument are converted to spaces before the wrap occurs. Characters in the ON string argument cause a wrap at each ON character found. The ON character is not printed. Both arguments accept regular characters and nondisplay characters whose decimal values are surrounded by angled brackets, <nn>, where nn is a decimal number between 1 and 255, representing the character in the current character set of the operating system. For example, to print a long data type that contains embedded carriage returns, the setup would be:
print &long_field (5,20) wrap 42 30 on=<13>
The paragraph wraps at each carriage return, rather than at the usual word boundaries. If the ON character is not found within the width specified for the paragraph, the wrap occurs at a word space. The following example converts the STRIP characters to spaces before wrapping on either a line feed <10> or a space (the default):
print &description (20,10) wrap 50 22 strip=/\^@<13> on=<10>
WRAP can also be used to print reversed characters, for support of languages such as Hebrew. An R after the length and max_lines arguments causes the field to be reversed before the wrap takes place. In addition, the entire paragraph is right-justified within the length indicated.
! Reverse wrap, in 30 character field. print &comment (2,35) wrap 30 5 r print $notes (1,50) wrap 50 7 r
LINE-HEIGHT specifies the number of lines to skip between each line of the wrapped data. By default a value of 1 (single space) is assumed. The following example prints the comment column with one blank line between each printed line for a maximum of four printed lines:
print &comment (1,1) wrap 40 4 line-height = 2 ! Double space text
See Also
The LET command for information about copying, editing, or converting fields. The ALTER-LOCALE command for a description of the arguments NUMBER-EDIT-MASK, MONEY-EDIT-MASK, and DATE-EDIT-MASK. DISPLAY, SHOW
199
Chapter 2
PRINT-BAR-CODE
Syntax
PRINT-BAR-CODE position {TYPE={bar_code_type_num_lit|_var|_col}} {HEIGHT={bar_code_height_num_lit|_var|_col}} {TEXT={bar_code_txt_lit|_var|_col}} [CAPTION={bar_code_caption_txt_lit|_var|_col}] [CHECKSUM={checksum_lit}]
Description
Prints industry standard bar codes. SQR supports the bar code types listed in the following table.
Type Description Text Length Text Type CHECKSUM RECOGNIZED
1 2 3 4 5 6 7 8 9 10 11 12 13
UPC-A UPC-E EAN/JAN-13 EAN/JAN-8 3 of 9 (Code 39) Extended 3 of 9 Interleaved 2 of 5 Code 128 Codabar Zip+4 Postnet MSI Plessey Code 93 Extended 93
9 9 9 9 9, X, p 9, X, x, p, c 9 9, X, x, p, c 9 9 9 9, X, p 9, X, x, p y y y y y y y
200
Chapter 2
Type
Description
Text Length
Text Type
CHECKSUM RECOGNIZED
14 15
UCC-128 HIBC
19 1 to 30
9 9 y
Parameters
Parameter position Description Specifies the position of the upper left corner. Position parameters can be relative. See the POSITION command for examples of relative positioning. Document markers are not allowed. After execution, the current position is returned to this location; however, the next listing line is the next line below the bottom of the bar code. (This is different than the way the PRINT command works.) Specifies the type of bar code to be printed. Types are shown in the Bar Code Types table. Specifies the height of the bar code in inches. The height must be between 0.1 and 2 inches. The code prints to the nearest one-tenth of an inch. For Zip+4 Postnet, the height of the bar code is fixed. The height should be between 0.2 and 2.0 for Zip+4 Postnet. If it is less than 0.2, the bar code extends above the position specified. Specifies the text to be encoded and printed. The number and type of text characters permitted or required depends on the bar code type. See the Bar Code Types table for specifications. Specifies optional text to be printed under the bar code in the current font. SQR attempts to center the caption under the bar code; however, for proportional fonts this may vary slightly. CAPTION is not valid for Zip+4 Postnet. If specified, it is ignored. Specifies an optional check sum to be computed and printed within the bar code. Valid values are YES and NO, where NO is the default. Note. Some barcode types ignore the CHECKSUM qualifier. See the Bar Code Types table for those barcode types for which CHECKSUM is relevant.
TYPE HEIGHT
TEXT
CAPTION
CHECKSUM
Example
This example shows how to use the PRINT-BAR-CODE command to create a UPC-A bar code:
begin-program print Sample UPC-A Barcode (1,1) print-bar-code (3,1) type=1 ! UPC-A height=0.3 text=01234567890 caption=0 12345 67890 end-program
This example shows how to use the PRINT-BAR-CODE command to create a ZIP+4 Postnet code:
201
Chapter 2
begin-program print Sample Zip+4 Postnet print John Q. Public print 1234 Main Street print AnyTown, USA 12345-6789 print-bar-code type=10 height=0.2 text=12345678934 end-program
Note. SQR does not check bar code syntax. See your bar code documentation for the proper formatting of certain bar codes.
PRINT-CHART
Syntax
PRINT-CHART[chart_name]position DATA-ARRAY-ROW-COUNT={x_num_lit|_var|_col} DATA-ARRAY-COLUMN-COUNT={x_num_lit|_var|_col} DATA-ARRAY=array_name [DATA-LABELS=data_labels_lit | _var | _col] [COLOR-PALETTE=color_palette_lit | _var | _col]] [ITEM-COLOR=(Chart_item_keyword, txt_lit |var | (r,g,b))] [DATA-ARRAY-COLUMN-LABELS={NONE|array_name| {({txt_lit|_var}[,{txt_lit|_var}]...)}}] [CHART-SIZE=(chart_width_num_lit|_var, chart_depth_num_lit|_var)] [TITLE={title_txt_lit|_var|_col}] [SUB-TITLE={subtitle_txt_lit|_var|_col}] [FILL={fill_lit|txt_var|_col}] [3D-EFFECTS={3d_effects_lit|txt_var|_col}] [BORDER={border_lit|txt_var|_col}] [POINT-MARKERS={point_markers_lit|txt_var|_col}] [TYPE={chart_type_lit|txt_var|_col}] [LEGEND={legend_lit|txt_var|_col}] [LEGEND-TITLE={legend_title_txt_lit|_var|_col}] [LEGEND-PLACEMENT={legend_placement_lit|txt_var|_col}] [LEGEND- PRESENTATION={legend_presentation_lit|txt_var|_col}] {pie_segment_quantity_display_lit|txt_var|_col}] [PIE-SEGMENT-QUANTITY-DISPLAY= [PIE-SEGMENT-PERCENT- DISPLAY={pie_segment_percent_display_lit |txt_var|_col}] [PIE-SEGMENT-EXPLODE={pie_segment_explode_lit |txt_var|_col}] [X-AXIS-LABEL={x_axis_label_txt_lit|_var|_col}] [X-AXIS-MIN-VALUE={x_axis_min_value_lit|_num_lit|_var |_col}] [X-AXIS-MAX-VALUE={x_axis_max_value_lit|_num_lit|_var |_col}]
202
Chapter 2
[X-AXIS-SCALE={x_axis_scale_lit|txt_var|_col}] [X-AXIS-MAJOR-TICK-MARKS={x_axis_major_tick_marks_lit |txt_var|_col}] [X-AXIS-MINOR-TICK-MARKS={x_axis_minor_tick_marks_lit |txt_var|_col}] [X-AXIS-MAJOR-INCREMENT={x_axis_major_increment_lit |_num_lit|_var|_col}] [X-AXIS-MINOR-INCREMENT={x_axis_minor_increment_lit |_num_lit|_var|_col}] X-AXIS-TICK-MARK-PLACEMENT= {x_axis_tick_mark_placement_lit|txt_var|_col}] [X-AXIS-GRID={x_axis_grid_lit|txt_var|_col}] [Y-AXIS-LABEL={y_axis_label_lit|txt_var|_col}] [Y-AXIS-MIN-VALUE={y_axis_min_value_lit|_num_lit |_var|_col}] [Y-AXIS-MAX-VALUE={y_axis_max_value_lit|_num_lit |_var|_col}] [Y-AXIS-SCALE={y_axis_scale_lit|txt_var|_col}] [Y-AXIS-MAJOR-TICK-MARKS={y_axis_major_tick_marks_lit |txt_var|_col}] [Y-AXIS-MINOR-TICK-MARKS={y_axis_minor_tick_marks_lit |txt_var|_col}] [Y-AXIS-MAJOR-INCREMENT={y_axis_major_increment_lit |_num_lit|_var|_col}] [Y-AXIS-MINOR-INCREMENT={y_axis_minor_increment_lit |_num_lit|_var|_col}] [Y-AXIS-TICK-MARK-PLACEMENT= {y_axis_tick_mark_placement_lit|txt_var|_col}] [Y-AXIS-GRID={y_axis_grid_lit|txt_var|_col}]
Note. If you do not define CHART-SIZE with this command, you must define it with DECLARE-CHART.
Description
Prints a chart. Only PostScript printers or HP printers that support HPGL (generally, this is HPLaserJet 3 and higher) render chart output. The PRINT-CHART command directs SQR to output a chart according to the named chart, if any, and the overridden attributes, if any.
203
Chapter 2
Note. PRINT-CHART can be used without referencing a named chart if all required attributes for the DECLARE-CHART are supplied in addition to all its required parameters. The PRINT-CHART command directs SQR to display the chart on the current page using the attribute values at the moment the command is executed. Manipulation of chart attribute values has no effect on the appearance of the chart after the PRINT-CHART command has been executed. For example, if you execute a PRINT-CHART with TITLE=$ttl and $ttl=Encouraging Results, and then change the value of $ttl to Discouraging Results immediately afterward, then the chart is printed with first value, Encouraging Results. PRINT-CHART expects the DATA-ARRAY to be organized in a particular way. See the Chart Array Field Types (fewer than four fields) table for details. PRINT-CHART fills the area defined by CHART-SIZE as much as possible while maintaining an aesthetically pleasing ratio of height to width. In cases where the display area is not well suited to the chart display, the chart is centered within the specified region, and the dimensions are scaled to accommodate the region. Do not be alarmed if the chart does not fit exactly inside the box you have specified. It means that SQR has accommodated the shape of the region to provide the best looking chart possible. Chart commands used to send output to a line printer are ignored. Only PostScript printers or HP printers that support Hewlett Packards HPGL (generally, this is HP LaserJet model 3 and higher) render chart output. If you attempt to print a chart to a LaserJet printer that does not support HPGL, the HPGL command output might become part of your output, leaving one or more lines of meaningless data across your report. All the attributes defined for DECLARE-CHART are valid for the PRINT-CHART command. PRINT-CHART has five additional parameters. The position of the chart is described using the first parameter. The data that supports the chart is defined in the additional attributes: DATA-ARRAY, DATA-ARRAY-ROW-COUNT, DATA-ARRAY-COLUMN-COUNT, and DATA-ARRAY-COLUMN-LABELS. As mentioned, each chart type meets a specific organizational requirement. The Chart Array Field Types (fewer than four fields) table describes these requirements. Note. If the first field in the array designated by DATA-ARRAY is of type CHAR, then the value on the x-axis is the contents of that column. If the first field is not of type CHAR, then the value of the x-axis is the row number of the array designated by DATA-ARRAY, beginning with 1. Pie charts show the character value in the legend area. Histograms show the character value on the y-axis. XY-Scatter charts do not use the character value and none is needed in the array. Note. If a PIE chart contains many small slices, the user must set the PIE-SEGMENT-QUANTITY-DISPLAY and/or PIE-SEGMENT-PERCENT-DISPLAY arguments to NO to prevent the values from one slice overwriting the values of another slice.
Chart Type PIE Field 0 Type=char Pie segment labels, the names associated with each segment Field 1 Type=num The value associated with each pie segment Field 2 (Optional) Type=char Pie segment explode flag setting, Y or N Field 3
204
Chapter 2
Chart Type LINE BAR STACKED-BAR 100%-BAR OVERLAPPEDBAR HISTOGRAM AREA STACKEDAREA 100%AREA XY-SCATTERPLOT
(Optional) Type=num Series 2 ... Y-Axis values (Optional) Type=Num Series 2 ... Y-Axis offset
FLOATING-BAR
205
Chapter 2
Parameters
Parameter chart_name Description Specifies the name of the chart from the DECLARE-CHART command. This name is not necessary if you specify the CHART-SIZE and all other pertinent attributes in the PRINT-CHART command. (row, column) Specifies the position of the upper left corner. Position parameters can be relative. See the POSITION command for examples of relative positioning. Document markers are not allowed. After execution, the current position is returned to this location; however, the next listing line is the next line below the bottom of the chart area. (This is different than the way the PRINT command works.) Specifies the name of the array containing the data to be plotted. This must be the name of an array defined with CREATE-ARRAY. Specifies the number of rows or sets of data to be used from the DATA-ARRAY. If the DATA-ARRAY has a greater number of rows, only DATA-ARRAY-ROW- COUNT is included in the chart. Specifies the number of columns to be used from the DATA-ARRAY. If the DATA-ARRAY has a greater number of columns, only DATA-ARRAYCOLUMN-COUNT is included in the chart. Specifies labels for each Y-Axis value of the data set (fields) in DATA-ARRAY. These labels are displayed in the legend box. Column labels are ignored for pie charts. See the Chart Array Field Types (fewer than four fields) table for applicable fields for each type of chart. For definitions of the other arguments, see the DECLARE-CHART Command Arguments table.
Position
Example
In this example, a pie chart is printed without explicit reference to a chart declared with DECLARE-CHART. All necessary arguments must be supplied in PRINT-CHART.
. . create-array name=unit_sales size=12 field=product:char field=units:number field=explode:char . . print-chart (15, 20) title sub-title chart-size type data-array data-array-column-count data-array-row-count 3d-effects
= = = = = = = =
Green City Store Sales (Second Quarter) (50, 28) pie unit_sales 3 7 yes
206
Chapter 2
fill
= color
See Also
DECLARE-CHART
PRINT-DIRECT
Syntax
PRINT-DIRECT [NOLF] [PRINTER={LINEPRINTER|POSTSCRIPT|HPLASERJET|HTML|LP|PS|HP|HT}] {txt_lit|_var|_col}...
Description
Writes directly to the print output file without using the SQR page buffer. PRINT-DIRECT can be used for special applications that cannot be accomplished directly with PRINT commands, such as initializing a page with graphics or other special sequences. Because this text is often printer-dependent and because the report can be printed on different types of printers that require different control characters, you can use the PRINTER qualifier to specify the printer type. If no PRINTER qualifier is specified, the command applies to all printer types. When using PRINT-DIRECT in conjunction with PRINT commands, be aware that the SQR page buffer is copied to the output file only when each page is full or when a NEW-PAGE command is issued. One approach is to use PRINT-DIRECT commands inside a BEFORE-PAGE or AFTER-PAGE procedure (declared with the DECLARE-PROCEDURE command), so they are coordinated with the information coming out of the page buffer.
Parameters
Parameter NOLF PRINTER {txt_lit | _var | _col} Description Specifies that no carriage return and line feed is to be printed. By default, printed text is followed by a carriage return and line feed character. Specifies the type of printer to which this text applies. The text to be printed.
Example
The following example shows the PRINT-DIRECT command:
print-direct print-direct printer=ps %%Page: $page-number nolf printer=lp reset
PRINT-IMAGE
Syntax
PRINT-IMAGE[image_name]position [TYPE={image_type_lit|_var|_col}] [IMAGE-SIZE=(width_num_lit|_var|_col,height_num_lit
207
Chapter 2
|_var|_col)] [SOURCE={file_name_txt_lit|_var|_col}]
Note. If TYPE, IMAGE-SIZE, and SOURCE are not defined in PRINT-IMAGE, they must be defined in DECLARE-IMAGE.
Description
Prints an image. The PRINT-IMAGE command can be placed in any section of a report with the exception of the SETUP section. The image file pointed to can be any file of the proper format. PRINT-IMAGE may be used without referencing a named image if all required attributes for the DECLARE-IMAGE are supplied in addition to all its required parameters.
Parameters
Parameter image_name position Description Specifies the name of an image specified by a DECLARE-IMAGE. (row, column) Specifies the position of the upper left corner. Position parameters can be relative. See the POSITION command for examples of relative positioning. Document markers are not allowed. After execution, the current position is returned to this location; however, the next listing line below the bottom of the image area. (This is different from the way the PRINT command works.) Specifies the image type. Types can be EPS-FILE, HPGL-FILE, GIF-FILE, JPEG-FILE, or BMP-FILE (for Windows). Specifies the width and height of the image. Specifies the name of a file containing the image.
Example
For PostScript:
print-image office-signature (50, 20) print-image (50, 20) type = eps-file source = sherman.eps image-size = (10, 3)
For Windows:
print-image company-logo (+21, 25) type=bmp-file source=m:\logos\gustavs.bmp image-size=(75,50)
See Also
DECLARE-IMAGE
208
Chapter 2
PUT
Syntax
PUT {src_any_lit|_var|_col}... INTO dst_array_name(element)[field[(occurs)]]...
Description
Moves data into an array. Columns retrieved from the database and SQR variables or literals can be moved into an array. The array must have been created previously using the CREATE-ARRAY command.
If array fields are listed, data is placed into each field in the sequence it is listed, in the occurrence specified of that field. If array fields are not listed, data is placed into consecutive fields in the order in which they were defined in the CREATE-ARRAY command; data is copied into occurrence zero of each field of the element specified in the array.
field [ ( occurs ) ]
Array element and field occurrence numbers can be numeric literals (123) or numeric variables (#j). If no occurrence is specified, occurrence zero is used.
209
Chapter 2
Parameters
Parameter src_any_var Description The source variable or literal to be moved into the array. Numeric variables, literals, and database columns can be put into number (decimal, float, integer) fields. String variables, literals, and database columns can be put into char, text, or date fields. Date variables can be put into date, char, or text fields.
Example
In the following example, the four variables &name, #count, $date1, and $code are placed into the first four fields defined in the names array. The data is put into the #jth element of the array.
put &name #count $date1 $code into names(#j)
The following command places #j2, #j3, and #j4 into the zero through 2nd occurrences of the tot field in the #jth element of the totals array.
put #j2 #j3 #j4 into totals(#j) tot(0) tot(1) tot(2)
The following command copies #count into the #j2th occurrence of the count field in the #jth element of the states array.
put #count into states(#j) count(#j2)
READ
Syntax
READ {filenum_lit|_var|_col} INTO {any_var:length_int_lit}...[STATUS=status_num_var]
Description
Reads the next record of a file into the specified variables. Text and binary data is parsed according to the following criteria: Text data is any string of characters. The length of the variable name indicates how many characters to place into the variable. After being transferred, trailing blanks in the variable are omitted. If the field was written as a date variable, then it may be read into a date variable or text variable. When reading a date into a date variable, it must be in the format specified by the SQR_DB_DATE_FORMAT setting, one of the database-dependent formats as listed in the DATE Column Formats table is used, or the database-independent format SYYYYMMDD[HH24[MI[SS[NNNNNN]. Binary numbers, may be 1, 2, or 4 bytes in length. They must be read into numeric variables. Note that the bytes making up the binary number must be in the standard sequence expected by your operating system. When reading binary data the file must be opened with the FIXED or FIXED-NOLF qualifier. Only the integer portion of the number is represented with binary numbers. To maintain the decimal portion of the number convert the number to a string variable. If you use binary numbers, the file is not portable across platforms. Different hardware represents binary numbers differently.
210
Chapter 2
The total length indicated for the variables must be less than or equal to the length of the record being read. If there are no more records to read, the #end-file reserved variable is set to 1; otherwise, it is set to 0 (zero). Your program should check this variable after each READ command. If STATUS is specified, SQR returns 0 if the read is successful; otherwise, it returns the value of errno, which is system-dependent.
Parameters
Parameter filenum_lit|_var | _col any_var :length_int_lit STATUS Description Specifies the number assigned in the OPEN command to the file to be read. Specifies one or more variables into which data from the record read are to be put. length_int_lit specifies the length of each field of data. Specifies an optional variable into which a read status is returned.
Example
The following example shows several READ commands:
read read read 1 into 3 into #j into $name:30 $addr:30 $city:20 $state:2 $zip:5 $type:2 #amount:2 #rate:1 $code:5 $date:11 #sequence:2 $name:20 $title:15
The following example shows a READ command that reads two dates. One is loaded into a date variable; the other is loaded into a string variable, which is then converted to a date using the strtodate function.
. . . declare-variable date $date1 $date2 text $text end-declare . . . read 4 into $date1:18 $text1:18 let $date2 = strtodate($text1,SYYYYMMDDHHMISSNNN) or let $date2 = strtodate($text1)
211
Chapter 2
break ! End of file reached. end-if begin-sql insert into comps (name, parent, location) values ($company, $parent, $location) end-sql add 1 to #inserts if #inserts >= 100 begin-sql end transaction; begin transaction end-sql move 0 to #inserts end-if end-while begin-sql end transaction end-sql
See Also
The OPEN, CLOSE, and WRITE commands for information about files.
ROLLBACK
Syntax
ROLLBACK
Description
An automatic rollback is performed whenever SQR ends due to program errors. ROLLBACK is useful in testing or in certain error conditions. ROLLBACK is an SQR command and should not be used inside an SQL paragraph. Note. The ROLLBACK command can be used with Oracle, DB2 , Informix, and ODBC(Microsoft SQL Server is accessible only with SQR Server for ODBC). For Sybase and Microsoft SQL Server , use BEGIN TRANSACTION and ROLLBACK TRANSACTION within SQL paragraphs as in the following example. See the COMMIT command for an example of ROLLBACK.
Example
The following example shows the ROLLBACK command:
if #error-status = 1 rollback stop end-if
See Also
212
Chapter 2
SBTOMBS
Syntax
SBTOMBS { txt_var }
Description
Converts a single-byte character into a multibyte equivalent. This command converts the specified string as follows: Any occurrence of a single-byte character that also has a multibyte representation (numerals, punctuation, roman characters, and katakana) is converted. This command also converts a sequence of a kana character followed by certain grammatical marks into a single multibyte character, which combines the two elements.
Parameters
Parameter txt_var Specifies the string to be converted. Description
See Also
SECURITY
Syntax
SECURITY [SET=(sid [,sid]...)] [APPEND=(sid [,sid]...)] [REMOVE=(sid [,sid]...)] [MODE=mode]
Description
Enables you to mark sections of a report for security purposes. The SECURITY command can be repeated as many times as desired for the current report. After the SECURITY command is executed, all subsequent commands for the current report are constrained by the designated sids until the report ends or another SECURITY command executes. You can use the SECURITY command wherever you use the PRINT command.
213
Chapter 2
Parameters
Parameter SET Description Sets the list of security IDs for subsequent commands. The previous list of security IDs is replaced by the specified security IDs. This argument is optional and can only be used once. Can be any string literal, column, or variable. The value is case-sensitive. Appends the specified security IDS to the current list. This argument is optional and can be used multiple times. Removes the specified security IDS from the current list. This argument is optional and can be used multiple times. Used to turn on (reactivate) or turn off (suspend) the security feature for the current report. This argument is optional and can only be used once. Can be any string literal, column, or variable. The value is not case-sensitive and can be either ON or OFF.
Example
The following example shows the SECURITY command:
Begin-Report Security Set=(Directors, Vice-Presidents) . . ! Only Directors and VPS can see this . Security Remove=(Directors) . . ! Only VPS can see this . Security Mode=Off . . ! Anybody can see this . Security Mode=On Append=(Managers) . . ! Only VPs and Managers can see this . Security Append=(Engineers) . . ! Only VPs, Managers, and Engineers can see this . End-report
SET-COLOR
Syntax
SET-COLOR [PRINT-TEXT-FOREGROUND=({color_name_lit|_var|_col|{rgb})]
214
Chapter 2
[PRINT-TEXT-BACKGROUND=({color_name_lit|_var|_col|{rgb})]
Description
Defines default colors. The SET-COLOR command is allowed wherever the PRINT command is allowed. If the specified color name is not defined, SQR uses the settings for the color name default. Use the color name none to turn off color for the specified area.
Parameters
Parameter PRINT-TEXTFOREGROUND PRINT-TEXTBACKGROUND {color_name_lit | _var | _col} Description Defines the color in which the text is printed. Defines the color to print as a background behind the text. A color_name is composed of alphanumeric characters (A-Z, 0-9), the underscore (_) character, and the hyphen (-) character. It must start with an alphabetical (A-Z) character and is case-insensitive. The name none is reserved and cannot be assigned a value. A name in the format (RGBredgreenblue) cannot be assigned a value. The name default is reserved and may be assigned a value. Default is used during execution when a referenced color is not defined in the runtime environment. red_lit | _var | _col, green_lit | _var | _col, blue_lit | _var | _col where each component is a value in the range of 000 to 255. In the BEGIN-SETUP section, only literal values are allowed. The default colors implicitly installed with SQR include: black=(0,0,0) white=(255,255,255) gray=(128,128,128) silver=(192,192,192) red=(255,0,0) green=(0,255,0) blue=(0,0,255) yellow=(255,255,0) purple=(128,0,128) olive=(128,128,0) navy=(0,0,128) aqua=(0,255,255) lime=(0,128,0) maroon=(128,0,0) teal=(0,128,128) fuchsia=(255,0,255)
{rgb}
Example
The following example shows the SET-COLOR command:
begin-setup declare-color-map light_blue = (193, 222, 229) end-declare end-setup
215
Chapter 2
begin-program alter-color-map name = light_blue value = (193, 233, 230) print Yellow Submarine () foreground = (yellow) background = (light_blue) get-color print-text-foreground = ($print-foreground) set-color print-text-foreground = (purple) print Barney (+1,1) set-color print-text-foreground = ($print-foreground) end-program
See Also
SET-GENERATIONS
Syntax
SET-GENERATIONS=(dimension, hierarchy, dimension, hierarchy, dimension, hierarchy,...,...)
Description
Specifies dimension hierarchy for the previously declared dimension. Returns the set of members in the dimension product that are at the 5th generation in the dimensions hierarchy. (Returns all Brand Name members (Generation Level 5) under the product hierarchy of all products.drink.alcoholic beverages.beer and wine. This would increase the result set to a list of beers and wines.) Returns the set of members in the dimension time that are at the 1st generation deep into the dimension. (Returns all Year members (Generation Level 1) under the time hierarchy of 2004.Q1.2. This reduces result set to 2004.)
Example
The following example shows the SET-GENERATIONS command:
set-generations=(product,5,time,1 )
SET-LEVELS
Syntax
Set-levels=(dimension, level, dimension, level,...,...)
Description
Extends the dimension hierarchy for the previously declared dimension. Set-levels used with only the previous set-members, returns all members under the product hierarchy and the next two generations (Product SubCategory and Brand Name) for the product hierarchy of all products.drink.alcoholic beverages.beer and wine. Set-levels used with the previous set-members and set-generations, returns all members for generation levels 5 through 7 under the product hierarchy of all products.drink.alcoholic beverages.beer and wine.
216
Chapter 2
Example
The following example shows the SET-LEVELS command:
set-levels=(product,2 )
SET-MEMBERS
Syntax
set-members=(dimension, hierarchy, dimension, hierarchy,..., ...)
Description
Returns the set of members in a dimension, level, or hierarchy whose name is specified by a string.
Example
Returns the set of members in the dimension product at the specific hierarchy of all products, at a specific level of drink, at a specific level of alcoholic beverages, at a specific level of beer and wine. Returns the set of members in the dimension time at the specific hierarchy of 2004, at the specific level of Q1, at the specific level of 2.
set-members=(product,all products.drink.alcoholic beverages.beer and wine,time,2004.Q1.2)
SHOW
Syntax
SHOW[cursor_position] [CLEAR-SCREEN|CS|CLEAR-LINE|CL][any_lit|_var|_col] [EDITedit_mask|NUMBER|MONEY|DATE][BOLD][BLINK] [UNDERLINE][REVERSE][NORMAL][BEEP][NOLINE]...
Description
Displays one or more variables or literals on the screen. In addition, cursor control is supported for ANSI terminals. Any number of variables and screen positions can be used in a single command. Each one is processed in sequence. Screen locations can be indicated by either fixed or relative positions in the format (A,B), where A is the line and B is the column on the screen. A and/or B can also be numeric variables. Relative positions depend on where the previous SHOW command ended. If the line was advanced, the screen cursor is usually immediately to the right of the previously displayed value and one line down. Fixed or relative cursor positioning can be used only within the boundaries of the terminal screen. Scrolling off the screen using relative positioning, for example (+1,1), is not supported. Instead, use a SHOW command without any cursor position when you want to scroll. Also, you cannot mix SHOW and DISPLAY commands while referencing relative cursor positions. The SHOW command does not advance to the next line if a cursor location (...), CLEAR-SCREEN, CLEAR-LINE, or BEEP is used. (A SHOW command without any of these arguments automatically advances the line.) To add a line advance, add (+1,1) to the end of the line or use an extra empty SHOW command.
217
Chapter 2
Only ANSI terminals are supported for cursor control, screen blanking, line blanking, and display characteristics. Dates can be contained in a date variable or column, or a string literal, column, or variable. When displaying a date variable or column, without an edit mask, the date is displayed according to the following rules: For DATETIME columns and SQR DATE variables, SQR uses the format specified by the SQR_DB_DATE_FORMAT setting. If this has not been set, SQR uses the first database-dependent format as listed in the Default Database Formats table. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT setting. If this has not been set, SQR uses the format listed in the Default Database Formats table. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_FORMAT setting. If this has not been set, SQR uses the format as listed in the TIME Column Formats table. When displaying a date in a string literal, column, or variable using EDIT or DATE, the string must be in the format specified by the SQR_DB_DATE_FORMAT setting, one of the database-dependent formats as listed in the Default Database Formats table, or the database-independent format SYYYYMMDD[HH24[MI[SS[NNNNNN]]]].
218
Chapter 2
Parameters
Parameter cursor_position {CLEAR-SCREEN | CS} {CLEAR-LINE | CL} {any_lit | _var | _col} EDIT NUMBER Description Specifies the position on the screen to begin the display. Clears the screen and sets the cursor position to (1,1). Clears a line from the current cursor position to the end of the line. Specifies the information to be displayed. Shows variables under an edit mask. If the mask contains spaces, enclose it in single quotes. For additional information regarding edit masks, see the PRINT command. Indicates that any_lit|_var|_col is to be formatted using the NUMBER-EDIT- MASK from the current locale. (See the ALTER-LOCALE command.) This option is not valid for date variables. Indicates that any_lit|_var|_col is to be formatted using the MONEY-EDIT- MASK from the current locale. (See the ALTER-LOCALE command.) This option is not valid for date variables. Indicates that any_lit|_var|_col is to be formatted using the DATE-EDIT-MASK from the current locale. (See the ALTER-LOCALE command.) This option is not valid for numeric variables. If DATE-EDIT-MASK has not been specified, the date is displayed using the default format for that database (see the Default Database Formats table). Changes the display of characters on terminals that support those characteristics. Some terminals support two or more characteristics at the same time for the same text. To turn all special display characteristics off, use NORMAL. Turns off all special display characteristics set with BOLD, BLINK, UNDERLINE, and REVERSE. Causes the terminal to beep. Inhibits a line advance.
MONEY
DATE
Example
The following program segments illustrate the various features of the SHOW command:
! ! Show a string using an edit mask ! let $ssn = 123456789 show $ssn edit xxx-xx-xxxx
219
Chapter 2
220
Chapter 2
The following program illustrates the usage of additional options of the SHOW command. Only terminals that support the ANSI escape characters can use the cursor control, screen blanking, line blanking and display attributes.
begin-program ! ! Produces a menu ! show clear-screen (3,30) bold (+2,10) 1. (+1,10) 2. (+1,10) 3. (+1,10) 4.
Accounting Reports for XYZ Company normal Monthly Details of Accounts Monthly Summary Quarterly Details of Accounts Quarterly Summary
! ! Show a line of text and numerics combined ! show (+2,1) The price is #price edit 999.99 ! ! Put an error message on a particular line ! show (24,1) clear-line Error in SQL. Please try again. beep end-program Total = #total edit 99999.99
See Also
The LET command for information about copying, editing, or converting fields. The EDIT parameter of the PRINT command for a description of the edit masks. The ALTER-LOCALE command for a description of the arguments NUMBER-EDIT-MASK, MONEY-EDIT-MASK, and DATE-EDIT-MASK. DISPLAY
221
Chapter 2
STOP
Syntax
STOP [QUIET]
Description
The STOP command halts SQR and executes a ROLLBACK command (not in Sybase, Microsoft SQL Server, or Informix). All report page buffers are flushed, if they contain data; however, no headers or footers are printed and the AFTER-PAGE and AFTER-REPORT procedures are not executed. STOP is useful in testing.
Parameters
Parameter QUIET Description Causes the report to complete with the "SQR: End Of Run" message, instead of ending with an error message.
Example
The following example shows the STOP command:
if #error-status = 1 rollback stop else commit stop quiet end-if
STRING
Syntax
STRING {src_any_lit|_var|_col}...BY {delim_txt_lit|_var|_col} INTO dst_txt_var
Description
Concatenates a list of variables, columns, or literals into a single text variable. Each member of the list separated by the specified delimiter string. The destination string must not be included in the list of source strings.
222
Chapter 2
Parameters
Parameter {src_any_lit|_var|_col} Description Specifies one or more fields to be concatenated, separated by the delim_txt_lit|_var|_col character or characters, and placed into the dst_txt_var variable. If the source is a date variable or column, it is converted to a string according to the following rules: For DATETIME columns and SQR DATE variables, SQR uses the format specified by the SQR_DB_DATE_FORMAT setting. If this has not been set, SQR uses the first database-dependent format as listed in the Default Database Formats table. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT setting. If this has not been set, SQR uses the format listed in the Default Database Formats table. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_FORMAT setting. If this has not been set, SQR uses the format as listed in the TIME Column Formats table. Specifies one or more characters to be used as separator characters between the source fields. Specifies the destination field for the concatenated result.
{delim_txt_lit|_var|_col} dst_txt_var
Example
The following example shows the STRING command:
string string &city &state &zip by - into $show-info ! Result: Sam Mann - New York - NY - 11287 &cust_num &entry-date &total by , into $cust-data ! Result: 100014,12-MAR-04,127 ! Use null delimiter. &code1 &code2 &code3 by into $codes123 ! Result: AGL &name
string
See Also
The UNSTRING command for additional information. The "||" concatenation operator in the Operators table under the LET command.
SUBTRACT
Syntax
SUBTRACT {src_num_lit|_var|_col} FROM dst_num_var[ROUND=nn]
Description
SUBTRACT subtracts the first value from the second and moves the result into the second field. When dealing with money-related values (dollars and cents), use decimal variables rather than float variables. Float variables are stored as double precision floating point numbers, and small inaccuracies can appear when subtracting many numbers in succession. These inaccuracies can appear due to the way floating point numbers are represented by different hardware and software implementations.
223
Chapter 2
Parameters
Parameter {src_num_lit | _var | _col} dst_num_var ROUND Description Is subtracted from the contents of dst_num_var. Contains the result after execution. Rounds the result to the specified number of digits to the right of the decimal point. For float variables this value can be from 0 to 15. For decimal variables, this value can be from 0 to the precision of the variable. For integer variables, this argument is not appropriate.
Example
The following example shows the SUBTRACT command:
subtract 1 from #total ! #total - 1 subtract &discount from #price ! #price - &discount
See Also
The ADD command for more information. The LET command for information about complex arithmetic expressions.
TOC-ENTRY
Syntax
TOC-ENTRY TEXT={src_txt_lit|_var|_col} [LEVEL={level_num_lit|_var|_col}]
Description
Enter the text in the table of contents at the desired level.
Parameters
Parameter TEXT LEVEL Description Specifies the text to be placed in the table of contents. Specifies the level at which to place the text. If this argument is not specified, the value of the previous level is used.
Example
The following example shows the TOC-ENTRY command:
toc-entry text = &heading toc-entry text = &caption level=2
See Also
224
Chapter 2
UNSTRING
Syntax
UNSTRING {{src_txt_lit|_var|_col}|{src_date_var|_col}} BY {delim_txt_lit|_var|_col} INTO dst_txt_var...
Description
Copies portions of a string into one or more text variables. Each substring is located using the specified delimiter. The source string must not be included in the list of destination strings. If more destination strings than substrings are found in the source strings, the extra destination strings are each set to an empty string. If more substrings are found in the source string than in the destination strings, the extra substrings are not processed. It is up to the programmer to ensure that enough destination strings are specified. If the source is a date variable or column, it is converted to a string according to the following rules: For DATETIME columns and SQR DATE variables, SQR uses the format specified by the SQR_DB_DATE_FORMAT setting. If this has not been set, SQR uses the first database-dependent format as listed in the Default Database Formats table. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT setting. If this has not been set, SQR uses the format listed in the Default Database Formats table. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_FORMAT setting. If this has not been set, SQR uses the format as listed in the TIME Column Formats table.
Parameters
Parameter {src_txt_lit|_var|_col}|{ src_date_var|_col} delim_txt_lit|_var|_col dst_txt_var Description Specifies the source field to be parsed. Specifies one or more characters to be used to delimit the fields within {src_txt_lit|_var|_col}|{src_date_var|_col} Specifies one or more destination fields to receive the results.
Example
The following example shows the UNSTRING command:
unstring $show-info by - into $name $city $state $zip unstring $cust-data by , into $cust_num $entry-date $total
See Also
STRING, EXTRACT The substr and instr functions in the Miscellaneous Functions table under the LET command.
225
Chapter 2
UPPERCASE
Syntax
UPPERCASE txt_var
Description
Converts a string variable to uppercase.
Parameters
Parameter txt_var Description Specifies a text variable to be converted to uppercase.
Example
The following example shows the UPPERCASE command:
input $state Enter state abbreviation ! Force uppercase. uppercase $state
See Also
The upper function in the Miscellaneous Functions table under the LET command.
USE
Syntax
USE database
Description
Uses the named database, rather than the default database associated with your username. (Sybase and Microsoft SQL Server only.) Use USE in the SETUP section only. When used, it must appear at the top of your report, before any queries are defined. To reference more than one database in a program, specify secondary databases explicitly. For example:
from sqdb.sqr.customers
You cannot issue the Sybase or Microsoft SQL Server USE command from within an SQL paragraph.
Parameters
Parameter database Description Specifies the name of the database to use.
Example
The following example shows the USE command:
begin-setup
226
Chapter 2
See Also
USE-COLUMN
Syntax
USE-COLUMN {column_number_int_lit|_var|_col}
Description
Sets the current column. The column must be previously defined with the COLUMNS command. To stop printing within columns, use a column number of 0 (zero). Printing returns to normal; however, the columns remain defined for subsequent NEXT-COLUMN or USE-COLUMN commands.
Parameters
Parameter {column_number_int_lit|_ var|_col} Description Specifies the number of the defined column (not the location on the page). For example, if five columns are defined, the column_number_int_lit|_var|_col can be 1 to 5.
Example
The following example shows the USE-COLUMN command:
use-column 3 print #total use-column 0 () ! Print total in 3rd column. 999,999 ! End of column printing.
USE-PRINTER-TYPE
Syntax
USE-PRINTER-TYPE printer-type
Description
Sets the printer type to be used for the current report. The USE-PRINTER-TYPE command sets or alters the printer type to be used for the current report. The USE-PRINTER-TYPE command must appear before the first output is written to that report. If output has already been written to the report file, the USE-PRINTER-TYPE command is ignored.
227
Chapter 2
Parameters
Parameter printer-type Description Specifies the printer type to be used for the current report. See DECLARE-PRINTER for valid types.
Example
The following example shows the USE-PRINTER-TYPE command:
use-report customer_orders use-printer-type PostScript print (1, 1) Customer Name: print () $customer_name
See Also
USE-PROCEDURE
Syntax
USE-PROCEDURE [FOR-REPORTS=(report_name1[,report_namei]...)] [BEFORE-REPORT=procedure_name[(arg1[,argi]...)]] [AFTER-REPORT=procedure_name[(arg1[,argi]...)]] [BEFORE-PAGE=procedure_name[(arg1[,argi]...)]] [AFTER-PAGE=procedure_name[(arg1[,argi]...)]]
Description
Changes the procedure usage. The USE-PROCEDURE must be issued in the PROGRAM or PROCEDURE sections of an SQR program. USE-PROCEDURE is a runtime command; its compile-time equivalent is DECLARE-PROCEDURE. You can use the command as often as required to change to the necessary procedures required by the reports. If you issue multiple USE-PROCEDURE commands, each remains in effect for that report until altered by another USE-PROCEDURE command for that report. In this way, you can use one to change common procedures for ALL reports and others to change unique procedures for individual reports. The referenced procedures can accept arguments. If no FOR-REPORTS is specified, ALL is assumed. Initially, the default for each of the four procedure types is NONE. If a procedure is defined in one DECLARE-PROCEDURE for a report, that procedure is used unless NONE is specified. You can change the BEFORE-REPORT only before the first output is written to that report, because that causes the BEFORE-REPORT procedure to be executed.
228
Chapter 2
Parameters
Parameter FOR-REPORTS Description Specifies the reports that are to use these procedures. This argument is required only for a program with multiple reports. If you are writing a program that produces a single report, you can ignore this argument. Specifies a procedure to execute at the time of execution of the first command, which causes output to be generated. You can use the command, for example, to create a report heading. Specifies a procedure to execute just before the report file is closed at the end of the report. This argument can be used to print totals or other closing summary information. If no report was generated, the procedure does not execute. Specifies a procedure to execute at the beginning of every page, just before the first output command for the page. It can be used, for example, to set up page totals. Specifies a procedure to execute just before each page is written to the file. This argument can be used, for example, to display page totals. You can also specify arguments to be passed to the procedure. Arguments can be any variable, column, or literal.
BEFORE-REPORT
AFTER-REPORT
BEFORE-PAGE AFTER-PAGE
Example
The following example shows the USE-PROCEDURE command:
use-procedure for-reports=(all) before-report=report_heading after-report=report_footing use-procedure ! These procedures will for-reports=(customer) before-page=page_setup after-page=page_totals use-procedure for-reports=(summary) after-report=none ! be used by the customer ! report ! These procedures will ! be used by all reports
See Also
DECLARE-PROCEDURE
229
Chapter 2
USE-REPORT
Syntax
USE-REPORT {report_name_lit|_var|_col}
Description
For programs with multiple reports, enables the user to switch between reports. The USE-REPORT command specifies to which report files the subsequent report output is to be written. An application can contain several USE-REPORT statements to control several reports. You must specify the report name and report characteristics in a DECLARE-REPORT paragraph and in the associated DECLARE-LAYOUT and DECLARE- PRINTER paragraphs.
Parameters
Parameter {report_name_lit|_var|_col} Description Specifies the report to become the current report. All subsequent PRINT and PRINT-DIRECT statements are written to this report until the next USE- REPORT is encountered.
Example
The following example shows the USE-REPORT command:
use-report customer_orders use-printer-type PostScript print (1, 1) Customer Name: print () $customer_name
See Also
WHILE
Syntax
WHILE logical_expression
Description
Begins a WHILE ... END-WHILE loop. The WHILE loop continues until the condition being tested is FALSE. An expression returning 0 (zero) is considered FALSE; an expression returning nonzero is TRUE.
230
Chapter 2
BREAK causes an immediate exit of the WHILE loop; SQR continues with the command immediately following END-WHILE. WHILE commands can be nested to any level and can include or be included within IF and EVALUATE commands.
Parameters
Parameter logical_expression Description A valid logical expression. See the LET command for a description of logical expressions.
Example
This example shows an IF nested within a WHILE:
while #count < 50 do get_statistics if #stat_count = 100 break ! Exit WHILE loop. end-if add 1 to #count end-while
You can use single numeric variables in your expression to make your program more readable, for example when using flags:
move 1 to #have_data ... while #have_data ...processing... end-while
Any complex expression can be used in the WHILE command, as shown in this example:
while #count < 100 and (not #end-file or isnull(&state)) ... end-while
See Also
231
Chapter 2
WRITE
Syntax
WRITE {filenum_lit|_var|_col} FROM {{{txt_lit|_var|_col}|{date_var|_col}|num_col} [:len_int_lit]}|{num_lit|_var:len_int_lit}}... [STATUS=status_num_var]
Description
Writes a record to a file from data stored in variables, columns, or literals. The file must already be opened for writing. If length is specified, the variable is either truncated at that length or padded with spaces to that length. If length is not specified (for string variables or database columns), the current length of the variable is used. When writing numeric variables, the length argument is required. Only 1, 2, or 4 byte binary integers are written. Floating point values are not supported directly in the WRITE command. However, you can first convert floating point numbers to strings and then write the string. When writing binary data the file must be open using the FIXED or FIXED-NOLF qualifiers. The file is not portable across platforms because binary numbers are represented differently. When writing a date variable or column, the date is converted to a string according to the following rules: For DATETIME columns and SQR DATE variables, SQR uses the format specified by the SQR_DB_DATE_FORMAT setting. If this has not been set, SQR uses the first database-dependent format as listed in the Default Database Formats table. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_FORMAT setting. If this has not been set, SQR uses the format listed in the DATE Column Formats table. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_FORMAT setting. If this has not been set, SQR uses the format as listed in the TIME Column Formats table. Text literals take the length of the literal. Files opened for writing are treated as having variable-length records. If you need a fixed-length record, specify a length for each variable written to the file. The total length of the variables and literals being written must not be greater (but can be less) than the record length specified when the file was opened. Records are not padded, but are written with the total length of all variables in the WRITE command. If STATUS is specified, SQR returns 0 if the write is successful; otherwise, it returns the value of errno, which is system-dependent.
232
Chapter 2
Parameters
Parameter filenum_lit|_var |_col {{txt_lit|_var|_col}| {date_var|_col}|num_col} [:len_int_lit]}| {num_lit|_var:len_int_lit} STATUS Description Specifies the number assigned in the OPEN command to the file to be written. Specifies one or more variables to be written. len_int_lit specifies the length of each field of data.
Example
The following example shows the WRITE command:
write 5 from $name:20 $city:15 $state:2 write 17 from $company - $city - $state $zip write #j2 from #rate:2 #amount:4 #quantity:1 move #total to $tot 99999.99 ! Convert floating point to string. write 1 from $tot let $date1 = datenow() ! Put the current date and time ! into DATE variable write 3 from $date1:20
See Also
233
Chapter 2
234
CHAPTER 3
See Also
Enterprise PeopleTools 8.49 PeopleBook: SQR for PeopleSoft Developers, Generating and Publishing HTML from an SQR Program
235
Chapter 3
Procedure html_br
Description Produces the specified number of line breaks in a paragraph by using the HTML<BR> tag. The paragraph continues onto the next line. Syntax:
html_br(number count, string attributes)
count: The number of HTML <BR> tags that are inserted. attributes: The HTML attributes that are incorporated inside the HTML <BR> tag. Example:
print Here is some text () do html_br(3,) print Here is some text three lines down ()
html_center
Marks the start of text to be centered on the HTML document by using the HTML <CENTER> tag. You can also accomplish this by using the SQR print statement with CENTER specified in the code. Syntax:
html_center()
attributes: The HTML attributes that are incorporated inside the HTML <CENTER> tag. Example:
do html_center() print Here is some centered text () do html_center_end
html_center_ end
Marks the end of text that was previously specified as centered. Syntax:
html_center_end
html_hr
Produces a horizontal divider between sections of text by using the HTML <HR> tag. Syntax:
html_hr(string attributes)
attributes: The HTML attributes that are incorporated inside the HTML <HR> tag. Example:
print Here is some text () do html_hr() print Text after a horizonal divider ()
236
Chapter 3
Procedure html_img
Description Inserts an image by using the HTML <IMG> tag. You can also do this by using the PRINT-IMAGE command; however, the html_img procedure enables you to specify the full set of available HTML attributes. Syntax:
html_img(string attributes)
attributes: The HTML attributes that are incorporated inside the HTML <IMG> tag. Some common attributes include: src: The URL of the image to be inserted. Example: src=/images/abc.gif height: The height of the image in pixels. Example: height=200 width: The width of the image in pixels. Example: width=400 Example:
do html_img(src="/images/stop.gif")
html_nobr
Marks the start of text that cannot be wrapped by using the HTML <NOBR> tag. Syntax:
html_nobr
Example:
do html_nobr() print Long line of text that shouldnt wrap () do html_nobr_end
html_nobr_end
Marks the end of text that cannot be wrapped by using the HTML </NOBR> tag. Syntax:
html_nobr_end
html_on
Activates the HTML procedures. Call this procedure at the start of an SQR program; otherwise, the HTML procedures are not activated. After the HTML procedures are activated, format the appearance of the web page by using the various HTML procedures. Syntax:
html_on
Example:
do html_on
237
Chapter 3
Procedure html_p
Description Marks the start of a new paragraph by using the HTML <P> tag. Syntax:
html_p(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <P> tag. A common attribute is align = left|right|center, which specifies the alignment of the paragraph. Example:
do html_p(ALIGN=RIGHT) print Right aligned text (1,1) do html_p_end print Normally aligned text (+1,1)
html_p_end
Marks the end of a paragraph by using the HTML </P> tag. The end of a paragraph is typically implied and the procedure is technically not needed; however, its good practice to specify it for completeness. Syntax:
html_p_end
238
Chapter 3
Procedure html_set_body_attributes
Description Specifies the attributes that are incorporated into the HTML <BODY> tag. Call this procedure at the start of the SQR program. Syntax:
html_set_body_attributes(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <BODY> tag. Some common attributes include: background: Specifies the image to display in the background of the web page. Example: background=/images/logo.gif bgcolor=#rrggbb: Specifies the background color of the web page. Example: bgcolor=#80FFF Example:
do html_set_body_attributes(BACKGROUND=" /images/x.gif")
html_set_head_tags
Specifies the tags that are incorporated between the HTML <HEAD> and </HEAD> tags. These are empty by default. One common tag to set is the HTML <TITLE> tag, which specifies the title to display for the web page. Call this procedure at the start of the SQR program. Syntax:
html_set_head_tags(string attributes)
attributes: Defines the HTML attributes that are incorporated between the HTML <HEAD> and </HEAD> tags. Example:
do html_set_head_tags(<TITLE>My Report< /TITLE>)
239
Chapter 3
Procedure html_h1
Description Marks the start of text for heading level one by using the HTML <H1> tag. This heading text appears more prominently than heading level two. Syntax:
html_h1(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <H1> tag. Example:
do html_h1() print This is a heading () do html_h1_end
html_h1_end
Marks the end of text for heading level one by using the HTML </H1> tag. Syntax:
html_h1_end
html_h2
Marks the start of text for heading level two by using the HTML <H2> tag. This heading text appears less prominently than heading level one and more prominently than heading level three. Syntax:
html_h2(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <H2> tag. Example:
do html_h2() print This is a heading () do html_h2_end
html_h2_end
Marks the end of text for heading level two by using the HTML </H2> tag. Syntax:
html_h2_end
240
Chapter 3
Procedure html_h3
Description Marks the start of text for heading level three by using the HTML <H3> tag. This heading text appears less prominently than heading level two and more prominently than heading level four. Note. This heading level is the default value. Syntax:
html_h3(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <H3> tag. html_h3_end Marks the end of text for heading level three by using the HTML </H3> tag. Syntax:
html_h3_end
html_h4
Marks the start of text for heading level four by using the HTML <H4> tag. This heading text appears less prominently than heading level three and more prominently than heading level five. Syntax:
html_h4(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <H4> tag. html_h4_end Marks the end of text for heading level four by using the HTML </H4> tag. Syntax:
html_h4_end
html_h5
Marks the start of text for heading level five by using the HTML <H5> tag. This heading text appears less prominently than heading level four and more prominently than heading level six. Syntax:
html_h5(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <H5> tag.
241
Chapter 3
Procedure html_h5_end
Description Marks the end of text for heading level five by using the HTML </H5> tag. Syntax:
html_h5_end
html_h6
Marks the start of text for heading level six by using the HTML <H6> tag. This heading text appears less prominently than heading level five. Syntax:
html_h6(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <H6> tag. html_h6_end Marks the end of text for heading level six by using the HTML </H6> tag. Syntax:
html_h6_end
attributes: Defines the HTML attributes that are incorporated inside the HTML <BLINK> tag. Example:
do html_blink() print This is blinking text () do html_blink_end
html_blink_end
Marks the end of blinking style by using the HTML </BLINK> tag. Syntax:
html_blink_end
242
Chapter 3
Procedure html_cite
Description Marks the start of text in citation style by using the HTML <CITE> tag. Syntax:
html_cite(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <CITE> tag. Example:
do html_cite() print This is a citation () do html_cite_end
html_cite_end
Marks the end of text in citation style by using the HTML </CITE> tag. Syntax:
html_cite_end
html_code
Marks the start of text in code style by using the HTML <CODE> tag. Syntax:
html_code(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <CODE> tag. Example:
do html_code() print Here is code style text () do html_code_end
html_code_end
Marks the end of text in code style by using the HTML </CODE> tag. Syntax:
html_code_end
243
Chapter 3
Procedure html_kbd
Description Marks the start of text in keyboard input style by using the HTML <KBD> tag. Syntax:
html_kbd(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <KBD> tag. Example:
do html_kbd() print Here is keyboard style text () do html_kbd_end
html_kbd_end
Marks the end of text in keyboard style by using the HTML </KBD> tag. Syntax:
html_kbd_end
html_samp
Marks the start of text in sample style by using the HTML <SAMP> tag. Syntax:
html_samp(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <SAMP> tag. Example:
do html_samp() print Here is sample style text () do html_samp_end
html_samp_end
Marks the end of text in sample style by using the HTML </SAMP> tag. Syntax:
html_samp_end
244
Chapter 3
Procedure html_strike
Description Marks the start of text in strikethrough style by using the HTML <STRIKE> tag. Syntax:
html_strike(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <STRIKE> tag. Example:
do html_strike() print Here is strikethrough text () do html_strike_end
html_strike_end
Marks the end of text in strikethrough style by using the HTML </STRIKE> tag. Syntax:
html_strike_end
html_sub
Marks the start of text in subscript style by using the HTML <SUB> tag. Syntax:
html_sub(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <SUB> tag. Example:
print Here is () do html_sub() print subscript text () do html_sub_end
html_sub_end
Marks the end of text in subscript style by using the HTML </SUB> tag. Syntax:
html_sub_end
245
Chapter 3
Procedure html_sup
Description Marks the start of text in superscript style by using the HTML <SUP> tag. Syntax:
html_sup(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <SUP> tag. Example:
print Here is () do html_sup() print superscript text () do html_sup_end
html_sup_end
Marks the end of text in superscript style by using the HTML </SUP> tag. Syntax:
html_sup_end
246
Chapter 3
Procedure html_a
Description Marks the start of a hypertext link by using the HTML <A> tag. When the user clicks the area with the hypertext link, the web browser switches to the specified HTML document. Syntax:
html_a(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <A> tag. At a minimum, you should define the href attribute, which specifies the URL of an HTML document. Some common attributes include: href: Indicates where the hypertext link points. Example: href=home.html name: Indicates an anchor to which a hypertext link can point. Example: name=marker1 Example: The anchor is positioned at the top of the document. The first hypertext link points to the HTML document named otherdoc.html. The second hypertext link points to the anchor named TOP.
do html_a(NAME=TOP) do html_a_end print At the top of document () do html_br(20, ) do html_a(HREF=otherdoc.html) print Go to other document () do html_a_end do html_p() do html_a(HREF=#TOP) print Go to top of document () do html_a_end
html_a_end
Marks the end of a hypertext link by using the HTML </A> tag. Syntax:
html_a_end
247
Chapter 3
Procedure html_dd
Description Marks the start of a definition in a definition list by using the HTML <DD> tag. Syntax:
html_dd(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <DD> tag. html_dd_end Marks the end of a definition in a definition list by using the HTML </DD> tag. The end of a definition in a definition list is typically implied and not needed; however, its good form to specify it for completeness. Syntax:
html_dd_end
html_dir
Marks the start of a directory list by using the HTML <DIR> tag. Syntax:
html_dir(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <DIR> tag. Example:
do html_dir() do html_li() print First item () do html_li() print Second item () do html_li() print Last item () do html_dir_end
html_dir_end
Marks the end of a directory list by using the HTML </DIR> tag. Syntax:
html_dir_end
248
Chapter 3
Procedure html_dl
Description Marks the start of a definition list by using the HTML <DL> tag. A definition list displays a list of terms and definitions. The term displays above and to the left of the definition. Use the html_dt procedure to display a term. Use the html_dd procedure to display a definition. Syntax:
html_dl(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <DL> tag. Example:
do html_dl() do html_dt() print A Daisy () do html_dd() print A sweet and innocent flower. () do html_dt() print A Rose () do html_dd() print A very passionate flower. () do html_dl_end
html_dl_end
Marks the end of a definition list by using the HTML </DL> tag. Syntax:
html_dl_end
html_dt
Marks the start of a term in a definition list by using the HTML <DT> tag. Syntax:
html_dt(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <DT> tag. html_dt_end Marks the end of a term in a definition list by using the HTML </DT> tag. Syntax:
html_dt_end
html_li
Marks the start of a list item by using the HTML <LI> tag. Syntax:
html_li(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <LI> tag.
249
Chapter 3
Procedure html_li_end
Description Marks the end of a list item by using the HTML </LI> tag. The end of a list item is typically implied and not needed; however, you should specify it for completeness. Syntax:
html_li_end
html_menu
Marks the start of a menu by using the HTML <MENU> tag. Use the html_li procedure to identify each item in the list. Syntax:
html_menu(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <MENU> tag. Example:
do html_menu() do html_li() print First item () do html_li() print Second item () do html_li() print Last item () do html_menu_end
html_menu_end
Marks the end of a menu by using the HTML </MENU> tag. Syntax:
html_menu_end
html_ol
Marks the start of an ordered list by using the HTML <OL> tag. Each item in the list typically appears indented to the right with a number to the left. Use the html_li procedure to identify each item in the list. Syntax:
html_ol(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <OL> tag. Example:
do html_ol() do html_li() print First item () do html_li() print Second item () do html_li() print Last item () do html_ol_end
250
Chapter 3
Procedure html_ol_end
Description Marks the end of an ordered list by using the HTML </OL> tag. Syntax:
html_ol_end
html_ul
Marks the start of an unordered list by using the HTML <UL> tag. Each item in the list typically appears indented to the right with a bullet to the left. Use the html_li procedure to identify each item in the list. Syntax:
html_ul(string attributes)
attributes: defines the HTML attributes that are incorporated inside the HTML <UL> tag. Example:
do html_ul() do html_li() print First item () do html_li() print Second item () do html_li() print Last item () do html_ul_end
html_ul_end
Marks the end of an unordered list by using the HTML </UL> tag. Syntax:
html_ul_end
251
Chapter 3
Procedure html_caption
Description Marks the start of a table caption by using the HTML <CAPTION> tag. Syntax:
html_caption(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <CAPTION> tag. html_caption_end Marks the end of a table caption by using the HTML </CAPTION> tag. The end of a table caption is typically implied and not needed; however, you should specify it for completeness. Syntax:
html_caption_end
252
Chapter 3
Procedure html_table
Description Marks the start of a table by using the HTML <TABLE> tag. Syntax:
html_table(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <TABLE> tag. Some common attributes include: border: Specifies that a border appears around each cell of the table. width: Specifies the width of the entire table in pixels. cols: Specifies the number of columns in the table. Example: COLS=4 Example: Displaying database records in a tabular format. The html_caption_end, html_tr_end, html_td_end, and html_th_end procedures are used for completeness; however, they are typically implied and not needed.
! start the table & display the column headings do html_table(border) do html_caption() print Customer Records (1,1) do html_caption_end do html_tr() do html_th() print Cust No (+1,1) do html_th_end do html_th() print Name" (,10) do html_th_end do html_tr_end ! display each record begin-select do html_tr() do html_td() cust_num (1,1,6) edit 099999 do html_td_end do html_td() name (1,10,25) do html_td_end do html_tr_end next-listing skiplines=1 need=1 from customers end-select ! end the table do html_table_end
html_table_end
Marks the end of a table by using the HTML </TABLE> tag. Syntax:
html_table_end
253
Chapter 3
Procedure html_td
Description Marks the start of a new column in a table row by using the HTML <TD> tag. This specifies that the text that follows is displayed in the column. Syntax:
html_td(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <TD> tag. html_td_end Marks the end of a column in a table by using the HTML </TD> tag. The end of a column is typically implied and not needed; however, you should specify it for completeness. Syntax:
html_td_end
html_th
Marks the start of a new column header in a table row by using the HTML <TH> tag. This specifies that the text that follows is displayed as the header of the column. Syntax:
html_th(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <TH> tag. html_th_end Marks the end of a column header in a table by using the HTML </TH> tag. The end of a column header is typically implied and not needed; however, you should specify it for completeness. Syntax:
html_th_end
html_tr
Marks the start of a new row in a table by using the HTML <TR> tag. Syntax:
html_tr(string attributes)
attributes: Defines the HTML attributes that are incorporated inside the HTML <TR> tag. html_tr_end Marks the end of a row by using the HTML </TR> tag. The end of a row in a table is typically implied and not needed; however, you should specify it for completeness. Syntax:
html_tr_end
254
CHAPTER 4
-C
255
Chapter 4
Flag -BURST:{xx}
Description Specifies the type of bursting to be performed. -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 TOC- ENTRY commands LEVEL argument. In -BURST:S[ {l} ], l is the level at which to burst. The -BURST:S setting is equivalent to -BURST:S1. -BURST:P generates the report output by report page numbers. In -BURST:P[ {l} , {s} [, {s}] ] ] , l is the number of logical report pages that each .htm file contains and s is the page selection: n, n-, m, -m, or n-. The -BURST:P setting is equivalent to -BURST:P0,1when using -PRINTER:HT or -BURST:P1 when using -PRINTER:EH. 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.
-CB -Dnn
(Microsoft Windows) Forces the communication box. (Non-Microsoft Windows) Causes SQR to display the report output on the terminal at the same time that it is being written to the output file. The nn is the maximum number of lines to display before pausing. If you dont enter a number after -D, the display scrolls continuously. The printer type must be LP; otherwise SQR does not display any output. If the program is producing more than one report, SQR displays only the first report. (Sybase) Causes the SQR program to use the specified database, overriding any USE command in the SQR program. Directs error messages to the named file or to the default file, program.err. If no errors occur, no file is created. Specifies the directory location of the enhanced HTML applets. The default directory for theses applets is IMAGES. Note. The -EH flags in this table are applicable only when either the -PRINTER:EH or -PRINTER:EP flag is specified.
-DBdatabase
-E[file]
-EH_APPLETS:dir
256
Chapter 4
Flag -EH_BQD
Description Generates a {report}.bqd file from the report data. Also associates a BQD icon with {report}.bqd in the navigation bar. Associates the BQD icon with the specified file. Specifies the target browser. When set to ALL, SQR automatically determines which browser is being used, invokes a browser-specific file, and generates HTML that is designed for that browser. When set to BASIC, SQR generates HTML that is suitable for all browsers. When set to IE, SQR generates HTML that is designed for Microsoft Internet Explorer. When set to NETSCAPE, SQR generates HTML that is designed for Netscape.
-EH_BQD:file -EH_BROWSER:xx
Generates a {report}.csv file from the report data. Associates the CSV icon with the specified file. Creates a CSV file, but does not create an HTML file. Switches between HTML 3.0 and HTML 3.2. When set to TRUE, SQR generates HTML 3.2. When set to FALSE, SQR generates HTML 3.0 Specifies the directory in for the referenced icons. Sets the language that is used for the HTML navigation bar. You can specify English, French, German, Portuguese, Spanish, Japanese, Simplified Chinese, and Korean. Associates a PDF icon with {report}.pdf in the navigation bar. Sets the scaling factor from 50 to 200.
-EH_Icons:dir -EH_LANGUAGE:xx
-EH_PDF
-EH_Scale:{nn}
257
Chapter 4
Flag -F[file|directory]
Description 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 the file name and directory for different operating systems: UNIX\Linux MVS
-GPRINT=YES | NO
(MVS) -GPRINT=YES causes ANSI control characters written to the first column of each record of the SQR output file. Displays the copyright banner on the console. In addition to .lis files, creates an .spf file for each report that the program generates. Prevents the creation of .lis files. Instead, .spf files are created. Directs log messages to the specified file or to programt.log, if no file is specified. By default, the sqr.log file is used in the current working directory. (MVS) Suppresses printer control characters from column 1. (Informix) Causes column data to retain trailing blanks.
-ID -KEEP
-NOLIS
-O[file]
-P
-PB
258
Chapter 4
Flag -PRINTER:xx
Description Causes printer type xx to be used when creating output files: EH EP HP HT LP PD PS WP Types LP, HP, and PS produce files with the .lis extension. Types EH and HT produce .htm file output. Type HT produces files in HTML version 2.0 with the report content inside the <PRE></PRE> tags. Type EH produces reports in which content is fully formatted with HTML version 3.0 or 3.2 tags. On Microsoft Windows systems, the WP extension sends the output to the default Microsoft Windows printer. To specify a nondefault Microsoft Windows printer, enter -PRINTER:WP:{printer name}. The {printer name} is the name that is assigned to the printer. For example, to send output to a Microsoft Windows printer named NewPrinter, use - PRINTER:WP:NewPrinter. If the printer name has spaces, enclose the entire argument in quotes. If you also want to create an .spf file, use -KEEP.
-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 that each was compiled and run, and the total number of rows selected. Specifies that you want to test the report for nn pages. SQR ignores all Order By clauses in Select statements to save time during testing. If the program is producing more than one report, SQR stops after the specified number of pages that are defined for the first report have been printed.
-Tnn
259
Chapter 4
Flag -T{B|Z|BZ|ZB}
Description (IBM MVS and DB2): -TB prevents SQR from removing trailing blanks from database character columns. -TZ prevents SQR from removing trailing zeros from the decimal portion of numeric columns. -TBZ or -TZB prevents both. (Windows/DB2, Sybase CT-Lib, and ODBC): -TB trims trailing blanks from database character columns. Note. The -TB flag only has an effect if SQR is connecting to either a DB2, Sybase CT LIB, or ODBC (MSS) database. Confusingly, the behavior of the -TB command-line flag varies depending on your platform. If you are using one of the above mentioned databases and are running SQR on z/OS, the -TB flag will behave as follows: 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: If you do not use the -TB flag, trailing blanks are not trimmed. If you do use the -TB flag, trailing blanks are trimmed.
-Vserver -XB
(Sybase) Uses the named server. (Non-Microsoft Windows) Suppresses the SQR banner and the SQR.... End of Run message. (Microsoft Windows) Does not use the communication box.
-XCB
260
Chapter 4
Flag -XL
Description Prevents SQR from signing in to the database. Programs that are run in this mode cannot contain any SQL statements. -XL enables you to run SQR 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 Some database files must be available for SQR to run whether SQR signs in to the database or not. See information about your particular operating system and database to determine which files you need.
-XMB
(Microsoft Windows) Disables the error message display so that a program can be run without interruption by error message boxes. Error messages are sent only to an .err file. See the -E flag for more information. Prevents SQR 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. (Sybase DBLib) Prevents SQR from creating temporary stored procedures. See BEGIN-SELECT for more information. Preserves the trailing blanks in an .lis file at the end of a line. Prevents SQR from generating the table of contents for the report. SQR ignores this flag when -PRINTER:EH or - PRINTER:HT is also specified. Sets the full path and name of the SQR initialization file, sqr.ini. 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. Specifies the full path and name of the SQR error message file, sqrerr.dat.
-XNAV
-XP
-XTB
-XTOC
-ZIF{file}
-ZIV
-ZMF{file}
261
Chapter 4
See Also
Chapter 1, Understanding SQR for PeopleSoft, SQR Command-Line Arguments, page 4
262
CHAPTER 5
The following table describes spf-file and flags. SQR Print writes an .lis file with the same name as the .spf file, but with the lis extension. You can override this name with the -F command-line flag. The -PRINTER command-line flag specifies the printer type. SQR offers several options: Line printer HP LaserJet PostScript HTML Enhanced HTML Adobe PDF Enhanced HTML and Adobe PDF If the report contains graphics and you select a line printer, SQR Print ignores graphic elements (such as lines, boxes, and charts) and prints only text.
263
Chapter 5
-BURST:{xx}
-E[file]
264
Chapter 5
Flag -EH_APPLETS:dir
Description Specifies the directory location of the enhanced HTML applets. The default directory for theses applets is IMAGES. Generates a {report}.bqd file from the report data. Also associates a BQD icon with {report}.bqd in the navigation bar. Associates the BQD icon with the specified file. Specifies the target browser. When set to ALL, SQR automatically determines which browser is being used, invokes a browser-specific file, and generates HTML that is designed for that browser. When set to BASIC, SQR generates HTML that is suitable for all browsers. When set to IE, SQR generates HTML that is designed for Microsoft Internet Explorer. When set to NETSCAPE, SQR generates HTML that is designed for Netscape.
-EH_BQD
-EH_BQD:file -EH_BROWSER:xx
Generates a {report}.csv file from the report data. Associates the CSV icon with the specified file. Creates a CSV file, but does not create an HTML file. Switches between HTML 3.0 and HTML 3.2. When set to TRUE, SQR generates HTML 3.2. When set to FALSE, SQR generates HTML 3.0
-EH_Icons:dir
Specifies the directory in which the HTML should find the referenced icons. Sets the language that is used for the HTML navigation bar. You can specify English, French, German, Portuguese, Spanish, Japanese, Simplified Chinese, or Korean. Associates a PDF icon with {report}.pdf in the navigation bar.
-EH_LANGUAGE:xx
-EH_PDF
265
Chapter 5
Description Sets the scaling factor from 50 to 200. Overrides the default output file name, program.lis. The default action places program.lis 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 MVS
-ID -O[file]
Displays the copyright banner on the console. Directs log messages to the specified file or to programt.log if no file is specified. By default, the sqr.log file is used in the current working directory. (IBM MVS) Suppresses printer control characters from column 1.
-P
266
Chapter 5
Flag -PRINTER:xx
Description Causes SQR to use printer type xx when creating output files: EH EP HP HT LP PD Types LP, HP, and PS produce files with the .lis extension. Types EH and HT produce .htm file output. On Microsoft Windows systems, the WP extension sends the output to the default Microsoft Windows printer. To specify a nondefault Microsoft Windows printer, enter -PRINTER:WP:{printer name}. The {printer name} is the name that is assigned to the printer. For example, to send output to a Microsoft Windows printer named NewPrinter, use -PRINTER:WP:NewPrinter.If your printer name has spaces, enclose the entire argument in quotes. If you also want to create an .spf file, use -KEEP.
-XB
(Non-Microsoft Windows) Suppresses the SQR banner and the SQR.... End of Run message. Prevents SQR 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. Preserves the trailing blanks in a .lis file at the end of a line. Prevents SQR from generating the table of contents for the report. This flag is ignored when -PRINTER:EH or -PRINTER:HT is also specified. Sets the full path and name of the SQR initialization file, sqr.ini. Specifies the full path and name of the SQR error message file, sqrerr.dat.
-XNAV
-XTB
-XTOC
-ZIF{file}
-ZMF{file}
267
Chapter 5
268
CHAPTER 6
269
Chapter 6
Note. Two older commands, DECLARE PRINTER and DECLARE PROCEDURE, do not contain hyphens. The new commands, DECLARE-PRINTER and DECLARE-PROCEDURE, contain hyphens.
BEGIN-REPORT
You should no longer use this command because it may be discontinued in a future release. To use the newer SQR functionality, use BEGIN-PROGRAM.
Syntax
Use this syntax:
BEGIN-REPORT
Description
Begins a report. After processing the commands in the SETUP section, SQR starts running the program at the BEGIN-REPORT section. The PROGRAM section typically contains a list of DO commands, though you can also use other commands. This is the only required section in an SQR program.
Example
For example:
begin-report do startup do main do finish end-report
DATE-TIME
You should no longer use this command because it may be discontinued in a future release. To use the newer SQR functionality, use the datenow function in the LET command.
Syntax
Use this syntax:
DATE-TIME position [date_format[col_var]]
270
Chapter 6
Description
Retrieves the current date and time from the local machine (or from the database for Oracle and some IBM DB2 platforms) and places it in the output file at the specified position or into a column variable. If col_var is specified, date_format must be supplied and the current date and time is retrieved each time this command is run. Otherwise, the date is retrieved only at the program start, and the same date and time is printed each time. If date_format is not specified, the date is returned in the default format for that database. The following table provides the default date-time formats for SQR-supported databases:
Database Oracle Informix Default Date-Time Format DD-Mon-YYYY HH:MI PM YYYY-MM-DD HH:MI YYYY-MM-DD HH:MI:SS.NNN YYYY-MM-DD-HH:MI YYYY-MM-DDHH:MI:SS.NNNNNN DD-MON-YYYY HH:MI
IBM DB2
Sybase
For some databases, there are two default formats. The first format prints the date-time, as in the following example:
date-time (+1,1)
For those databases with only one default format, that format is always used in either of these cases. See the table showing miscellaneous functions under the LET command for information about the valid edit mask format codes.
Parameters
position date_format col_var Specifies the position for printing the date. Represents a string literal containing the date format mask. Places the retrieved date-time into a column variable rather than in the output file.
Example
For example:
date-time (1,50) MM/DD/YY
271
Chapter 6
(1,1) Day Mon DD, YYYY () HH:MI &time (+1,70) MON DD YYYY HH24:MI &datetime (#i, #j) YYYY-MM-DD &date1
See the $current-date reserved and datenow functions that are described in the table showing miscellaneous functions under the LET command. See ALTER-LOCALE
DECLARE PRINTER
You should no longer use this command because it may be discontinued in a future release. To use the newer SQR functionality, use DECLARE-LAYOUT and DECLARE-PRINTER.
Syntax
Use this syntax:
DECLARE PRINTER [TYPE=printer_type_lit] [ORIENTATION=orientation_lit] [LEFT-MARGIN=left_margin_num_lit] [TOP-MARGIN=top_margin_num_lit] [LINE-SIZE=line_size_num_lit] [CHAR-SIZE=char_size_num_lit] [LINES-INCH=lines_inch_int_lit] [CHARS-INCH=chars_inch_num_lit] [POINT-SIZE=point_size_num_lit] [FONT-TYPE=font_type_txt_lit] [SYMBOL-SET=symbol_set_id_lit] [STARTUP-FILE=file_name_txt_lit] [FONT=font_int_lit] [BEFORE-BOLD=before_bold_string_txt_lit] [AFTER-BOLD=after_bold_string_txt_lit]
Description
Specifies the printer type and sets printer characteristics. Use the DECLARE PRINTER command either in the SETUP section or in the body of the report. Generally, you should use it in the SETUP section. However, if you do not know what type of printer you will be using until the report is run, or if you need to change some of the arguments depending on user selection, you can put several DECLARE PRINTER commands in the body of the report and run the one that you need. The following arguments take effect only once, upon execution of the first PRINT command, and thereafter have no effect even if changed:
LINE-SIZE CHAR-SIZE LINES-INCH CHARS-INCH ORIENTATION
272
Chapter 6
SQR maps its line and column positions on the page by using a grid that is determined by the LINE-SIZE and CHAR-SIZE (or LINES-INCH and CHARS-INCH) arguments. Each printed piece of text is placed on the page by means of this grid. Because the characters in proportional fonts vary in width, a word or string may be wider than the horizontal space that you have allotted, especially in words containing uppercase letters. To account for this behavior, you can either move the column position in the PRINT statement or indicate a larger CHAR-SIZE value in the DECLARE PRINTER command.
Arguments
The following table describes the arguments for the DECLARE PRINTER command:
Argument TYPE Choice or Measure LINEPRINTER, POSTSCRIPT, HPLASERJET Default Value LINEPRINTER Description SQR creates output that is specific to each printer. Line printer files generally contain ASCII characters and can be viewed by a text editor. PostScript files contain ASCII characters, but you need to know PostScript to understand what will appear on the printer. HP LaserJet files are binary files and cannot be edited or viewed. ORIENTATION PORTRAIT, LANDSCAPE PORTRAIT Portrait pages are printed vertically. Landscape pages are printed horizontally. Printing in landscape mode on HP LaserJet printers requires landscape fonts. LEFT-MARGIN inches 0.5 This argument does not apply to line printers. This is the amount of blank space to leave at the left side of the page. TOP-MARGIN inches 0.5 This argument does not apply to line printers. This is the amount of blank space to leave at the top of the page.
273
Chapter 6
Argument LINE-SIZE
Default Value
Description This argument does not apply to line printers. This is the size of each SQR line on the page. There are 72 points per inch. If LINE-SIZE is not specified, it follows the value for POINT-SIZE, if specified. The default value of 12 points yields 6 lines per inch.
CHAR-SIZE
points
7.2
This argument does not apply to line printers. This is the size of each SQR horizontal character column on the page (for example, the distance between the locations [1,12] and [1,13]). If CHAR-SIZE is not specified and the point size is less than 8.6, CHAR-SIZE is set to 4.32, which yields 16.6 characters per inch. The default value of 7.2 yields 10 characters per inch.
LINES-INCH
lines
This argument does not apply to line printers. This is an alternate way of indicating the, in lines per inch rather than in points (as in LINE-SIZE).
CHARS-INCH
characters
10
This argument does not apply to line printers. This is an alternate way of indicating the width of each SQR character column, in characters per inch rather than in points (as in CHAR-SIZE).
274
Chapter 6
Argument POINT-SIZE
Default Value
Description This argument does not apply to line printers. This is the beginning size of the selected font.
FONT-TYPE
PROPORTIONAL, FIXED
This argument applies only to HP LaserJet printers and must be specified only for font types that are not listed as being available for HP LaserJet printers in SQR in the previous DECLARE-PRINTER section. This argument applies only to HP LaserJet printers. The default value, 0U, is for the ASCII symbol set. Additional symbol sets exist. See HP LaserJet Technical Reference Manual.
SYMBOL-SET
HP defined sets
0U
STARTUP-FILE
filename
POSTSCRI.STR
This argument applies only to PostScript printers. Use this to specify an alternate startup file. Unless otherwise specified, the default startup file is located in the directory that is specified by the environment variable SQRDIR.
275
Chapter 6
Argument FONT
Default Value
Description This is the font number of the typeface to use. For HP LaserJet printers, this is the typeface value as defined by Hewlett-Packard. See HP LaserJet Technical Reference Manual. For PostScript printers, SQR supplies a list of fonts and arbitrary font number assignments in the postscri.str file. The font numbers are the same as those for HP LaserJet printers, wherever possible, so that you can use the same font number for reports to be printed on both types of printers. You can modify the font list in postscri.str to add or delete fonts. Read the postscri.str file for instructions. See the fonts that are listed as being available for HP LaserJet printers in SQR in the previous DECLARE-PRINTER section. See also the table that lists the fonts that are available in the SQR postscri.str file, also in the DECLARE-PRINTER section.
276
Chapter 6
Argument BEFORE-BOLD
Description The BEFORE-BOLD and AFTER- BOLD arguments are for line printers only. They specify the character string to turn bold on and off. If the string contains blank characters, enclose it in single quotation marks. To specify nonprintable characters, such as ESC, enclose the decimal value within angle brackets as follows: BEFORE-BOLD=<27>[r ! Turn on bold AFTER-BOLD=<27>[u ! Turn it off These arguments work with the BOLD argument of the PRINT command.
AFTER-BOLD
any string
None
See BEFORE-BOLD.
The font that you choosein orientation, typeface, and point sizemust be an internal font (available in a font cartridge) or downloaded to the printer. For fonts that are not listed as being available for HP LaserJet printers in SQR in the DECLARE-PRINTER section in the SQR Command Reference chapter, you must indicate the font style by using the FONT-TYPE argument; otherwise, the correct typeface cannot be selected by the printer.
DECLARE PROCEDURE
You should no longer use this command because it may be discontinued in a future release. To use the newer SQR functionality, use DECLARE-PROCEDURE.
Syntax
Use this syntax:
DECLARE PROCEDURE [BEFORE-REPORT=procedure_name] [AFTER-REPORT=procedure_name] [BEFORE-PAGE=procedure_name] [AFTER-PAGE=procedure_name]
Description
Defines specific event procedures.
277
Chapter 6
Use the DECLARE PROCEDURE command either in the SETUP section or in the body of the report. You can use the command as often as you like. If you issue multiple DECLARE PROCEDURE commands, the last one takes precedence. In this way, you can turn procedures on and off while the report is running. The referenced procedures do not take any arguments; however, they may be local. In addition, they can print only into the body of the report; that is, they cannot print into the header and footer areas.
Parameters
BEFORE-REPORT AFTER-REPORT Specifies a procedure to run at the time of the first PRINT command. For example, you use this to create a report heading. Specifies a procedure to run just before the report file is closed at the end of the report. Use this to print totals or other closing summary information. If no report was generated, the procedure does not run. Specifies a procedure to run at the beginning of every page, just before the first PRINT command for the page. For example, you use this to set up page totals. Specifies a procedure to run just before each page is written to the file. For example, you use this to display page totals.
BEFORE-PAGE AFTER-PAGE
Example
For example:
declare procedure before-page=page_setup after-page=page_totals
DOLLAR-SYMBOL
You should no longer use this command because it may be discontinued in a future release. To use the newer SQR functionality, use ALTER-LOCALE.
Syntax
Use this syntax:
DOLLAR-SYMBOL new_symbol
Description
Redefines the currency symbol within numeric edit masks . The dollar sign ($) is the default currency symbol for coding edit masks in the program that prints on report listings. DOLLAR-SYMBOL provides a way to change that symbol for both the edit mask and for printing. To change the symbol that prints on the report, use MONEY-SYMBOL in the PROCEDURE section. Use DOLLAR-SYMBOL and MONEY-SYMBOL together to configure SQR programs and the reports that they produce. Use this command only in the SETUP section.
278
Chapter 6
Note. The MONEY-SYMBOL command has the same effect as these options of the ALTER-LOCALE command: MONEY-SIGN and MONEY-SIGN-LOCATION=LEFT. The following table lists the characters that DOLLAR-SYMBOL cannot take:
Type Numbers Alphabetical Symbols 089 benrvBENRV .,-+! *_<>() Character
Parameters
new_symbol Specifies a new, single character to be used in edit masks instead of the dollar sign ($).
Example
For example:
begin-setup dollar-symbol ! Define as the currency symbol end-setup begin-procedure ... print #amount () edit ,999.99 ... end-procedure
In the previous example, if you used the dollar sign in the edit mask after defining the dollar symbol as , the following error message appears:
Bad numeric edit format: $$$,999.99
GRAPHIC FONT
You should no longer use this command because it may be discontinued in a future release. To use the newer SQR functionality, use ALTER-PRINTER and DECLARE-PRINTER to set the FONT, FONT-TYPE, POINT-SIZE, and PITCH.
Syntax
Use this syntax:
GRAPHIC () FONT { font_number_int_lit|_var }
279
Chapter 6
[point_size_int_lit|_var[{1|0} [pitch_int_lit|_var]]]
Description
Changes a font.
Parameters
font_number point_size {1|0} For HP LaserJet printers, the specified font must be installed in the printer. For PostScript printers, the font must be defined in the postscri.str file. If point_size is omitted, the size from the most recent DECLARE-PRINTER or GRAPHIC FONT command is used. This argument is for HP LaserJet printers only. It is needed only if you are using a font that SQR does recognize. (See the fonts that are listed as being available for HP LaserJet printers in SQR in the DECLARE-PRINTER section in the chapter SQR Command Reference.) A 1 indicates a proportional font, and a 0 indicates a fixed-pitch font. The default is proportional. If the specified font is fixed pitch, also indicate the pitch in characters per inch.
pitch
Example
For example:
graphic () font graphic () font ! Century Schoolbook, 8.5 points 10 ! Letter Gothic, 12 points, ! fixed, 10 characters per inch graphic () font :#font_number :#point_size 23 8.5 6 12 0
See ALTER-PRINTER and DECLARE-PRINTER for information about setting and changing the FONT, FONT-TYPE, POINT-SIZE, and PITCH.
MONEY-SYMBOL
You should no longer use this command because it may be discontinued in a future release. To use the newer SQR functionality, use ALTER-LOCALE.
Syntax
Use this syntax:
MONEY-SYMBOL new_symbol
Description
Redefines the currency symbol to be printed. To change the symbol that prints on the report, use the MONEY-SYMBOL in the PROCEDURE section. When the MONEY-SYMBOL is set, that value is used until the next MONEY-SYMBOL command runs. Use DOLLAR-SYMBOL and MONEY-SYMBOL together to configure SQR programs and the reports that they produce.
280
Chapter 6
To indicate a nonedit character, surround its decimal value with angle brackets (<>). See the table under the DOLLAR-SYMBOL command for characters that cannot be used with MONEY-SYMBOL. Note. The MONEY-SYMBOL command has the same effect as the MONEY-SIGN and MONEY-SIGN-LOCATION=LEFT options of the ALTER- LOCALE command.
Parameters
new_symbol Specifies a new, single character to replace the dollar sign ($) or DOLLAR-SYMBOL character on the printed report.
Example
For example:
begin-setup dollar-symbol ! Define as the ! currency symbol end-setup begin-procedure! If #Amount=1234.56 ... money-symbol print #Amount () Edit ,999.99 ! Prints as: 1,234.56 ... money-symbol $ print #Amount () Edit ,999.99 ! Prints as: $1,234.56 ... money-symbol print #Amount () Edit ,999.99 ! Prints as: 1,234.56 ... end-procedure
NO-FORMFEED
You should no longer use this command because it may be discontinued in a future release. To use the newer SQR functionality, use the FORMFEED parameter of the DECLARE-LAYOUT command.
Syntax
Use this syntax:
NO-FORMFEED
Description
Prevents form-feed characters from being written to the output file. NO-FORMFEED is useful for certain types of reports; for example, flat file output. It is used only in the SETUP section. Do not write form-feed control characters directly into the output file between pages.
281
Chapter 6
Example
For example:
begin-setup no-formfeed end-setup
See Also
See the FORMFEED qualifier in DECLARE-LAYOUT.
PAGE-SIZE
You should no longer use this command because it may be discontinued in a future release. To use the newer SQR functionality, use the MAX-LINES and MAX-COLUMNS parameters of the DECLARE-LAYOUT command.
Syntax
Use this syntax:
PAGE-SIZE page_depth_num_lit page_width_num_lit
Description
Sets the page size. If you are printing multiple reports, you must use the PAPER-SIZE parameter of the DECLARE-LAYOUT command. This command is used in the SETUP section only. Specify the page depth in lines and the page width in columns. An average report that is printed on 8 1/2 by 11 inch paper might have a page size of 60 lines by 80 columns. A 3-inch by 5-inch sales lead card might have a size of 18 by 50. If the page size is not specified, the default of 62 lines by 132 columns is used. For line printers, SQR stores one complete page in a buffer before writing the page to the output file when you issue a NEW-PAGE command or when a page overflow occurs. You can define a page to be 1 line deep and 4,000 characters wide, which you can use for writing large flat files, perhaps for copying to magnetic tape. Each time a NEW-PAGE occurs, one record is written. Use the NO-FORMFEED command in the SETUP section to suppress form-feed characters between pages. Use a page width that is at least one character larger than the rightmost position that will be written. This prevents unwanted wrapping when printing. When the last column position on a line is printed, the current position becomes the first position of the next line. This can cause confusion when using relative line positioning with the NEXT-LISTING command. Having a wider page than necessary does not waste any file space because SQR trims trailing blanks on each line before writing the report file. Determine the size of the internal page buffer that stores a complete page in memory by multiplying the page depth by the width in the PAGE-SIZE command. For personal computers, the page buffer is limited to 64K bytes. On other computers, the page buffer is limited only by the amount of memory that is available.
282
Chapter 6
Example
For example:
begin-setup page-size end-setup 57 132! 57 lines long by 132 columns wide
See Also
See the PAPER-SIZE parameter of the DECLARE-LAYOUT command.
PRINT CODE
You should no longer use this command because it may be discontinued in a future release. To use the newer SQR functionality, use PRINT CODE-PRINTER. If you use CODE, the sequence is assumed to be for the printer type that is specified in the DECLARE-REPORT or for the default printer, if none is specified.
Syntax
Use this syntax:
PRINT . . . CODE
Parameters
CODE CODE is a qualifier that may be discontinued in a future release. Use CODE-PRINTER instead.
PRINTER-DEINIT
You should no longer use this command because it may be discontinued in a future release. To use the newer SQR functionality, use the RESET-STRING parameter of the DECLARE-PRINTER command.
Syntax
Use this syntax:
PRINTER-DEINIT initialization_string
Description
Sends control or other characters to the printer at the end of a report. Specify nondisplay characters by placing their decimal values inside angle brackets. For example, <27> is the ESC or escape character. The PRINTER-DEINIT command is used only in the SETUP section and is designed for use with line printers. It has limited functionality with HP LaserJet and PostScript printers.
Example
For example:
283
Chapter 6
See Also
See the ENCODE command for another method of printing nondisplay characters. See the chr function in the table listing miscellaneous functions under the LET command in the chapter SQR Command Reference.
PRINTER-INIT
You should no longer use this command because it may be discontinued in a future release. To use the newer SQR functionality, use the INIT-STRING parameter of the DECLARE-PRINTER command.
Syntax
Use this syntax:
PRINTER-INIT initialization_string
Description
Sends control or other characters to the printer at the beginning of a report. Specify nondisplay characters by placing their decimal values inside angle brackets. For example, <27> is the ESC or escape character. The PRINTER-INIT command is used only in the SETUP section and is designed for use with line printers. It has limited functionality with HP LaserJet and PostScript printers.
Example
For example:
begin-setup printer-init<27>[7J ! Set the printer end-setup
See Also
See the ENCODE command for another method of printing nondisplay characters. See the chr function in the table listing miscellaneous functions under the LET command in the chapter SQR Command Reference.
284
CHAPTER 7
Installing PSSQR.INI
The pssqr.ini file is the initialization file for SQR for PeopleSoft . SQR uses the settings and parameters in this file during the compile and execution phases. The installation process installs a default initialization file called pssqr.ini, which is located in the SQR directory under the <PS_HOME> directory. The installation process also installs files named pssqr<language_cd>.ini, which are used to create language-specific configurations.
285
Chapter 7
z/OS
On z/OS, SQRINI is required during initialization. The dataset member &PSHLQ..SQRSRC(PSSQRINI) must be specified in the JCL to start the SQR process.
286
Chapter 7
Entry
ForceSpaceAfterComma= {TRUE|FALSE}
Description The default setting is FALSE. DB2 only: Forces a space after every comma not in a literal value. This is to support DECIMAL=COMMA setting on the OS390.
ShowDBWarnings= {TRUE|FALSE}
TRUE | FALSE
The default setting is FALSE. DB2 only: If set to TRUE, SQR displays database warnings in the SQR output file.
287
Chapter 7
Entry
AllowDateAsChar= {TRUE|FALSE}
Description The default setting is FALSE. By default, SQR produces an error when a dynamic column specification does not match the database definition of the column. That is, character equals character, date equals date, and numeric equals numeric. When this value is set to TRUE, SQR allows character to be equal to either character or date columns. When a date column is type cast to be a character, SQR creates the string according to the following rules: For DATETIME columns, SQR uses the format specified by the SQR_DB_DATE_FORMAT setting. If this has not been set, SQR uses the first database-dependent format as listed in the table showing default database formats in the Edit section under the PRINT command. For DATE columns, SQR uses the format specified by the SQR_DB_DATE_ONLY_ FORMAT setting. If this has not been set, the format listed in the table showing default database formats in the Edit section under the PRINT command. For TIME columns, SQR uses the format specified by the SQR_DB_TIME_ONLY_ FORMAT setting. If this has not been set, SQR uses the format as listed the table showing the TIME column formats in the Edit section under the PRINT command. In the following example, AllowDateAsChar= True. This allows $Col1 to be either date or text.
Begin-Select [$Col1] &col1=Text [$Col2] &col2=Date [$Col3] &col3=Number from MyTable End-Select
288
Chapter 7
Entry
OUTPUT-FILE-MODE
Description Specifies the file name convention used for HTML output. SHORT specifies DOS style (8.3) and LONG specifies UNIX\Linux style (non 8.3). The default is LONG. This setting is ignored on 16-bit platforms. The DECLARE-TOC and -BURST commands force Output-File-Mode = LONG. The following represents the file formats for UNIX\Linux, DOS, and Windows. SQR and SQRT: {Program} is the name of the SQR/SQRT file without the extension.
OUTPUT-FILE-MODE
LONG | SHORT
(Continued) For Output-File-Mode = SHORT, SQR-generated file names are limited to a DOS 8.3 format. Output file = {program}.lis for first, and {program}.lnn for multi-reports SPF file = {program}.spf for first, and {program}.snn for multi-reports PDF file = {program}.pdf for first; and {program}.pnn for multi-reports HTM file = {program}.htm for frame, and {program}.hbb for report bodies GIF file={program}.gxx for all reports bb ranges from 00 to 99 and represents the report number. nn ranges from 01 to 99 and represents the report number. xx ranges from 00 to ZZ and represents the graphic number.
(continued)
289
Chapter 7
Entry
OUTPUT-FILE-MODE
Description
(continued)
For Output-File-Mode = LONG, SQR-generated file names are not constrained to a DOS 8.3 format. {output}={program} of first report and {program}_nn for multi-reports. Output file = {output}..lis SPF file = {output}..spf PDF file = {output}..pdf GIF file = {output}_zz..spf HTM files = {output}..htm, {output}_ bb..htm, {output}_frm..htm, {output}_toc./htm, {output}_nav.htm bb ranges from 01 to ZHJOZI and represents the bursted page group number. nn ranges from 01 to 99 and represents the report number. zz ranges from 00 to ZHJOZI and represent the graphic number.
OUTPUT-FILE-MODE
LONG | SHORT
(Continued) SQRP: {file name} is the name of the SPF file without the extension For Output-File-Mode = SHORT, SQR-generated file names are limited to a DOS 8.3 format. Output file = {file name}.lis GIF file = {file name}.gxx PDF file = {file name}.pdf HTM file = .htm and {file name}.h00 xx ranges from 00 to ZZ and represents the graphic number.
(continued)
290
Chapter 7
Entry
OUTPUT-FILE-MODE
Description
(continued)
For Output-File-Mode = LONG, SQR-generated file names are not limited to a DOS 8.3 format. Output file = {file name}.lis PDF file = {file name}.pdf GIF file = {file name}_zz.spf HTM files = {file name}.htm, {file name}_bb.htm, {file name}_frm.HTM, {file name}_toc.htm {file name}_nav.htm bb ranges from 01 to ZHJOZI and represents the bursted page group number. zz ranges from 00 to ZHJOZI and represents the graphic number.
LOCALE
Specifies the initial locale that SQR loads when the program starts. The value of SYSTEM is used to reference the default locale. See Chapter 2, SQR Command Reference, ALTER-LOCALE, page 25.
DEFAULT-NUMERIC
Specifies the default numeric type for variables. The command line flag -DNT overrides this setting. Similarly, the DECLARE-VARIABLE command overrides this setting. See Chapter 2, SQR Command Reference, DECLARE-VARIABLE, page 99.
OutputFormFeedWithDashD= {TRUE|FALSE}
TRUE | FALSE
The default value is FALSE. When set to TRUE, the -Dnn command line flag outputs the Form-Feed character that denotes a page break.
291
Chapter 7
Entry
OutputTwoDigitYearWarningMsg= {TRUE|FALSE}
Description The default value is TRUE. When set to TRUE, SQR generates a warning message (sent to the warning file) when a YY or RR date edit mask is encountered during a program run. This affects only SQR code that is processed.
UseY2kCenturyAlgorithm= {TRUE|FALSE}
TRUE | FALSE
The default value is FALSE. When set to TRUE, SQR treats the YY date edit mask as though it is an RR edit mask. See the RR edit mask.
Note. Use the setting V30 to process numbers in the same manner as in prior releases (before V4.0). Specifically, all numeric variables and literals are declared as FLOAT, including integer literals.
Processing-Limits Section
The Processing-Limits section is used to define the sizes and limitations of some of the internal structures used by SQR, which has a direct impact on memory requirements. The entries are the same as those used in the file specified with the -MFILE command-line flag. If the -MFILE command-line flag is used, the Processing-Limits section of the file is not processed.
Entry
BREAKS
Entry Size
Description Number of BREAK arguments allowed for each EVALUATE or IF command. Maximum number of dynamic SQL arguments. Maximum length, in bytes, of temporary string storage used during LET operations. Maximum number of column forward references.
DYNAMICARGS
70
32K-1
14
EXPRESSIONSP ACE
8192
64K-1
FORWARDREFS
200
32K-1
292
Chapter 7
Entry
LONGSPACE
Entry Size
Description Maximum buffer size to transfer text and image data in bytes. Maximum number of ON-BREAK LEVEL=values per SET. Maximum number of placement parameters, for example, (10,5,30). Maximum number of arguments for all program lines. This value is generally 3 or 4 times the value set for PROGLINES. Maximum number of program lines (SQR commands). Maximum number of BEGIN-SQL and BEGIN-SELECT paragraphs. This is database dependent and can vary. This size is used as a close approximation. Maximum number of arguments (bind variables) for all SQL or SELECT statements. The number of arguments required is one more than the number used in your report file.
ONBREAKS
30
64K-1
POSITIONS
1800
64K-1
14
PROGLINEPARS
18000
64K-1
PROGLINES
5000
32K-1
QUERIES
60
32K-1
60
QUERYARGS
240
64K-1
293
Chapter 7
Entry
SQLSIZE
Entry Size
Description Maximum length of a SQL statement in characters. Maximum size of string space for program line arguments, in bytes. Maximum number of runtime substitution variables. Maximum number of variables (string, float, integer, decimal), literal values, and database columns. Add 4 to the entry size for Informix. Maximum number of WHEN arguments allowed for each EVALUATE command.
STRINGSPACE
15000
64K-1
SUBVARS
100
32K-1
VARIABLES
1500
64K-1
18
WHENS
70
64K-1
The maximum value refers to the number of entries allowed as shown in the previous table; however, limits are lower for 32-bit machines. In any case, SQR indicates the limit if you exceed it. In addition to increasing the sizes, you may also lower them to decrease the amount of memory used. This might be advantageous, for example, for certain applications running in the PC environment, where memory is limited.
Environment Sections
The Environment sections { Common | Oracle | Informix | ODBC | DB2 | RDB | Sybase ] } define the environment variables used by SQR. An environment variable can be defined in multiple environment sections; however, a definition in a database-specific environment section takes precedence over an assignment in the Environment:Common section.
294
Chapter 7
The environment variables that can be set are SQRDIR, SQRFLAGS, and DSQUERY. On Microsoft Windows systems, SQRDIR is required and is automatically defined in the appropriate database-specific environment section during the SQR installation. The other environment variables are optional. SQRFLAGS specifies the default command-line flags for all invocations of SQR. DSQUERY (Sybase only) identifies the default Sybase server to use. On Microsoft Windows systems only, the SQR Extension section defines DLLs containing new user functions (UFUNC) and user calls (UCALL). UFUNC and UCALL reside inside SQREXT.DLL and/or other DLLs. When SQRW.DLL and SQRWT.DLL are being loaded, they look for SQREXT.DLL in the same directory, and for any DLLs specified in the SQR Extension section in sqr.ini such as:
[SQR Extension] c:\sqrexts\sqrext1.dll= c:\sqrexts\sqrext2.dll= c:\sqrexts\sqrext3.dll=
Any new extension DLLs containing new user functions must be listed in the SQR Extension section in sqr.ini. See Enterprise PeopleTools 8.49 PeopleBook: SQR for PeopleSoft Developers, Using Interoperability Features. For Oracle on Windows, SQR uses dynamic binding of Oracle routines. When SQR attempts to access an Oracle database, it searches for the Oracle DLL as follows: The file described by the value of ORACLE_DLL entry in the Environment:Oracle section of the sqr.ini file. OCIW32.DLL (Oracle supplied). ORANT71.DLL (Oracle supplied).
Entry SQRParseSQLEnable= {TRUE|FALSE} TRUE | FALSE Value Description The default setting is FALSE. If SQRParseSQLEnable=TRUE is added to the PSSQR.INI file (in the Common or Oracle stanza). SQR performs SQL parsing. Note. The function required to perform this parsing is not a supported function on Oracle 8.X but does appear to function. If a customer wishes to assume the risk of using a feature that might not be fixed if a problem is found, then they can turn on this parameter. Oracle 9.X customers can use this feature without any problem, although there is a performance hit of between 2-10%.
295
Chapter 7
Locale Section
This section specifies the default settings for the locale identified by locale-name (which can consist of A-Z, 0-9, hyphen, and underscore). A number of locales are predefined in the pssqr.ini file. Depending on your application, the settings for these locales may have to be altered or new locales may have to be added. A locale can be referenced or altered at runtime using the ALTER-LOCALE command. The entries for a locale section are described in the following table. Note. The SYSTEM locale is provided for your reference, but is commented out. The settings for the SYSTEM locale, if set, are ignored. Use the ALTER-LOCALE command to change the SYSTEM locale settings at runtime. See Chapter 6, Avoiding Older SQR Commands, page 269.
Entry
NUMBER-EDIT-MASK
Description The default numeric edit mask format when the keyword NUMBER accompanies the DISPLAY, MOVE, PRINT, or SHOW command. The default numeric edit mask format when the keyword MONEY accompanies the DISPLAY, MOVE, PRINT, or SHOW command. The default date edit mask format when the keyword DATE accompanies the DISPLAY, MOVE, PRINT, or SHOW command, or the LET datetostr() or strtodate() functions. The default date format to use with the INPUT command when TYPE=DATE is specified with the command or the input variable is a DATE variable. Specifies the characters to replace the ($) edit character. Specifies the location of the MONEY-SIGN character. Valid values are LEFT and RIGHT. Specifies the character to replace the comma (,) edit character. Specifies the character to replace the period (.) edit character. Specifies the character to replace the slash (/) character.
MONEY-EDIT-MASK
DATE-EDIT-MASK
INPUT-DATE-EDIT-MASK
MONEY-SIGN
MONEY-SIGN-LOCATION
THOUSAND-SEPARATOR
DECIMAL-SEPARATOR
DATE-SEPARATOR
296
Chapter 7
Entry
TIME-SEPARATOR
Description Specifies the character to replace the colon (:) character. Specifies the characters to replace the na option. Specifies the characters to replace AM Specifies the characters to replace PM. Specifies the characters to replace AD. Specifies the characters to replace BC. Specifies how the case for the DAY-OF-WEEK-FULL or DAY-OF- WEEK-SHORT entries are affected when used with the format codes DAY or DY. Valid values are UPPER, LOWER, EDIT, and NO-CHANGE. Use UPPER and LOWER to force the output to either all uppercase or lowercase, ignoring the case of the format code in the edit mask. Use EDIT to follow the case as specified with the format code in the edit mask. Use NO-CHANGE to ignore the case of the format code and output the day of week as explicitly listed in the DAY-OF-WEEK-FULL or DAY-OF-WEEK-SHORT entries.
EDIT-OPTION-NA
EDIT-OPTION-AM
EDIT-OPTION-PM
EDIT-OPTION-AD
EDIT-OPTION-BC
DAY-OF-WEEK-CASE
DAY-OF-WEEK-FULL
Specifies the full names for the days of the week. SQR considers the first day of the week to be Sunday. All seven days must be specified. Specifies the abbreviated names for the days of the week. SQR considers the first day of the week to be Sunday. All seven abbreviations must be specified.
DAY-OF-WEEK-SHORT
297
Chapter 7
Entry
MONTHS-CASE
Description Specifies how the case for the MONTHS-FULL or MONTHS-SHORT entries is affected when used with the format codes MONTH or MON. Valid values are UPPER, LOWER, EDIT, and NO-CHANGE. Use UPPER and LOWER to force the output to either all uppercase or lowercase, ignoring the case of the format code in the edit mask. Use EDIT to follow the case as specified with the format code in the edit mask. Use NO-CHANGE to ignore the case of the format code and output the month as explicitly listed in the MONTHS-FULL or MONTHS-SHORT entries.
MONTHS-FULL
Specifies the full names for the months of the year. SQR considers the first month of the year to be January. All 12 months must be specified. Specifies the abbreviated names for the months of the year. SQR considers the first month of the year to be January. All 12 abbreviations must be specified.
MONTHS-SHORT
Fonts Section
The Fonts section lists the fonts available to SQR when printing on Microsoft Windows printer devices (using the -PRINTER:WP command-line flag), viewing SPF output using SPF Viewer on Microsoft Windows (SQRWV), and creating style sheet for Enhanced HTML output. This section does not apply to PostScript or HP LaserJet printer types. See Chapter 2, SQR Command Reference, DECLARE-PRINTER, page 85 and Chapter 6, Avoiding Older SQR Commands, page 269.
Note. Proportional is assumed if the second parameter starts with a P. Also, bold is assumed if a third parameter is supplied.
298
Chapter 7
Using the font number, commands such as ALTER-PRINTER and DECLARE-PRINTER can reference a particular font style.
The arguments are: DEFAULT reflects current SQR functionality. AUTO automatically determines the default character set of the Microsoft Windows installation and uses the default set when generating reports. CharacterSet specifies one of these keywords: ANSI, ARABIC, BALTIC, CHINESEBIG5, EASTEUROPE, GB2312, GREEK, HANGUL, HEBREW, JOHAB, MAC, OEM, RUSSIAN, SHIFTJIS, SYMBOL, THAI, TURKISH, VIETNAMESE.
HTML-Images Section
The HTML-Images section defines the parameters that SQR uses when generating HTML report output files.
Entry FIRST-PAGE Value HEIGHT, WIDTH, NAME DefaultValue 60,60,firstpg.gif Description Specifies the NAME of the graphic image file that accesses the first page of the report. The HEIGHT and WIDTH are values specified in pixels. Specifies the NAME of the graphic image file that accesses the previous page of the report. The HEIGHT and WIDTH are values specified in pixels. Specifies the NAME of the graphic image file that accesses the next page of the report. The HEIGHT and WIDTH are values specified in pixels
PREV-PAGE
60,60,prevpg.gif
NEXT-PAGE
60,60,nextpg.gif
299
Chapter 7
Entry LAST-PAGE
DefaultValue 60,60,lastpg.gif
Description Specifies the NAME of the graphic image file that accesses the last page of the report. The HEIGHT and WIDTH are values specified in pixels. Specifies the NAME of the graphic image file used as the background image for the report. Background image of navigation bar.
WALLPAPER
NAME
Navbar Background
NAME
Note. SQR does not perform any validation of the graphic image file names provided. The user is responsible for ensuring that the graphic image files are in a location that the browser can access.
The list is ordered by priority from the left. If Font1 has a glyph (an image of a character) for the character you want to print, it is used, but if Font1 does not have a glyph, Font2 is checked and used if it has a glyph for that character. Font Number is a decimal number that is used to specify fonts in the SQR program using statements like DEFINE-PRINTER or ALTER-PRINTER. Font numbers that are multiples of 100 (300, 3200, and so on) are recognized as a bold version of the base font. For example, font 300 is the bold version of Font3. Font numbers 30 to 39 are recognized as italic fonts, and multiples of 30 to 39 (3000, 3100, and so on) are bold italic versions of the font. If you assign nonbold fonts for a font number recognized as bold, (such as 600), the text is printed in bold. Font1, Font2, and Font3 represent the font name. You can use Adobe Reader core fonts, Adobe Reader Asian Font Pack fonts, or TrueType fonts. Adobe Reader core fonts are the fonts that Adobe Reader natively supports. The following is a list of the core fonts: Courier
300
Chapter 7
Courier-Bold Courier-Oblique Courier-BoldOblique Helvetica Helvetica-Bold Helvetica-Oblique Helvetica-BoldOblique Times-Roman Times-Bold Times-Italic Times-BoldItalic Symbol ZapfDingbats Adobe Reader Asian Font Pack fonts are the font packages Adobe provides as add-on to Adobe Reader for the purpose of viewing Asian text. You can download these fonts from the Adobe website, or if you use Adobe Reader 6, the Asian Font Pack automatically downloads when you open a PDF file that contains a font from the Asian Font Pack. Alternatively, you can use the Adobe Reader localized to any of the Japanese, Chinese, or Korean languages. These localized versions come with the same fonts that are included in the Adobe Asian Font Pack. The following is a list of the Asian Font Pack fonts used with SQR: HeiseiKakuGo-W5 (Japanese) HeiseiMin-W3 (Japanese) MHei-Medium (Traditional Chinese) MSung-Light (Traditional Chinese) STSong-Light (Simplified Chinese) HYGoThic-Medium (Korean) HYSMyeongJo-Medium (Korean) In addition, you can use TrueType/OpenType fonts that exist on the machine where you run SQR. If you use TrueType fonts for PDF output, they will be always embedded as subset of the original font. To use TrueType fonts for PDF output, you need to specify the mapping between the font name and the font file path in the [TrueType Fonts] section, and then include the font name in the font list under the [PDF Fonts] section. See below more information about the [TrueType Fonts] section. See Chapter 7, Using the PSSQR.INI File and the PSSQR Command Line, TrueType Font Section, page 302.
301
Chapter 7
Exclusion ranges apply to the list of fonts defined in the PDF Fonts section. For example, if you have a PDF Fonts section like the following:
3=Courier,Cumberland,HeiseiKakuGo-W5,...
In addition, if you define the PDF Fonts: Exclusion Ranges section like this
3=0x20AC,0x3070-0x30FF,,
then you are defining that Euro currency symbol (0x20AC in Unicode) is rendered using the Cumberland font, even though Courier has it. In addition, Greek characters (from 0x3070 to 0x30FF in Unicode) are rendered using HeiseiKakuGo-W5 font, even though Cumberland has them. Each Exclusion range is specified using Unicode (UCS-2) codepoint, in decimal or in hexadecimal, in the following ways: 0x20AC (single character) 160-255 (range) 0x20AC|0x00A0-0x00FF (multiple characters and ranges) Hexadecimal numbers need to be preceded by 0x; otherwise, they are recognized as decimal.
For example, if you have the font courier.ttf in the c:\user\fonts directory, you set the following in this section:
CourierNew=c:\user\fonts\courier.ttf
Font name can be any string that is convenient for you to identify the font, and does not need correspond to the internal name of the font. You should not use the same font name that is used for Adobe core fonts or for Asian Font Pack fonts. If you set the same name for any of Adobe core fonts or Asian Font Pack fonts, the TrueType font is used.
302
Chapter 7
Note. TrueType font embedding is now supported by SQR running on z/OS. However, the Font Path parameter under the TrueType Font section is not supported for z/OS. If youre on z/OS, you need to specify the full path to each entry. If you have a TrueType Collection (TTC) file, you will also need to specify the font number to access the specific font included in the collection. For example, if MS P Mincho is included in the TrueType Collection file msmincho.ttc, then you will need to specify:
MSPMincho=c:\winnt\fonts\msmincho.ttc,1
The font number within the TrueType collection starts at 0. msmincho.ttc contains MS Mincho and MS P Mincho in this order; thus the number 0 represents MS Mincho and 1 represents MS P Mincho. If you do not specify font number, SQR uses font with font number 0 from the TrueType Collection file. Note. You can use only Microsoft type of Unicode based TrueType/OpenType fonts with SQR. SQR requires TrueType/OpenType font to have CMAP table with Platform ID 3 (Microsoft), Encoding ID 0 (Symbol), 4 (UCS-2), or 10 (UCS-4) and table format 4 or 12. SQR does not support OpenType fonts with CFF (Postscript) outline. You can use OpenType fonts with TrueType outlines, but SQR does not make use of advanced layout features provided with OpenType font.
Enhanced-HTML Section
The Enhanced-HTML section is used to define various default actions that SQR takes when generating HTML output using the -EH command-line flag.
Entry Browser={ALL|IE|NETS CAPE} Value ALL|IE|NETSCAPE Description When set to ALL, the generated HTML automatically determines which browser is being used and invokes the proper browser-specific file. When set to IE, the generated HTML is designed for Internet Explorer. When set to NETSCAPE, the generated HTML is designed for Netscape. The default action is to generate HTML suitable for all browsers. Language={English|French| German| Portuguese|Spanish|Japanese| Simplified Chinese|Korean} FullHTML={TRUE | FALSE} English|French| German| Portuguese|Spanish|Japanese| Simplified Chinese|Korean Sets the language used for the HTML navigation bar. The default setting is English. When set to TRUE, HTML 3.2 is generated. When set to FALSE, HTML 3.0 is generated. The default setting is FALSE.
TRUE | FALSE
303
Chapter 7
Colors Section
The Colors section defines the default colors that you can use in your SQRs. Enter the default colors in this format:
[Colors] color_name = ({rgb]) color_name = ({rgb]) ... color_name = ({rgb])
The default colors implicitly installed are: black=(0,0,0) white=(255,255,255) gray=(128,128,128) silver=(192,192,192) red=(255,0,0) green=(0,255,0) blue=(0,0,255) yellow=(255,255,0) purple=(128,0,128) olive=(128,128,0) navy=(0,0,128) aqua=(0,255,255) lime=(0,128,0) maroon=(128,0,0) teal=(0,128,128) fuchsia=(255,0,255)
304
Chapter 7
Expanded output formats: SQR Viewer, HTML, PDF, CSV (Spreadsheet Standard), HP, Postscript, Line Printer. Expanded printer format: Microsoft Windows Default Printer (Win32 only), HP, Postscript, Line Printer. Enhanced delivery of reports to printers: PSSQR sends reports to the printer instead of SQR, which resolves issues that can be encountered on non-Microsoft networks. File output and logs have unique names. If the process instance is sent, the file names will be <SQR Program>_<Instance>.xxx. If not, then the log names will be <SQR Program>_<timestamp>.xxx. Common command line interface for both Microsoft Windows and UNIX/Linux. Reads Configuration Manager settings to determine the flags (SQRFLAGS) to use. Support for multiple report output. Default values come from Configuration Manager if run from the command line.
Command-Line Parameter -CT Description Database type. Valid values are ORACLE, DB2, DB2390, INFORMIX, MICROSFT, SYBASE. Server name. Database owner. This applies to OS/390 only. Database name. Access ID. Access password. Program name. Process instance.
-R -CO
305
Chapter 7
Description
Output format. Column headings refer to the -OT parameter. 2 (Adobe Acrobat) 3 (Comma delimited) 4 (HP format) 5 (HTML documents) 6 (Line printer) 10 (Postscript) 13 (SQRiBE portable) 14 (Text files) 15 (Windows default printer)
Output destination. Multiple report output. Values: # (maximum 99) Additional flags. Additional information. Enable trace. Display log file. Enter the name of a parameter file containing the parameters you want to pass to PSSQR. The system deletes the file immediately after use.
306
Chapter 7
Description Language Code. Takes a three-letter language code used across PeopleSoft systems. This flag is used to determine which language version of the PSSQR.INI file to use. If you specify LG JPN, then pssqr.exe picks up the Japanese configuration file (PSSQRJPN.INI) instead of PSSQR.INI. This parameter takes effect only when the %LANGUAGE_CD% variable is used for specifying the PSSQR.INI file in PSSQRFLAGS entry of the Process Scheduler configuration or Configuration Manager. UNIX\Linux only : Overides the flags passed to the lp command. Displays command used to print the SQR report.
-LPFLAGS "<flags>"
-DEBUGLP ON
307
Chapter 7
308
APPENDIX A
SQR Messages
This appendix describes all the messages produced by SQR for PeopleSoft. It discusses: Unnumbered messages Numbered messages Note. Two digits (nn) appear as replacement markers in the messages. Descriptions of these replacement markers are listed in the message itself. The messages contain the proper value when they appear on the screen.
Unnumbered Messages
This table lists all unnumbered SQR for PeopleSoft messages:
Message Out of memory. Description This error occurs when a call to the C routine malloc() fails. (32-bit machines) Use the -Mfile command-line flag to reduce some of the different memory requirements. Remove unneeded TSRs. (UNIX\Linux) Increase the size of the system swap file. No cursors defined. This message is issued from the -S command-line flag. The SQR program did not contain any commands that required a database cursor. This message is issued from the -S command-line flag. SQR cannot provide information about the cursor due to errors in the program. This message prompts the user to type the value to be assigned to the specified variable. 01 = First character of the variable name. 02 = Rest of the variable name. NOPROMPT used - Enter value below (Microsoft Windows) This message appears when an INPUT command is defined with the NOPROMPT argument.
Enter 0102
309
SQR Messages
Appendix A
Message Enter 01
Description This message prompts the user to enter the value to be assigned to the specified substitution variable. 01 = Name of the substitution variable
This message prompts the user to enter the values for the parameters defined in the program. SQR detected an error while processing the report file. Correct the error and rerun. 01 = Source line number. 02 = Source line.
SQR detected an error while processing the report file. Correct the error and rerun. 01 = Name of the include file. 02 = Source line number. 03 = Source line.
SQR detected a nonfatal error while processing the report file. 01 = Source line number. 02 = Source line.
SQR detected a nonfatal error while processing the report file. 01 = Name of the include file. 02 = Source line number. 03 = Source line.
Type RETURN for more, C to continue w/o display, X to exit run: Error at: 01 Loading Oracle DLL Failed!!! Errors were found in the program file.
This informational message is used in conjunction with the -D command-line flag. (Oracle) This title for the dialog box informs the user that SQR could not load the Oracle DLL.
This error message tells the user that there were errors in the program. The user can correct the errors and rerun.
310
Appendix A
SQR Messages
Description This error message tells the user to there were errors running the program. The user can correct the errors and rerun. This is an informational message. 01 = Image name (for example, SQR)
This message prompts the user to enter the name of the report (.sqr or .sqt) to run. This message prompts the user to enter the name of the database. This message prompts the user to enter the user name to log onto the database.
This message prompts the user to enter the password. For security reasons, the password is not echoed. This is a text message. This is a text message. This is an informational message. 01 = Image name (for example, SQR) This is an informational message. (Microsoft Windows) This message is a title for the error message dialog box. (Microsoft Windows) This message is a title for the error message dialog box. (Microsoft Windows) This message is a title for the error message dialog box. (Microsoft Windows) This message is the body of the -C cancel dialog box. The user can quit the program run by clicking the Cancel button.
Operating-System error
DB-Library error
311
SQR Messages
Appendix A
Message Table of Contents Previous Next First Page Last Page PAGE
Description This message is the text for HTML driver. This message is the text for HTML driver. This message is the text for HTML driver. This message is the text for HTML driver. This message is the text for HTML driver. This message is the text for HTML driver.
Numbered Messages
This table lists numbered messages:
Error Number 000001 Error Message Error while opening the message file: 01 (02): 03 Suggestion/Interpretation Try reloading the sqrerr.dat file from the release media. If the error persists, contact technical support. 01 = Name of the error message file. 02 = System error code. 03 = System error message. 000002 Error while reading the message file. (01): 02 Try reloading the sqrerr.dat file from the release media. If the error persists, contact technical support. 01 = Name of the error message file. 02 = System error code. 03 = System error message.
312
Appendix A
SQR Messages
Suggestion/Interpretation Try reloading the sqrerr.dat file from the release media. If the error persists, contact technical support. 01 = Name of the error message file. 02 = System error code. 03 = System error message.
000004
Try reloading the sqrerr.dat file from the release media. If the error persists, contact technical support. 01 = Name of the error message file. 02 = System error code. 03 = System error message.
000005
Try reloading the sqrerr.dat file from the release media. If the error persists, contact technical support. The header contains an invalid entry count. 1. Make sure SQRDIR points to the correct directory. 2. Try reloading the sqrerr.dat file from the release media. If the error persists, contact technical support. 01 = The value read from the header. 02 = The correct value.
000006
000007
This message occurs when the release of SQR does not support the header version. 1. Make sure SQRDIR points to the correct directory. 2. Try reloading the sqrerr.dat file from the release media. If the error persists, contact technical support. 01 = Unsupported version read from the header.
313
SQR Messages
Appendix A
Suggestion/Interpretation An invalid code was passed to the error message handler. Try reloading the files from the release media. If the error persists, contact technical support. 01 = Invalid code.
000011
Try reloading the sqrerr.dat file from the release media. If the error persists, contact technical support. 01 = Invalid type. 02 = Internal error code.
000012
The type error code is not correct. Try reloading the sqrerr.dat file from the release media. If the error persists, contact technical support. 01 = Error code.
000013
The error handler cannot position to the desired error code. Try reloading the sqrerr.dat file from the release media. If the error persists, contact technical support. 01 = Error code.
000014
Define the named environment variable and restart SQR. 01 = Environment variable name.
000015
The Meta ESC characters do not match (Got 01, Should be 02).
The meta escape character defined in the header does not match what the error message handler expects. Try reloading the sqrerr.dat file from the release media. If the error persists, contact technical support. 01 = What was found in the header. 02 = What was expected to be found
314
Appendix A
SQR Messages
Error Message 01() called to process (02) and the message file is not open.
Suggestion/Interpretation The specified error routine was called but the error message file was not open. Try reloading the files from the release media. If the error persists, contact technical support. 01 = Name of the routine 02 = Error code
000017
Try reloading the sqrerr.dat file from the release media. If the error persists, contact technical support. 01 = Error code (Microsoft Windows) This message is the result of a memory overwrite. Record the steps leading up to the error and contact technical support. (Microsoft Windows) This message is the result of a memory overwrite. Record the steps leading up to the error and contact technical support. (Microsoft Windows) This message is the result of a memory overwrite. Record the steps leading up to the error, and contact technical support. (Microsoft Windows) This message is the result of a memory overwrite. Record the steps leading up to the error and contact technical support. The initialization file specified by the -ZIF command line flag cannot be accessed. 01 = Name of the file. 02 = System error code. 03 = System error message.
000018
000019
000020
000021
000028
000202
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support.
315
SQR Messages
Appendix A
Suggestion/Interpretation This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Name of the routine. 02 = Name of the command.
000204
000205
DDO: DO arguments do not match procedures. SDO: Bad params for DO command.
<obsolete>
000206
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support.
000207
000208
000209
000210
316
Appendix A
SQR Messages
Suggestion/Interpretation This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Name of the routine. 02 = name of the variable.
000212
000213
000214
000215
000216
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support.
000217
317
SQR Messages
Appendix A
Suggestion/Interpretation This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Number of the argument.
000219
000220
000221
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Internal command format string. 02 = Bad format field found.
000222
000223
000224
318
Appendix A
SQR Messages
Suggestion/Interpretation This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Internal command format string.
000226
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Internal command format string.
000227
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Internal command format string.
000228
000229
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Internal command format string.
000230
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Internal command format string.
319
SQR Messages
Appendix A
Suggestion/Interpretation This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Routine name. 02 = Invalid parameter number.
000232
000233
000234
000235
000238
000239
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Internal variable type code.
320
Appendix A
SQR Messages
Suggestion/Interpretation This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Invalid element number.
000241
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Maximum internal command number supported.
000242
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Internal variable name.
000243
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Name of the SQR routine.
000244
000245
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Variable name.
321
SQR Messages
Appendix A
Suggestion/Interpretation This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. (Oracle) This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. (DB2, Informix) This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. (DB2, Informix) This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Variable name. 02 = Unknown database type.
000249
000251
000252
000254
000255
000256
322
Appendix A
SQR Messages
Suggestion/Interpretation This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Unknown SPF code.
000258
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Name of the routine. 02 = Name of the table.
000259
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Name of the routine. 02 = Name of the variable.
000260
SQTMGT: Could not find vars entry with nvars index of 01.
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Index into nvars table.
000261
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = name of the variable.
000262
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Variable type (from). 02 = Variable type (to).
323
SQR Messages
Appendix A
Suggestion/Interpretation This is the total number of variable references ($Var, #Var, &Col) allowed in the context of a BEGIN-SQL or BEGIN- SELECT command. Use the -Mfile flag on the command line to specify a file containing an entry that increases the currently defined value. Depends on the system error message. 01 = Name of the file. 02 = System error code. 03 = System error message.
001201
001202
Depends on the system error message. 01 = System error code. 02 = System error message.
001203
Depends on the system error message. 01 = Name of the file. 02 = System error code. 03 = System error message.
001204
001205
001206
324
Appendix A
SQR Messages
Suggestion/Interpretation Depends on the system error message. 01 = System error code. 02 = System error message.
001209
001210
001211
001300
Bind list does not match query (do not use @__p string).
SQR reserves the variable names that start with "@__p" for internal use. Edit the source code and use different variable names. Within the body of BEGIN-SQL paragraphs, forward references to &column names are not permitted. Move the BEGIN-SQL paragraph after the &column definition. The SQL statement exceeds the size of the internal SQL buffer. Use the -Mfile flag on the command line to specify a file containing an entry that increases the currently defined value.
001301
001302
325
SQR Messages
Appendix A
Suggestion/Interpretation The database server has determined that the SQL statement is in error. The actual error text from the server follows this message. Correct the SQL statement. The database server has determined that the SQL statement is in error. The actual error text from the server follows this message. Correct the SQL statement. Contact technical support with the version of the database you are connected to. 01 = Datatype in question.
001304
001305
001306
IMAGE and TEXT data types cannot be used as bind variables. Modify your SQL statement to use other columns to perform the same selection logic. (Oracle, ODBC, Informix) This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. (Oracle, ODBC, Informix) This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Name of the SQR routine. 02 = Name of the column.
001307
001308
001309
The type for &01 (02) does not match the type from the database (03).
Correct the source code. 01 = Name of the column /expression pseudonym. 02 = User specified type. 03 = Database type.
326
Appendix A
SQR Messages
Suggestion/Interpretation Only #numeric variables, &columns, and literals are permitted in the arithmetic commands. Correct the source code. Correct the syntax. 01 = Maximum value for ROUND. Correct the syntax.
001401
001402
Optional qualifiers for DIVIDE are ON- ERROR={HIGH|ZER O} and ROUND=n. Attempting division by zero.
001403
Use the ON-ERROR = HIGH | ZERO option to prevent this error from halting the program. Correct the syntax.
001404
Bad number of digits to ROUND or TRUNC (0-15). WARNING: The ROUND or TRUNC qualifier is greater than the numbers precision. Array element out of range (01) for array 02 on line 03.
001405
001500
Correct the source logic. 01 = Element number passed. 02 = Name of the array. 03 = Program line number.
001501
Field element out of range (01) for array 02, field 03, on line 04.
Correct the source logic. 01 = Element number passed. 02 = Name of the array. 03 = Name of the field. 04 = Program line number.
327
SQR Messages
Appendix A
Error Message WARNING: Attempting division by zero on line 01. Array field 02 unchanged. Run continuing...
Suggestion/Interpretation The ARRAY-DIVIDE command has attempted division by zero. The division has been ignored; the result field is unchanged. Add logic to account for this possibility. 01 = Program line number. 02 = Name of field.
001601
The FILL argument to the PRINT command may be used only for text fields. Move the #numeric variable to a $string variable, and then print the string variable. The specified value is wider than the width of the page. Correct the source line. 01 = Name of the current report. 02 = Page width.
001700
Report 01: Columns must be between 1 and the page width (02).
001702
Report 01: GOTO- TOP=02 must be between 0 and the page depth (03).
The value specified on the GOTO-TOP argument of the NEXT-COLUMN command was either less than 1 or greater than the page depth. Correct the source line. 01 = Name of the current report. 02 = Goto-Top value. 03 = Page width.
001703
Report 01: ERASE- PAGE=02 must be between 0 and the page depth (03).
The line number specified on the ERASE- PAGE argument of the NEXT-COLUMN command is greater than the page depth. Correct the source line. 01 = Name of the current report. 02 = Erase-Page value. 03 = Page width.
001704
Report 01: The NEXT-COLUMN command is not legal in the 02 section with the qualifier ATEND=NEWPAGE.
Correct the source line. 01 = Name of the current report 02 = Name of the section
328
Appendix A
SQR Messages
Suggestion/Interpretation The column number specified with the USE- COLUMN command is greater than the highest column defined in the COLUMNS command. Correct the source line. 01 = Name of the current report 02 = Column number Correct the syntax.
001800
Format for CONNECT: username/password [ON-ERROR= procedure[(arg1[,argi]...)] ] Cannot use CONNECT while SQL statements are active.
001801
Correct the program logic to ensure that all BEGIN-SELECT paragraphs have completed before executing the CONNECT command. The database server returned an error while trying to log off from the database. SQR ends the program run since it cannot continue. The specified connectivity information is incorrect or there might have been a network failure. Use the ON-ERROR flag to trap any errors during the program run; otherwise SQR ends the program run. Remove SET and SETUSER from the source. Correct the source.
001802
001803
001804
Sybase extensions SET and SETUSER not permitted in SQR. USE allowed once in SETUP section only, not in BEGIN-SQL. Elsewhere, specify db.[user].table... Out of query space. Use -Mfile to increase QUERIES.
001805
001806
The number of SQL statements has been exceeded. Use the -Mfile flag on the command line specify a file that contains an entry that increases a greater value than is currently defined.
329
SQR Messages
Appendix A
Suggestion/Interpretation The -Cnn value specified is being used by another BEGIN-SELECT paragraph that is currently selecting data. Use another connection number. 01 = Connection number
001808
Too many BEGIN-SELECT and BEGIN-SQL paragraphs are active at the same time. Reduce the complexity of the program. (Oracle, DB2, ODBC) This is an error that should never occur during normal operations. Record the steps leading up to the error and contact your system administrator. (Oracle, DB2, ODBC) This is an error that should never occur during normal operations. Record the steps leading up to the error and contact your system administrator. ( Oracle, ODBC) This is an error that should never occur during normal operations. Record the steps leading up to the error and contact your system administrator. Correct the syntax.
001809
001810
001811
001901
Variable for date-time must begin with &. Format code must be SYYYY when specifying signed year. Bad input data (01) for edit mask: 02.
001913
001914
Correct the input. 01 = Data being converted 02 = Edit mask Correct the date. Correct the date.
001915 001916
Year cannot be zero. Year must be between -4713 and 9999 inclusive.
330
Appendix A
SQR Messages
Suggestion/Interpretation Correct the date. Correct the date part. 01 = Date part.
001919 001920
Invalid day of week. Format code cannot appear in date input format: 01.
Correct the date. Correct the edit mask. 01 = Improper format characters. Correct the edit mask. 01 = Improper format characters.
001921
001922
Seconds past midnight must be between 0 and 86399. Seconds must be between 0 and 59. Minutes must be between 0 and 59. Month must be between 1 and 12. Day must be between 1 and 01. Hour must be between 1 and 12. Hour must be between 0 to 23. HH24 precludes the use of meridian indicator. HH12 requires meridian indicator. Day of year must be between 1 and 365 (366 for leap year). Date string too long.
Correct the date. Correct the date. Correct the date. Correct the date. Correct the date. Correct the date. Correct the edit mask.
001930 001931
001932
331
SQR Messages
Appendix A
Error Message The month (01) is not valid for the current locale or database.
Suggestion/Interpretation Correct the date. 01 = Name of the month. Correct the format mask. The format mask must be a literal when the date-time is not loaded into a variable. Correct the format mask. Correct the format mask. (Oracle) The format mask needs to be corrected or there is a problem with the database server. (DB2) The format mask needs to be corrected or there is a problem with the database server. A fatal error relating to the SQL statement used to retrieve the date-time was encountered. Record the steps leading up to the error and contact your system administrator. A fatal error relating to the SQL statement used to retrieve the date-time was encountered. Record the steps leading up to the error and contact your system administrator. A fatal error relating to the SQL statement used to retrieve the date-time was encountered. Record the steps leading up to the error and contact your system administrator. A fatal error relating to the SQL statement used to retrieve the date-time was encountered. Record the steps leading up to the error and contact your system administrator.
001934
The format mask must be a literal when the date-time is not loaded into a variable.
Date-time format too long. Bad date-time format. Bad SQL for default date-time. (Table DUAL required for syntax.)
001937
Bad SQL for default date-time. (Table DUAL required for syntax.)
001938
001939
001940
001941
332
Appendix A
SQR Messages
Suggestion/Interpretation When specifying an SQR date, at a minimum, the date must be specified. The time is optional. 01 = The invalid date.
001943
The date 01 is not in one of the accepted formats listed below: MM/DD/YYYY [BC | AD] [HH:MI[:SS[.NNNNN N]] [AM | PM]] MM-DD-YYYY [BC | AD] [HH:MI[:SS[.NNNNN N]] [AM | PM]] MM.DD.YYYY [BC | AD] [HH:MI[:SS[.NNNNN N]] [AM | PM]] SYYYYMMDD[HH24[MI [SS[N NNNNN]]]]
The date specified with the INPUT command was not in one the default formats. Reenter the date in a valid format. 01 = The invalid date.
001944
The date 01 is not in the format specified by SQR_DB_DATE_FORMAT or in one of the accepted formats listed below: DD-MON-YY SYYYYMMDD [HH24[MI[SS[N NNNNN]]]]
(Oracle) The date was not in one of the expected formats for this database. 01 = The invalid date.
001944
The date 01 is not in the format specified by SQR_DB_DATE_FORMAT or in one of the accepted formats listed below: Mon DD YYYY [HH:MI[:SS [.NNN]][ AM | PM]] Mon DD YYYY [HH:MI[:SS[: NNN]][ AM | PM]] YYYYMMDD [HH:MI[:SS [.NNN]][ AM | PM]] YYYYMMDD [HH:MI[:SS[: NNN]][ AM | PM]] SYYYYMMDD[HH24[MI[SS[N NNNNN]]]]
(Sybase) The date was not in one of the expected formats for this database. 01 = The invalid date.
333
SQR Messages
Appendix A
Error Message The date 01 is not in the format specified by SQR_DB_DATE_FO RMAT or in one of the accepted formats listed below: Mon DD YYYY [HH:MI[:SS [.NNN]][ AM | PM]] Mon DD YYYY [HH:MI[:SS[: NNN]][ AM | PM]] YYYYMMDD [HH:MI[:SS [.NNN]][ AM | PM]] YYYYMMDD [HH:MI[:SS[: NNN]][ AM | PM]] SYYYYMMDD[HH24[MI[SS[N NNNNN]]]]
Suggestion/Interpretation (ODBC) The date was not in one of the expected formats for this database. 01 = The invalid date.
001944
The date 01 is not in the format specified by SQR_DB_DATE_FO RMAT or in one of the accepted formats listed below: YYYY-MM-DD HH:MI:SS.NNN SYYYYMMDD[HH24[MI[SS[N NNNNN]]]]
(Informix) The date was not in one of the expected formats for this database. 01 = The invalid date.
001944
The date 01 is not in the format specified by SQR_DB_DATE_FORMAT or in one of the accepted formats listed below: YYYY-MM-DD[HH.MI.SS[.NNNNNN ]] MM/DD/YYYY DD.MM.YYYY SYYYYMMDD[HH24[MI[SS[N NNNNN]]]]
(DB2) The date was not in one of the expected formats for this database. 01 = The invalid date.
001945
SQR does not support dates before the one specified in the message. 01 = Smallest date
001946
The SQR function references two date variables that cannot logically be used together, for example, DateDiff of date- only and time-only dates.
334
Appendix A
SQR Messages
002001
002002
The argument lists for the DO and BEGIN- PROCEDURE commands must match in both type and count. Correct the source line. Correct the syntax.
002003
DO argument must be $string or #number to accept returned value. Edit string too long.
002100
The edit mask must be less than 255 characters. Reduce the length of the edit mask. The numeric edit mask contains an invalid character. See the PRINT command for the valid numeric edit mask characters. 01 = Invalid character
002101
002103
DOLLAR-SYMBOL must be a single alphanumeric character or its decimal value enclosed in brackets: <nnn>. DOLLAR-SYMBOL cannot be any of the following characters: 01
002104
002106
MONEY-SYMBOL must be a single alphanumeric character or its decimal value enclosed in brackets: <nnn>. MONEY-SYMBOL cannot be any of the following characters: 01
002107
335
SQR Messages
Appendix A
Suggestion/Interpretation Break up the ENCODE command. 01 = Maximum length of an ENCODE string supported by this version of SQR for PeopleSoft. The database command to cancel the query returned an error. Try running the SQR program again. The error could be related to a network or server problem. If the error persists, contact your system administrator. Remove the EXIT-SELECT command. Labels must be unique within the section or paragraph where they are defined. Give each label a unique name. Check the source code.
002300
EXIT-SELECT failed.
002301
EXIT-SELECT valid only within SELECT paragraph. Duplicate labels - do not know which one to GOTO.
002400
002401
(Labels must be in same section or paragraph as GOTO.) Cannot find a matching label for GOTO command. Error getting INPUT.
002500
The C routine "fgets()" returned an error and SQR ends the program run. Correct the syntax.
002501
Unknown INPUT datatype: type={char|number|integer|date} INPUT STATUS= must reference #variable. Unknown qualifier for INPUT. Too long. Maximum 01 characters.
002502
002503 002506
Correct the syntax. The response to the INPUT statement was too long. Re-enter the data. 01 = Maximum characters allowed
002507
Invalid number was entered for an INPUT request. Re-enter the data.
336
Appendix A
SQR Messages
Error Message Incorrect. Format for integer: [+|-]999999 A format mask can only be specified when TYPE=DATE is used. The format mask cannot be stored in a date variable. The input variable type does not match the TYPE qualifier. Number too large for INTEGER. Valid range is -2147483648 to 2147483647.
Suggestion/Interpretation Invalid integer was entered for an INPUT request. Re-enter the data. Correct the syntax.
002510
002511
002512
002513
The number was too large to be stored as an integer. Values are from -2147483648 to 2147483647. Re-enter the data. The date cannot be blank. Enter a date in one of the specified formats.
002514
Enter a date in one of the following formats: MM/DD/YYYY [HH:MI[:SS [.NNNNN N]] [AM | PM]] MM-DD-YYYY [HH:MI[:SS [.NNNNN N]] [AM | PM]] MM.DD.YYYY [HH:MI[:SS [.NNNNN N]] [AM | PM]] SYYYYMMDD[HH24[MI[SS[N NNNNN]]]]
002515
01 required user interaction but user interaction was disabled by the -XI command line flag.
The specified command required user interaction, but user interaction was disabled by the -XI command line flag. 01 = Name of the command Add a LOAD-LOOKUP command. 01 = Load lookup table name Correct the syntax. 01 = Name of missing required parameter
002600
002601
337
SQR Messages
Appendix A
Suggestion/Interpretation Correct the syntax. 01 = Name of the parameter Either move the LOAD-LOOKUP command from the Setup section or remove the variable reference. 01 = Name of the parameter
002603
002604
LOAD-LOOKUP names must be unique. Cannot compile SQL for LOAD-LOOKUP table 01.
Give each LOAD-LOOKUP array a unique name. The database server returned an error while trying to compile the SQL statement needed to process the LOAD-LOOKUP command. Check the column and table names. Also check the WHERE= clause for errors. 01 = Load lookup table name
002605
002606
The database server returned an error while trying to compile the SQL statement needed to set up the LOAD-LOOKUP command. Verify the column and table names. Review the WHERE= clause for errors. 01 = Load lookup table name
002607
The database server returned an error while trying to execute the SQL statement needed to process the LOAD-LOOKUP command. 01 = Load lookup table name
002609
Integers only allowed in numeric lookup keys. Numeric lookup keys must be <= 01 digits.
002610
338
Appendix A
SQR Messages
Error Message Bad return fetching row from database in LOAD-LOOKUP table 01.
Suggestion/Interpretation The database server returned an error while fetching the data. 01 = Load lookup table name This message can be inhibited by using the QUIET argument on the LOAD-LOOKUP command. 01 = Name of the load lookup table 02 = Number of rows loaded
002613
002615
This message can be inhibited by using the QUIET argument on the LOAD-LOOKUP command. 01 = Number of duplicate keys 02 = Name of the load lookup table
002616
LOAD-LOOKUP 01= must reference a numeric variable or literal. LOAD-LOOKUP 01= must reference a string variable or literal.
Correct the source line. 01 = Name of the parameter Correct the source line. 01 = Name of the parameter Correct the source line. 01 = Name of the parameter 02 = Name of the undefined variable
002617
002618
002619
002620
Either use the #IF command to conditionally compile the program when -XL is being used or do not execute this SQR report with the -XL option. 01 = SQR command
339
SQR Messages
Appendix A
Error Message Line to stop erasing for NEW-PAGE is larger than the page depth. ON-BREAK not appropriate for numeric data.
002800
The ON-BREAK argument to the PRINT command may be used only for text fields. Move the #numeric variable to a $string variable, and then print the $string variable. Correct the source line.
002801
SET= and LEVEL= must be >= zero when indicated. Cannot use old style PROCEDURE= with BEFORE= or AFTER=. Out of ON-BREAKS; use -Mfile to increase ONBREAKS.
002802
002803
Use the -Mfile flag on the command line to specify a file containing an entry that increases the currently defined value. All the ON-BREAKS in a query must belong to the same SET. Use SET= to differentiate between ON-BREAKs in different queries. Correct the source line. Correct the source line.
002804
002805
ON-BREAK with BEFORE or AFTER must be inside Select. SAVE= must be a $string variable. Record :types are FIXED, VARY or FIXED_NOLF (default is VARY). STATUS variable for 01 must be #Numeric.
002806 002900
002901
002902
340
Appendix A
SQR Messages
Suggestion/Interpretation Reduce the number of open external files needed by the program. 01 = Maximum number of open external files supported by this version of SQR
002904 002905
Verify the program logic. SQR stops. 01 = Filename 02 = File number 03 = System error code 04 = System error message
002906
SQR stops. 01 = File number 02 = System error code 03 = System error message
002907
Problem closing user file(s) at the end of run. Warning: Cannot CLOSE file 01 -file not opened.
This message may indicate system problems. While not an error, this message indicates a problem with your SQR code. 01 = File number
002908
003000
The pre-and post-PAGE-NUMBER strings must be less than 74 characters. Correct the source line. Defines the specified @ marker in a BEGIN- DOCUMENT paragraph. Verify that the @ marker names are spelled correctly. Correct the syntax.
003100
003101
341
SQR Messages
Appendix A
Suggestion/Interpretation Files must be opened for reading in order to use the READ command with them. Correct the program logic. 01 = Program line number 02 = System error code 03 = System error message
003201
003202
Files must be opened for writing in order to use the WRITE command with them. Correct the program logic. 01 = Program line number 02 = System error code 03 = System error message
003203
003204
The total of the lengths indicated in the command must be less than the RECORD= argument used on the OPEN command. Search for a typographical error or recalculate the RECORD= value. By default, all files are opened in VARY (variable length) mode, thus prohibiting the transfer of numeric binary data. Add the:FIXED or FIXED_NOLF option to the RECORD= argument on the appropriate OPEN command. Correct the syntax. Correct the syntax.
003205
003206 003207
Command not complete. File number must be a numeric literal, variable, or column. Missing required length in READ command. Bad length for READ or WRITE command.
003208
003209
342
Appendix A
SQR Messages
Error Message $String or #numeric variables required for READ. #Numeric variables and literals must have :length of 1, 2 or 4 bytes. #Numeric variables and literals on CDC may only have :length of 1 or 3 bytes. :Length not allowed for $date variables, length of 18 is assumed. Unknown qualifier for STOP. Program stopped by user request. Wrap not appropriate for numeric data.
003211
003212
003213
Correct the syntax. This is an informational message. The WRAP argument to the PRINT command may be used only for text fields. Move the #numeric variable to a $string variable first, and then print the $string variable. Reduce the number of characters specified. 01 = Maximum number of characters supported by this version of SQR.
003401
003402
Reduce the number of characters specified. 01 = Maximum number of characters supported by this version of SQR
003403
The number inside the angled brackets must be a valid number (1 255). Correct the source line. A leading "<" in the ON= or STRIP= qualifier indicates that a numeric value is following, which must be ended by a closing ">". Correct the source line.
003404
343
SQR Messages
Appendix A
Suggestion/Interpretation The value specified for the specified qualifier is invalid. Correct the program logic. 01 = Qualifier name 02 = Value encountered 03 = Relation to zero (<,<=,=,>=,>)
003500
PUT, GET or ARRAY- xxxx command incomplete. Required word missing. Did not find end of literal.
003501
The ending quote character () was not found at the end of the literal. Add the ending quote character. Literal strings can be up to 256 characters long. Break up the literal into smaller pieces and combine using the LET command. Variable names must begin with $, #, or &. Correct the source line. The element number was not specified. Correct the source line. Each GET or PUT command must indicate the element or row number to access in the array. Correct the source line. Use the CREATE-ARRAY command to define each array before referencing that array in other commands. Verify that the array names are spelled correctly. The element number is larger than the number of rows defined in the CREATE-ARRAY command. Review the program logic to make sure that the element number was not inadvertently changed.
003502
003503
003504
Cannot find array_name (#element). (#Element) variable not found for array.
003505
003506
003507
344
Appendix A
SQR Messages
Suggestion/Interpretation The "occurs" number for an array field is missing a right parenthesis. Correct the source line. Verify that there are no misspelled field names in the CREATE-ARRAY command. 01 = Undefined field name
003509
003510
The ARRAY command must not have more variables listed to the left of the array name than there are matching fields defined for the array. Check against the CREATE-ARRAY command. The ARRAY command must not have more variables listed to the left of the array name than there are matching fields defined for the array. Check against the CREATE-ARRAY command. The ARRAY-ADD, ARRAY-SUBTRACT, ARRAY-MULTIPLY, and ARRAY-DIVIDE commands may have only numeric variables or literals as the source fields. Move the string data into a #numeric variable and then reference the #numeric variable. You can move array fields only into $string variables or #numeric variables. Correct the source line. When moving data into or out of arrays, the source or destination variables must match the array fields in type. CHAR fields can be stored into/from strings, NUMBER fields into/from numeric variables. Check the CREATE-ARRAY command.
003511
003512
Only numeric variables and fields allowed with array arithmetic commands.
003513
003514
345
SQR Messages
Appendix A
Suggestion/Interpretation The ARRAY command must not have more variables listed to the left of the array name than there are matching fields defined for the array. Check against the CREATE-ARRAY command. Reduce the number of arrays needed by the program. 01 = Maximum number of arrays supported by this version of SQR
003516
003517
003518
003519
Reduce the number of fields. 01 = Maximum number of fields allowed per array Correct the syntax. 01 = The name of the field Change the name of one of the fields. 01 = The name of the field
003520
003521
003522
Optional :nn for FIELD must be between 1 and 64K. CREATE-ARRAY FIELDS :type must be one of the following: 01 Missing NAME= in CREATE-ARRAY. Missing or incorrect SIZE= in CREATE-ARRAY.
003523
003525
003526
346
Appendix A
SQR Messages
Error Message Missing FIELD= statements in CREATE-ARRAY. Array dimensioned too large for PC in CREATE-ARRAY.
003528
On 32bit systems, the maximum allocation that can be made is 65520 characters. The array as specified would exceed this limit. Reduce the number of entries. Correct the syntax. 01 = Name of the field Correct the syntax. Use the -Mfile flag on the command line to specify a file containing an entry that increases the currently defined value. This is an informational message.
003529
003600 003601
Missing ask variable name. Out of substitution or #DEFINE variables; use -Mfile to increase SUBVARS.
003603
WARNING: Substitution variables do not vary when saved with run-time. No substitution variable entered.
003605
The C routine "fgets()" returned an error and SQR ends the program run. The END-paragraph command to match the specified paragraph is missing. Correct the source file. 01 = BEGIN-paragraph in question Verify the spelling of the command. Correct the syntax. 01 = Offending command name The BEGIN-paragraph command is not allowed here. Review your SQR code for a misplaced paragraph. Correct the syntax. Correct the syntax.
003700
003701 003702
003703
003704 003705
347
SQR Messages
Appendix A
Suggestion/Interpretation Correct the syntax. The DO or BEGIN-PROCEDURE command has an error in its argument list, possibly extra characters after the final right parentheses. Correct the source line. The DO or BEGIN-PROCEDURE command has an error in its argument list, possibly two commas in a row inside the parentheses. Correct the source line. Correct the syntax.
003708
Empty Argument.
003709
Only $string and #number variables allowed for BEGIN-PROCEDURE parameters. Unknown argument type.
003710
An argument in a DO or BEGIN-PROCEDURE command is incorrect. Verify the spelling of the variable types. Correct the syntax.
003711
Indicate :$string or :#number returned values in BEGINPROCEDURE only. Missing ). 01 paragraph not allowed with -XL option in effect.
003712 003713
Correct the syntax. Either use the #IF command to conditionally compile the program when -XL is being used or do not execute this SQR report with the -XL option. 01 = Name of the BEGIN-paragraph The -Cnn value must be a non-zero value. Correct the source line. Correct the source code. 01 = BEGIN-command in question
003714
003715
348
Appendix A
SQR Messages
Suggestion/Interpretation The database server has determined that the SQL statement is in error. The actual error text from the server follows this message. Correct the SQL statement. Remove the extra characters after the dash. An expression in a SELECT list must end with either a &column variable or a position parameter "(Row,Col,Len)". Correct the source line. You are trying to select the same &column name more than once. Change the assigned &column name by using an alias after the name. Columns retrieved from the database are assigned names by prepending an "&" to the beginning of the name. If your program logic requires that you stop processing after more than 32767 rows have been retrieved, you could count the rows manually and use the EXIT-SELECT command to break out of the SELECT loop. (DB2) Correct the syntax.
003717
Extra characters after expression continuation. Did not find end of expression.
003718
003719
Columns names and expressions must be unique or be given unique pseudonyms (&name).
003720
003721
Bad param found on BEGIN-SELECT line; Format is: BEGIN-SELECT [DISTINCT] [-Cnn] [- Bnn] [LOOPS=nn] [ONERROR=procedure[(arg1[,argi]...)]] Bad param found on BEGIN-SELECT line; Format is: BEGIN-SELECT [DISTINCT] [-Cnn] [LOOPS=nn] [ON-ERROR= procedure[(arg1[,argi]...)]] Bad param found on BEGIN-SELECT line; Format is: BEGIN-SELECT [DISTINCT] [-Cnn] [LOOPS=nn] [ON-ERROR= procedure[(arg1[,argi]...)]] [-DB=database]
003721
003721
349
SQR Messages
Appendix A
Error Message Bad param found on BEGIN-SELECT line; Format is: BEGIN-SELECT [DISTINCT] [-Cnn] [- Bnn] [LOOPS=nn] [ONERROR=procedure[(arg1[,argi]...)]] Bad param found on BEGIN-SELECT line; Format is: BEGIN-SELECT [DISTINCT] [-Cnn] [- XP] [LOOPS=nnn] [ONERROR=procedure[(arg1[,argi]...)]] Could not set up cursor.
003721
003722
An error occurred while trying to compile the SQL statement. Review any $string variable references. Correct the SQL statement or use the ON-ERROR= option to trap the error during the program run. An error occurred while trying to execute the SQL statement. Review the $string variable references. Correct the SQL statement or use the ON-ERROR= option to trap the error during the program run. The database command to cancel the query returned an error. Try running the SQR program again. The error could be related to a network or server problem. If the error persists, contact your system administrator. The database returned an error status for the last row that was fetched. This is commonly due to the buffer not being large enough. If selecting expressions, make sure that the length of the first expression is adequate for all rows selected. Literals must be surrounded by single quotes (). To embed a quote within a literal use two single quotes in sequence (). Correct the source line.
003723
003724
003725
003726
350
Appendix A
SQR Messages
Error Message SQL expression not ended, perhaps parentheses not balanced.
Suggestion/Interpretation An expression in a SELECT list must end with either a &column variable or a position parameter "(Row,Col,Len)". Correct the source line. An expression in a SELECT list must end with either a &column variable or a position parameter "(Row,Col,Len)". Correct the source line. An expression in a SELECT list must end with either a &column variable or a position parameter "(Row,Col,Len)". Correct the source line. (DB2) Correct the syntax.
003728
003729
003730
Incorrect arguments for BEGIN-SQL: [-Cnn] [ONERROR=procedure[(arg1[,argi]...)]] Incorrect arguments for BEGIN-SQL: [-Cnn] [ONERROR=procedure[(arg1[,argi]...)]] Incorrect arguments for BEGIN-SQL: [-Cnn] [-NR] [ONERROR=procedure(arg1[,argi]...)]] [-DB=] Incorrect arguments for BEGIN-SQL: [-Cnn] [ONERROR=procedure[(arg1[,argi]...)]] Incorrect arguments for BEGIN-SQL: [-Cnn] [-XP] [ONERROR=procedure[(arg1[,argi]...)]] Did not find END- SQL after BEGIN- SQL. ON-ERROR= for BEGIN-SQL in SETUP section must be STOP, WARN or SKIP.
003730
003730
003730
003730
003731
003732
351
SQR Messages
Appendix A
Suggestion/Interpretation (Sybase) SQR could not create a stored procedure for the SQL statement. The most likely cause for failure is that the user name you are using to run the report under does not have the proper privileges. Either grant the user CREATE PROCEDURE privilege or use the -XP command line option to inhibit SQR from creating temporary stored procedures for SQL statements. Correct the SQL statement or use the ON-ERROR= option to trap the error during the program run. An error occurred while trying to compile the SQL statement. Correct the SQL statement or use the ON-ERROR= option to trap the error during the program run. (Oracle, Informix, ODBC) Correct the source code.
003734
003735
003736
Please use BEGIN-SELECT END-SELECT section for SELECT statements. Bad fetch buffer count.
003737
(Oracle, Sybase) The -B flag specifies an illegal value. Correct the source code. This is an informational message. Correct the syntax.
003738 003741
Report interrupted by request. Dynamic column must be $string variable. Dynamic column missing 01.
003742
003743
Dynamic columns must have a &pseudonym. &pseudonym =type must be char, number, or date.
003744
352
Appendix A
SQR Messages
Error Message Only a variable name may be between the 01 and 02 characters.
003746
When dynamic columns are used all non-dynamic columns and expressions must be defined with &name=type. When the table name is dynamic each column and expression must be defined with &name=type. Too many document paragraphs; maximum is 01.
003747
003800
There are too many BEGIN-DOCUMENT paragraphs. Reduce the number of DOCUMENT paragraphs needed by the program. 01 = Maximum number supported by this version of SQR
003801
There are too many BEGIN-DOCUMENT paragraphs. Reduce the number of DOCUMENT paragraphs needed by the program. 01 = Maximum number supported by this version of SQR
003802
Specify a unique name for the the document marker. The BEGIN-DOCUMENT paragraph must end with END-DOCUMENT. Correct the source code. Correct the syntax. The -Cnn value must be a nonzero value. Correct the source line. Correct the source line.
003803
003900 003901
EXECUTE command is incomplete. Bad -Cnn connection number for EXECUTE. @#Return_status must be #numeric (missing #).
003902
353
SQR Messages
Appendix A
003904
Variable names must begin with $, #, or &. Correct the source line. Correct the syntax.
003905
OUT[PUT] variables for EXECUTE may only be $variable or #variable. The only EXECUTE option is WITH RECOMPILE. You must EXECUTE ... INTO &columns. Unknown datatype for EXECUTE...INTO &columns.
003906
003907
003908
Verify the spelling of the data type. If the data type is correct, then contact customer technical support so SQR can be updated. The &column name assigned to the column must be unique throughout the report. Specify a unique name for the column. Correct the source line.
003909
003910
Missing (length) for datatype in EXECUTE. Datatype should not have (length) in EXECUTE. DO= in EXECUTE requires INTO... variables. Could not EXECUTE stored procedure.
003911
003912
003913
Record the database error message displayed with this message. If needed, contact your system administrator. Record the database error message displayed with this message. If necessary, contact your system administrator.
003914
354
Appendix A
SQR Messages
Suggestion/Interpretation The database server returned an error while trying to compile the SQL statement needed to set up the EXECUTE command. The LET command is not properly formatted. Correct the source line. The expression is either too long or is too deeply nested. Break the expression into smaller expressions. A left or right parenthesis is missing. Correct the source line. Break the expression into smaller expressions. 01 = Maximum number supported by this version of SQR
004000
004001
004002
004003
004004
Empty expression.
The expression is invalid. Correct the source line. An argument is missing after a comma in the expression. Correct the source line. The concatenation operator is ||. Correct the source line. The expression contains too many forward references. Break the expression into smaller expressions. 01 = Maximum number supported by this version of SQR
004005
004006
Unknown operator 01. Do you mean 02 ? Too many &column forward references in expression; maximum is 01.
004007
004008
The specified function is not an SQR built-in function nor does it exist in the user-modifiable file UFUNC.C. Verify that the function names are spelled correctly. 01 = Function name
355
SQR Messages
Appendix A
Suggestion/Interpretation All functions in an expression must be followed by their arguments enclosed in parentheses. Correct the source line. A pair of parentheses were found with nothing inside them. Remove the () in question from the source line. Look at the file UFUNC.C to determine the correct number and type of arguments required for the specified function. 01 = User function name
004010
004011
004012
Correct the syntax of the function. Functions are described under the LET command. 01 = SQR function name
004013 004014
Correct the source line. Correct the syntax of the function. Functions are described under the LET command. 01 = Operator
004015
Correct the syntax of the function. Functions are described under the LET command. 01 = SQR function name
004016
Correct the syntax of the function. Functions are described under the LET command. 01 = SQR function name
004017
Look at the file UFUNC.C to determine the correct number and type of arguments required for the specified function. 01 = User function name
356
Appendix A
SQR Messages
Suggestion/Interpretation Look at the file UFUNC.C to determine the correct number and type of arguments required for the specified function. 01 = User function name
004019
Look at the file UFUNC.C to determine the correct number and type of arguments required for the specified function. 01 = User function name
004020
Look at the file UFUNC.C to determine the correct number and type of arguments required for the specified function. 01 = User function name
004021
User function 01 has incorrect argument type list. Must be of: c,n,C,N
The UFUNC.C file has a bad definition for the specified function. Correct the UFUNC.C program file, recompile UFUNC.C, and recreate the SQR executable. 01 = User function name
004022
Look at the file UFUNC.C to determine the correct number and type of arguments required for the specified function. 01 = User function name The UFUNC.C file has a bad definition for the specified function. Correct the UFUNC.C program file, recompile UFUNC.C, and recreate the SQR executable. 01 = User function name #numeric variables cannot be NULL. Correct the source line. #numeric variables cannot be NULL. Correct the source line.
004023
004024
isnull requires a &column, $string or $date argument. nvl requires a &column, $string or $date as its first argument.
004025
357
SQR Messages
Appendix A
Suggestion/Interpretation Correct the source line. 01 = Function or operator Correct the source line. 01 = Function or operator The expression used must evaluate a statement that will be TRUE or FALSE. Correct the source line. The expression tried to divide a number by zero. Use the COND() function to determine whether the divisor is zero; then divide by something else (for example, 1). An attempt was made to divide a number using the " %" operator. Use the COND() function to determine whether the divisor is zero; then divide by something else (for example, 1). The "%" operator works only with integers. Correct the program logic. 01 = Maximum value allowed
004027
004028
004029
004030
004031
004032
User function has unknown return type -- expecting n or c -- need to recompile Run-Time file?
SQR detected an error while processing a user defined function. If you are running an .sqt file, it probably needs to be recompiled because the user function has changed its definition. If you are running an .sqr file, you need to correct the UFUNC.C program file, recompile UFUNC.C, and recreate the SQR executable. SQR detected an error while processing a user defined function. Correct the UFUNC.C program file, recompile UFUNC.C, and recreate the SQR executable.
004033
358
Appendix A
SQR Messages
Suggestion/Interpretation Verify the spelling of the array name. 01 = Array name Verify the spelling of the array field name. 01 = Array field name
004035
004036
Most of the SQR mathematical built-in functions have a corresponding C library routine. One returned an error. Break the expression into discrete expressions in order to identify the function that caused the error. Record the steps leading up to the error and contact technical support. The expression requires more temporary string storage than is currently allocated. Use the -Mfile flag on the command line to specify a file that contains an entry that increases by a greater value than is currently defined. Warning message. 01 = Expression in question Define the array using the CREATE-ARRAY command. 01 = Array name Correct the source code. 01 = Field name 02 = Array name
004037
004038
004039
004040
004041
004042
359
SQR Messages
Appendix A
Error Message The array reference 01 requires numeric parameters for the element and occurs arguments. Function or operator 01 requires date argument.
Suggestion/Interpretation Correct the source code. 01 = Array name. Correct the source code. 01 = Array name Correct the source code.
004045
004046
Incompatible types between expression and variable. The field 01 is must be char or float.
004047
Correct the source code. 01 = Field name Correct the source line. 01 = Function or operator You must precede PRINT command arguments (WRAP, ON-BREAK.) with an explicit PRINT command when outside of a BEGIN-SELECT paragraph. Correct the source line. Correct the syntax. A command expecting a numeric literal or :#numeric variable reference found an illegal number definition or a reference to a string variable or column. Correct the source line. Correct the syntax.
004048
004100
004101 004102
004103
004104
The position qualifier "(Row,Col,Len)" was not found. Search for a missing parentheses. The "Row", "Column" or "Length" fields are invalid or ill-formed. Correct the source line.
004105
360
Appendix A
SQR Messages
Suggestion/Interpretation An SQR command used as a qualifier for a primary command (for example, PRINT) is incorrect. Correct the source line. The PRINT command may have format command qualifiers such as WRAP, CENTER, or FILL. Other qualifier commands are not permitted. Correct the source line. Correct the source line. Correct the syntax. Expressions selected in a BEGIN-SELECT paragraph should be given an &Name or be followed by a print position "(Row,Col,Len)". Correct the source line. Correct the syntax. Correct the syntax. 01 = What was expected Correct the syntax. 01 = What was expected 02 = What was encountered
004107
Missing operator =, <, >, ... Invalid operator. Missing variable. Please give this expression a &pseudonym.
004112 004113
004114
004115
Unknown command or extra parameters found (missing quotes?). Duplicate references to parameter 01.
004116
Correct the syntax. 01 = Duplicated parameter Correct the syntax. 01 = Parameter name
004117
361
SQR Messages
Appendix A
004119
Expecting numeric column, found string column. Date variables (01) cannot be used with this command.
004120
Correct the syntax. 01 = Parameter name The values specified with the PAGE-SIZE command are out of specified range. Specify legal values. The maximum page buffer allocation on a PC is 65536. The Page-Depth * Page-Width cannot exceed this value. Reduce the Page-Depth or Page-Width. The report output cannot be generated for a Line Printer. If your report was designed for a graphics printer, specify PRINTER:{HP,EH,HT,PS,WP} for graphical printer output. The placement parameter is ill-formed. Correct the source line. Screen positions must be valid numbers. Correct the source line. A literal or variable name must immediately precede the EDIT, NUMBER, MONEY, or DATE keywords. The word EDIT must be followed by a valid edit mask. Correct the source line.
004200
004201
004202
Cannot generate line printer output for this report because position qualifier(s) may be out of range. If you are running this report, specify PRINTER:{HP,EH,HT ,PS,WP} for graphical printer output. Missing end of placement (...) in SHOW.
004300
004301
004302
004303
362
Appendix A
SQR Messages
Error Message Only string variable allowed for dynamic edit mask. Unknown option for SHOW. Program too large; use -Mfile to increase PROGLINES.
Suggestion/Interpretation Dynamic edit masks may only be stored in $variables. Correct the line. Correct the syntax. The SQR program contains too many SQR command lines. Use the -Mfile flag on the command line to specify a file containing an entry that increases the currently defined value. The SQR program contains too many SQR command line parameters. Use the -Mfile flag on the command line to specify a file containing an entry that increases the currently defined value. The space allocated to hold the static string variables (...) has been used. Use the - Mfile flag on the command line to specify a file containing an entry that increases the currently defined value. There are too many variables (string, numeric), literals and database columns. Use the -Mfile flag on the command line to specify a file containing an entry that increases the currently defined value. A forward referenced variable is a variable that is referenced before it is defined. Use the -Mfile flag on the command line to specify a file containing an entry that increases the currently defined value. Use a different value. 01 = Internal number
004305 004400
004401
004402
004403
004405
004406
004407
References were made to column variables (&var) that are not defined in the program. The list of variable names follows this message.
363
SQR Messages
Appendix A
Suggestion/Interpretation A print position is the "(Row,Col,Len)" parameter. Use the -Mfile flag on the command line to specify a file containing an entry that increases the currently defined value. The use of "-#variable" is not legal here. Negate the #variable value and use "+#variable". Correct the source line as indicated.
004501
004503
Fixed line placement #variable must be > 0. Use relative positioning, (+#line,10,0). Fixed column placement #variable must be > 0. Use relative positioning, (5,+#col,0). Length placement #variable must be >= 0. CODE not appropriate for numeric data.
004504
004505
The length field cannot be a negative value. Correct the source line. The CODE qualifier to the PRINT command may only be used for text fields. Move the #Variable to a $Variable first and then print the $Variable. Correct the syntax.
004600
004601
Unknown option for GRAPHIC command: BOX, HORZ-LINE, VERT-LINE or FONT GRAPHIC BOX out of bounds. Row: 01, Column: 02, Width: 03, Depth: 04
004602
004603
GRAPHIC VERT- LINE out of bounds. Row: 01, Column: 02, Length: 03
364
Appendix A
SQR Messages
Error Message GRAPHIC HORZ- LINE out of bounds. Row: 01, Column: 02, Length: 03
004700
Depends on the system error message. 01 = Name of the program file 02 = System error code 03 = System error message
004701
The connectivity information is either incorrect or the database server is unavailable. Verify the connectivity information and the server availability. All commands must be within BEGIN-... END-statements. Correct the source code. Depends on the system error message. 01 = System error code 02 = System error message
004702
004703
004704
Missing an #ENDIF to complete conditional compilation. Correct the source code. Break the program line into smaller lines. 01 = Maximum line length supported by this version of SQR
004705
365
SQR Messages
Appendix A
Error Message Substitution variable {01} would cause this line to exceed the maximum line length of 02 characters.
Suggestion/Interpretation The substitution variable value would cause this line to exceed the maximum line size. Break the program line into smaller lines. 01 = Name of the substitution variable 02 = Maximum line length supported by this version of SQR
004707
An empty value was found for the substitution variable. Verify the spelling of the substitution variable. 01 = Name of the substitution variable
004708
Missing an #IF or #IFDEF or #IFNDEF to begin conditional compilation. Correct the source code. Missing an #IF or #IFDEF or #IFNDEF to begin conditional compilation. Correct the source code. Reduce the number of nested #IF directives. 01 = The maximum depth supported by this version of SQR
004709
004710
004711
Reduce the number of nested #INCLUDE directives. 01 = The maximum depth supported by this version of SQR
004712
The combined -I directory name with the #INCLUDE file name exceeds the maximum length permitted for a complete path name. Verify the spelling of both the -I command flag and the #INCLUDE filename.
366
Appendix A
SQR Messages
Suggestion/Interpretation 01 = Include file name 02 = System error code 03 = System error message
004714
004716
BEGIN-REPORT command not found in program. Cannot open the report output file: 01 (02): 03
This section is required for all reports. Correct the source code. 01 = Output file name 02 = System error code 03 = System error message
004717
004719
The database server returned an error while trying to log off from the database. SQR ends the program run. SQR ends the program run. 01 = Run-Time file name 02 = System error code 03 = System error message
004720
004721
SQR ends the program run. 01 = System error code 02 = System error message
004722
SQR ends the program run. 01 = System error code 02 = System error message
004723
The runtime file was created by a earlier version of SQR and is incompatible with the current version. Recreate the .sqt (runtime) file.
367
SQR Messages
Appendix A
Error Message The -XL option cannot be specified with this run-time file because access to the database is required. Cannot open cursor.
004725
The database server returned an error indicating that a new database cursor or logon could not be completed. See the error message from the database server. (Sybase) SQR could not create a stored procedure for the SQL statement. The most likely cause for failure is that the user name you are running the report under does not have the proper privileges. Either grant the user CREATE PROCEDURE privilege or use the -XP command line option to inhibit SQR from creating temporary stored procedures for SQL statements. 01 = System error code 02 = System error message (MVS) Use the proper format to specify the name of the .sqt file.
004726
004727
004728
You must specify a Partitioned Data Set name and member to build a .sqt(member) run-time file. Could not create the run-time file. Cannot find inactive database cursor. Program too large.
004729
(Oracle, DB2) The program has too many concurrent database cursors. Reduce the complexity of the program. This is an informational message. 01 = Name of the .sqt file created
004730
004735
SQR ends loading the runtime file. 01 = Variable type SQR ends loading the runtime file.
004736
368
Appendix A
SQR Messages
Error Message Cannot load the run- time file because it was built for the 01database and 02 is built for the 03 database.
Suggestion/Interpretation SQR ends loading the runtime file. 01 = Database name from runtime file 02 = SQR image name 03 = Database that SQR is built for
004738
END-REPORT not paired with BEGIN- REPORT. END-PROGRAM not paired with BEGIN- PROGRAM. #INCLUDE filename must be enclosed in quotation marks. #INCLUDE command format is: #Include filename. Array field (01.02) specification exceeds the PC 64K limit.
004739
004743
004744
004745
Reduce the size of the field requirements. 01 = Array name 02 = Field name
004746
The layout is too large for the 32bit version of SQR to handle. 01 = Layout name
004747
The SQT file is corrupted and cannot be processed. The user function 01 needs to be defined as entry 02 in the user function table. It requires a definition of: Return Type = 03 Arg Count = 04 Arg Types = "05"
004748
The SQT file requires that the specified user function be defined. 01 = User function name 02 = Entry in the user function table 03 = Return type 04 = Argument count 05 = Argument types
369
SQR Messages
Appendix A
Error Message An attempt was made to move 01 characters into 02. The maximum allowed is 03 characters.
Suggestion/Interpretation An attempt was made to move too much data into an SQR string variable. 01 = Number of characters to be moved 02 = Variable name 03 = Maximum characters allowed
004802
PRINTER TYPE must be HTML, HPLASERJET, POSTSCRIPT, or LINEPRINTER. Both BEFORE-BOLD and AFTER-BOLD must be specified. Unknown DECLARE qualifier. Out of dynamic SQL arguments [$...]; use -Mfile to increase DYNAMICARGS.
004805
004807 004900
Correct the syntax. Use the -Mfile flag on the command line to specify a file containing an entry that increases the currently defined value.
004901
Date variables (01) cannot be used in BEGIN-SQL or BEGIN-SELECT paragraphs. Report 01 heading section size exceeds the page depth. Report 01 footing location must be less than the page depth. Check BEGIN- HEADING commands: Discovered 2nd pageinitialization while heading in progress.
Correct the source code. 01 = Variable name Reduce the size of the heading or increase the page depth. Reduce the size of the footing or increase the page depth. The BEGIN-HEADING procedure either caused an overflow of the current page or it issued a command that caused a page eject to occur. Review any procedure invoked by the BEGIN-HEADING section to ensure that the commands do not overflow the page or cause a page eject.
005000
005001
005002
370
Appendix A
SQR Messages
Error Message Check BEGIN-FOOTING commands; perhaps number of footing lines is too small. Discovered 2nd page- write while footing in progress.
Suggestion/Interpretation The BEGIN-FOOTING procedure either caused an overflow of the current page or it issued a command that caused a page eject to occur. Review any procedure invoked by the BEGIN-FOOTING section to ensure that the commands do not overflow the page or cause a page eject. Change the SQR program logic to prevent the command from executing while the specified section is active. 01 = Command name 02 = Section name
005004
005005
005006
Correct the source code. 01 = Duplicated section name Correct the source code. 01 = Report name Correct the source code. 01 = Table of Contents name 02 = Duplicated section name
005007
005008
005100
Reduce the nested commands. 01 = Maximum depth allowed by this version of SQR The BREAK command is valid only in the context of a WHILE or EVALUATE statement. Correct the source code.
005101
371
SQR Messages
Appendix A
Suggestion/Interpretation This is the number of BREAK commands allowed per EVALUATE command. Use the -Mfile flag on the command line to specify a file containing an entry that increases the currently defined value. Correct the source code.
005103
END-WHILE found without matching WHILE. IF or EVALUATE command not completed before END-WHILE. ELSE found without matching IF.
005104
005105
ELSE can be used only within the context of an IF command. Correct the source code. ELSE can be used only within the context of an IF command. Correct the source code. Rewrite the source code to use nested IF statements. Each IF command must have a matching END-IF command. Correct the source code. You are missing a closing END-WHILE or END-EVALUATE command before END- IF. IF, WHILE, and EVALUATE statements can be nested, but they cannot cross each others boundaries. Each inner statement must be complete before a closing statement is ended. Correct the source code. Reduce the number of nested statements. 01 = Maximum depth supported by this version of SQR
005106
Single ELSE found inside WHILE or EVALUATE statement. Only one ELSE allowed per IF.
005107
005108
005109
005110
372
Appendix A
SQR Messages
Suggestion/Interpretation WHEN may be used only in the context of an EVALUATE clause. Correct the source code. Correct the syntax.
005112
IF or WHILE not completed before WHEN statement. Out of When commands; Use -Mfile to increase WHENS.
005113
Use the -Mfile flag on the command line to specify a file containing an entry that increases the currently defined value. Correct the source line.
005114
Incorrect types for comparison. Both must be of the same type (string, numeric or date). When-other found outside Evaluate statement.
005115
WHEN can be used only in the context of an EVALUATE statement. Correct the source code. Correct the syntax.
005116
IF or WHILE not ended before WHEN- OTHER command. Only one WHEN- OTHER allowed per EVALUATE. Found END-EVALUATE without matching EVALUATE.
005117
005118
Each EVALUATE command must have a matching END-EVALUATE command. Correct the source code. Correct the syntax.
005119
IF or WHILE command not completed before ENDEVALUATE. WHEN-OTHER must be after all WHENs. No WHENs found inside EVALUATE statement. IF, EVALUATE and WHILE statements cannot cross sections or paragraphs.
005120
005121
005122
These commands must be contained within a single section or paragraph. Correct the source code.
373
SQR Messages
Appendix A
Suggestion/Interpretation A leading left angled bracket (<) indicates that you are beginning an decimal value representing a character, which must be ended by a right angled bracket (>). Correct the source line. Numbers in angled brackets (<>) must be between 1 and 255. Correct the source line. Numbers in angled brackets (<>) must be between 1 and 255. Correct the source line. Reduce the length of the string. If this is not possible, use a PRINT-DIRECT command in a BEGIN-REPORT or END-REPORT procedure. 01 = Maximum number of characters supported by this version of SQR Correct the syntax. 01 = Qualifier name
005201
005202
005203
005300
005301
Correct the syntax. 01 = Qualifier name Correct the source line. 01 = Qualifier name Correct the source line. 01 = Qualifier name Correct the source line. 01 = Qualifier name Correct the source line. 01 = Qualifier name
005302
005303
005304
005305
374
Appendix A
SQR Messages
Suggestion/Interpretation Correct the source line. 01 = Qualifier name Correct the syntax. Correct the syntax. Correct the source line. 01 = Qualifier name Correct the source line. 01 = Qualifier name Correct the source line. 01 = Qualifier name Correct the source line. 01 = Qualifier name Correct the source line. 01 = Qualifier name Correct the source line. 01 = Invalid character Correct the source line. 01 = Qualifier name Correct the source line. 01 = Qualifier name Review any procedure invoked by the BEFORE-PAGE or AFTER-PAGE procedures to ensure that the commands do not overflow the page or cause a page eject.
List not terminated. Missing comma in list. Required argument 01 was not specified.
005310
005311
005312
005313
005314
005315
005316
Qualifier 01 uses an invalid Unit-Of-Measure suffix. Valid suffixes are: dp pt mm cm in Second page write attempted while writing current page. Check BEFORE- PAGE, AFTER-PAGE procedures.
005400
375
SQR Messages
Appendix A
Error Message String cannot be placed on page: 01 -- placement specified is out of range. (02,03,04)
Suggestion/Interpretation Ensure the values are within the page limits. 01 = Text value 02 = Row 03 = Column 04 = Length
005403
01 = System error code 02 = System error message 01 = Name of the file 02 = System error code 03 = System error message
005404
005405
SQR trial copy exiting after 01 pages. Exiting after requested number of test pages (01). Program stopped by user request. Cannot set parse_only option.
01 = Number of pages.
005406
01 = Number of pages.
005408 005500
This is an informational message. (Sybase) The DB-Library routine dbsetopt() returned an error. This error should never occur. Contact technical support. (Sybase) The DB-Library routine dbclropt() returned an error. This error should never occur. Contact technical support. (Sybase) See the database server error message that was also output. This error should never occur. Contact technical support. 01 = Stored procedure name
005501
005502
376
Appendix A
SQR Messages
005504
(Sybase) Contact technical support. 01 = Unknown database datatype (Sybase) The size of the SQL text needed to create the stored procedure is too large for SQR to process. Add the -XP option to the BEGIN-SQL or BEGIN-SELECT command. (Sybase) Some early versions of Sybase SQL Server or Microsoft SQL Server do not support Remote Procedure Calls (RPCs). Update your database server. (Sybase) A DB-Library routine returned an unexpected error. See the error message from the database. (Sybase) Verify the definition for the stored procedure you are referencing. (Sybase) Verify the definition for the stored procedure you are referencing. (Sybase) The DB-Library routine dbconvert() failed to convert the data from the stored procedure. Contact technical support. (Sybase) Verify the definition for the stored procedure you are referencing. (Sybase) Correct the syntax.
005505
005506
005507
005508
The number of EXECUTE...INTO &columns does not match the procedure. Incorrect number of INTO &columns defined in EXECUTE.
005509
005510
005511
005512
377
SQR Messages
Appendix A
Error Message Missing default database name for USE. You may only specify USE db once, before any SQL statements are executed.
Suggestion/Interpretation (ODBC) Could not connect to the specified datasource. (Sybase) Only one USE command is allowed in a report. Place the SETUP section at the beginning of the SQR report. (ODBC) Verify that there are no misspellings. 01 = Variable name The database command to perform a commit returned an error. Try running the SQR program again. The error could be related to a network or server problem. If the error persists, contact your system administrator. The database command to close the database cursor returned an error. Try running the SQR program again. The error could be related to a network or server problem. If the error persists, contact your system administrator. (DB2) 01 = Routine name 02 = Error code 03 = SQR cursor number
005513
005515
005523
005524
005528
005528
(Informix) 01 = Routine name 02 = Error code 03 = ISAM code 04 = SQR cursor number 05 = Error message from database
378
Appendix A
SQR Messages
Suggestion/Interpretation (ODBC) 01 = Routine name 02 = Error code 03 = SQR cursor number 04 = Error message from database
005528
(Oracle) 01 = Routine name 02 = Error code 03 = SQR cursor number 04 = Error message from database
005528
(Sybase) 01 = Routine name 02 = SQR cursor number 03 = Error message from database
005532
(Sybase) Contact your system administrator. (Sybase) The CT-Library version of SQR can only connect to a System 10 server. Use the DB-Library version of SQR to connect to a version earlier than System 10 server. (DB2) The SQL statement is too large. 01 = Maximum number of characters supported by this version of SQR (DB2) 01 = Error message number (DB2) 01 = Error message number
005533
005534
005536
005537
Empty error message returned from system for error number: 01.
379
SQR Messages
Appendix A
Error Message Invalid SELECT statement; COMPUTE clauses are not supported. Could not connect to datasource specified in -db variable: 01. Not connected to a database, database access is not allowed.
Suggestion/Interpretation (Sybase) The select statement contains a COMPUTE clause that is not supported. (ODBC) Could not connect to the specified datasource. The SQR program is no longer connected to a database. Commands that access the database can no longer be used. This situation can occur if the CONNECT fails and the ON-ERROR option was used. (Oracle) SQR was unable to load the Oracle DLL. By default, SQR looks first for ociw32.dll or the DLL specified by the ORACLE_DLL entry in the [Environment:Oracle] section of the sqr.ini file. If that DLL could not be loaded, then SQR attempts to load orant71.dll. Reduce the length of the "word". 01 = Maximum size of a "word" supported by this version of SQR SQR cannot be called recursively. This error can only occur if a User Function from either UFUNC.C or UCALL.C calls the sqr() routine. Do not call sqr() from a UFUNC.C or UCALL.C routine. To pass more than this number of arguments, use a @file argument file containing one argument per line. 01 = Maximum number supported by this version of SQR.
005539
005540
005543
Specify the Oracle DLL name in the sqr.ini file in [Environment:Oracle] section for ORACLE_DLL entry, such as ORACLE_DLL=orant 71.dll
005600
005700
005701
005702
380
Appendix A
SQR Messages
Suggestion/Interpretation 01 = Name of the file 02 = System error code 03 = System error message
005704
The name of the program file was not found on the command line. The program name must be the first parameter on the command line. Reduce the length of the program file name. 01 = Name of the file 02 = System error code 03 = System error message
005705
Program file name specified is too long. Error opening the -E error file: 01 (02): 03
005707
005708
The specified file cannot be located in any of the directories pointed to by the mentioned environment variables or default directories. Make sure the "file" is present in one of the locations searched. 01 = File name
005709
As of version 2.5, the environment variable SQRDIR must be defined. 01 = Name of the environment variable
005710
The length of the directory path plus the length of the file name to be opened is too long for SQR to handle. Reduce the length of the directory path. 01 = Environment variable name
005711
The number specified must be > zero. Correct the value. Correct the syntax. 01 = Unknown command line flag
005716
381
SQR Messages
Appendix A
Suggestion/Interpretation (Tru64, UNIX/Linux) This is an error that should never occur during normal operations. Record the steps leading up to the error and contact your system administrator. 01 = System error code 02 = System error message
005721
(Tru64, UNIX/Linux) This is an error that should never occur during normal operations. Record the steps leading up to the error and contact your system administrator. 01 = System error code 02 = System error message
005722
(Tru64, UNIX/Linux) This is an error that should never occur during normal operations. Record the steps leading up to the error and contact your system administrator. 01 = System error code 02 = System error message
005723
(Tru64, UNIX/Linux) This is an error that should never occur during normal operations. Record the steps leading up to the error and contact your system administrator. 01 = System error code 02 = System error message
005724
(Oracle, Sybase) The number specified must be greater than zero. Correct the value. The report name must be the first command line argument. The printer type can be EH, HT, LP, HP, PS, or WP. WP is valid only with PC/Windows.
005734
005737
382
Appendix A
SQR Messages
Error Message Database name needs to be included with - DB switch. Database name needs to be included with - DB switch. Too many -F switches; maximum is 01.
Suggestion/Interpretation (ODBC) Could not connect to the specified datasource. (Sybase) Supply the database name.
005738
005739
Reduce the number of -F switches. 01 = Maximum number allowed (MVS) Correct the JCL stream.
005740
-F and outfile name are required with DDN or DD style SQR {program} name. Attempting to use SQR {program} file for outfile. Attempt to invoke viewer (using WinExec) failed; error code = 01.
005741
005742
005743
Unknown numeric type specified with - DNT: switch. -DNT:Decimal precision (01) is out of range (02 - 03).
005744
Correct the command line. 01 = Specified precision 02 = Minimum allowed 03 = Maximum allowed
005745
005746
Correct the sqr.ini file entry. 01 = Entry 02 = Value 03 = Minimum allowed 04 = Maximum allowed
383
SQR Messages
Appendix A
Error Message The following error(s) occurred while processing the [01] section from the sqr.ini file. The -Burst switch is not properly formatted. The -Burst switch cannot be used with the -NOLIS switch.
Suggestion/Interpretation See the error message(s) that follow. 01 = Name of the section The Burst command line flag is not properly formatted. The Burst command line flag cannot be specified when the -NOLIS command line flag is also specified. The Burst command line flag is applicable only when HTML code is produced. You must specify either the -PRINTER:HT or PRINTER:EH switch. The Burst command line flag can only be specified when processing a SPF file that was generated by SQR v4.1 and above. Older SPF files do not contain the proper information that permits bursting. The Burst command line flag was specified with a set of page ranges that prevented any output to be created. Change the page ranges. (Windows) Specify a valid number. 01 = Command line option
005750
005751
005752
The -Burst switch requires either the - Printer:HT or - Printer:EH switch to be specified.
005753
The -Burst:S and - Burst:T switches can only be used against an SPF file which was generated with SQR v4.1 and above.
005754
005900
005901
005902
384
Appendix A
SQR Messages
Suggestion/Interpretation (Windows) Depends on the system error message. 01 = System error code 02 = System error message
005904
(Windows) To pass more than this number of arguments, use a @file argument file containing one argument per line. 01 = Maximum number supported by this version of SQR.
005905
(Windows) Depends on the system error message. 01 = System error code 02 = System error message
005906
(Windows) Re-enter with a valid file name. This is an error that can occur during normal operations due to the system environment (for example, file locking and permissions). Record the steps leading up to the error and contact your system administrator. 01 = System error code 02 = System error message
006000
006001
This is an error that can occur during normal operations due to the system environment (for example, file locking and permissions). Record the steps leading up to the error and contact your system administrator. 01 = System error code 02 = System error message
385
SQR Messages
Appendix A
Suggestion/Interpretation This is an error that can occur during normal operations due to the system environment (for example, file locking and permissions). Record the steps leading up to the error and contact your system administrator. 01 = Name of the file 02 = System error code 03 = System error message
006003
The file might be corrupted. Try to recreate the .spf file. If the error persists, contact technical support. The file might be corrupted. Try to recreate the .spf file. If the error persists, contact technical support. 01 = Unknown SPF code
006004
Encountered unknown SPF code (01) while reading the printer file.
006100
006101
006102
Number of chart data- array columns specified (01) exceeds the number of array columns (02).
Correct the source code. 01 = Number of data-array columns 02 = Number of array columns
006103
Number of chart data- array rows specified (01) exceeds the number of array rows (02).
Correct the source code. 01 = Number of data-array rows 02 = Number of array rows
006104
386
Appendix A
SQR Messages
Suggestion/Interpretation This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. Correct the syntax.
006106
XY charts may have only numeric columns. The 3rd column in the data array must be a character column to specify USE-3RDDATA-COLUMN. Invalid chart size or placement. INTERNAL: Bad chart index from stack (01).
006107
006108 006120
Correct the source code. This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Chart index
006121
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Message code
006122
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Chart type
006123
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Setting value
387
SQR Messages
Appendix A
Suggestion/Interpretation This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Placement value
006125
This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Message code
006126
This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Return code 02 = Message code
006127
Cannot fit Chart/Image into the current page. Position: (01, 02) Size: (03, 04)
Correct the source code. SQR ends the program run. 01 = Row 02 = Column 03 = Width 04 = Depth
006128 006140
Correct the syntax. Images must be given unique names. 01 = Image name
006141
006142
388
Appendix A
SQR Messages
Suggestion/Interpretation This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Image name
006200
Each report must be given a unique name. Each layout must be given a unique name. Each printer must be given a unique name. Correct the syntax. 01 = Qualifier name
006201
This layout has already been defined. This printer has already been defined. The values for 01 must be > 0.
006202
006203
006204
006205
006206
The list must contain report names or ALL. ALL must be specified by itself. No report name was specified. No layout name was specified. No printer name was specified. The name cannot be ALL.
Correct the syntax. Correct the syntax. Correct the syntax. Correct the syntax. Correct the syntax.
389
SQR Messages
Appendix A
Error Message The name can only contain characters [0-9 A-Z _ -]. Report 01 is referenced by multiple 02 printers.
006213
006214
006215
006216
006217
Correct the syntax. 01 = Report name A list of undefined layouts follows this message. A list of undefined reports follows this message. A list of undefined printers follows this message. Correct the syntax.
006218
006219
006220
006221
The following SQR commands (listed below) cannot be used when any of the following NEW SQR commands are also used in the same report: No printer type was specified.
006224
390
Appendix A
SQR Messages
Error Message Incorrect value for printer type. Valid values are: Attempt to execute the 01 command while processing the 02 procedure.
Suggestion/Interpretation Correct the syntax. A list of valid printer types follows this message. SQR ends the program run. 01 = SQR command 02 = Procedure name
006226
006227
Incorrect value for paper-size. Specify the actual dimensions or one of the following names: Referenced TOC (Table Of Contents) not defined: This TOC (Table Of Contents) has already been defined. The list must contain TOC (Table of Contents) names or ALL. The TOC (Table Of Contents) entry cannot be positioned given the LEVEL (01) and INDENTATION (02) values.
Correct the syntax. A list of valid predefined paper-size names follows this message. A list of undefined Table of Contents follows this message. Each Table of Contents must be given a unique name. Correct the syntax.
006228
006229
006230
006231
The Table of Contents entry will not fit given the specified level and current indentation values. 01 = Specified LEVEL= value 02 = Current INDENTATION= value
006232
The specified command cannot be used while the Table of Contents is being generated. 01 = SQR command
391
SQR Messages
Appendix A
Error Message The TOC (Table of Contents) entry "A" cannot be processed because the existing entry "B" is positioned below it. A: Line = 01, Level = 02, Text = 03 B: Line = 04, Level = 05, Text = 06
Suggestion/Interpretation Correct the program logic to eliminate the conflict between the two TOC (Table of Contents) entries. 01 = A: Line number 02 = A: Level value 03 = A: Text value 04 = B: Line number 05 = B: Level value 06 = B: Text value
006300
006301
006302
006303
Correct the syntax. 01 = Parameter name Correct the syntax. 01 = Parameter name
006304
006305
Correct the syntax. 01 = Parameter name Correct the syntax. 01 = Parameter name
006306
006307
392
Appendix A
SQR Messages
Suggestion/Interpretation Correct the syntax. 01 = Parameter name Correct the syntax. 01 = Parameter name
006309
006310
Correct the syntax. 01 = Parameter name Correct the syntax. 01 = Parameter name Correct the syntax. 01 = Parameter name Correct the syntax. 01 = Parameter name Correct the syntax. 01 = Parameter name Correct the syntax. 01 = Parameter name Correct the syntax. 01 = Parameter name
006311
006312
006313
006314
006315
006316
006317
Correct the syntax. 01 = Parameter name Correct the syntax. 01 = Parameter name Correct the syntax. 01 = Parameter name
006318
006320
393
SQR Messages
Appendix A
Suggestion/Interpretation This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = From type 02 = To type
006352
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Option/request code 02 = Function name
006354
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Data type
006355
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Parameter name
006356
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Parameter name 02 = Data type
394
Appendix A
SQR Messages
Error Message INTERNAL: Data location (02) not valid for data type (01).
Suggestion/Interpretation This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Data location 02 = Data type
006358
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = String to decode
006359
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = Parameter name 02 = Value
006360
This is an internal error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = State
006400
This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support.
006401
006402
395
SQR Messages
Appendix A
Suggestion/Interpretation This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support.
006404
006405
006406
006407
Unsupported font.
006408
006409
006410
006411
396
Appendix A
SQR Messages
Suggestion/Interpretation This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support.
006413
006414
006415
006416
006417
006418
006419
006420
397
SQR Messages
Appendix A
Suggestion/Interpretation This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support.
006422
006423
006424
006425
006426
006427
006428
006429
398
Appendix A
SQR Messages
Suggestion/Interpretation This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support.
006431
006432
006433
006434
006435
006436
006437
006438
399
SQR Messages
Appendix A
Suggestion/Interpretation This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support.
006440
006441
006442
006443
006444
006445
006446
006447
400
Appendix A
SQR Messages
Error Message Pie and text charts do not support axis control.
Suggestion/Interpretation This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support.
006449, 006450
006451
006452
006453
006454
006455
006456
006457
401
SQR Messages
Appendix A
Suggestion/Interpretation This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. Correct the source code. 01 = Row 02 = Column 03 = Height
006459
006460
006461
006462
006463
The shared library specified in the grafcap file could not be found.
006464
A function called from the shared library specified in the grafcap file could not be found.
006500
The bar code could not be positioned on the page. Row: 01, Column: 02, Height: 03
006501
This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. 01 = BCL error code
402
Appendix A
SQR Messages
Error Message Invalid bar code type (01): Valid values are from 1 to 15.
Suggestion/Interpretation Correct the source code. 01 = Bar code type. Correct the source code. 01 = Bar code text Correct the source code. 01 = Caption text Correct the source code. 01 = Printer type Correct the source code.
006503
The length of the bar code text 01 must be between 1 and 30 characters. The length of the caption text 01 must be between 1 and 30 characters. Invalid printer type (01): Valid values are from 0 to 13.
006504
006505
006506
Invalid offset: Valid values are from 0 to 250. Invalid height (01): Valid values are from 0.1 to 2.0 inches.
006507
006508
Invalid checksum: Valid values are from 0 to 2. Invalid pass: Valid values are from 1 to 6. The bar code text 01 is not valid for the type of bar code (02) selected.
006509
006510
Correct the source code. 01 = Bar code text 02 = Bar code type
006511
This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support.
006512
403
SQR Messages
Appendix A
Error Message Cannot allocate the device context for the default printer.
Suggestion/Interpretation (Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator. (Windows) This is an error that can occur due to lack of system resources or a problem with the printer. Record the steps leading up to the error and contact your system administrator. (Windows) This is an error that can occur due to lack of system resources or a problem with the printer. Record the steps leading up to the error and contact your system administrator. 01 = Page number
006602
006603
006604
(Windows) This is an error that can occur due to lack of system resources or a problem with the printer. Record the steps leading up to the error and contact your system administrator. 01 = Page number
006605
(Windows) This is an error that can occur due to lack of system resources or a problem with the printer. Record the steps leading up to the error and contact your system administrator. (Windows) Correct the [Fonts] section in the sqr.ini file.
006606
Error reading font information from the [Fonts] section in sqr.ini. Using the default font. Failed to create a brush for shading.
006607
(Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator.
404
Appendix A
SQR Messages
Suggestion/Interpretation (Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator. 01 = Font name
006609
(Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator. 01 = Font name
006610
(Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator. (Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator. (Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator. (Windows) This is an error that can occur during normal operations due to the system environment (file locking, permissions). Record the steps leading up to the error and contact your system administrator. 01 = Name of the file 02 = System error code 03 = System error message (Windows) Specify a valid bitmap file. 01 = Name of the file
006611
006612
006613
006614
405
SQR Messages
Appendix A
Suggestion/Interpretation (Windows) This is an error that can occur due to lack of system resources or an invalid bitmap. Record the steps leading up to the error and contact your system administrator. 01 = Name of the file (Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator. 01 = Name of the file
006616
006617
(Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator. 01 = Name of the file
006618
(Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator. 01 = Name of the file
006619
(Windows) This is an error that can occur due to lack of system resources or a problem with the printer. Record the steps leading up to the error and contact your system administrator. (Windows) This is an error that can occur due to lack of system resources or a problem with the printer. Record the steps leading up to the error and contact your system administrator. (Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator.
006620
Cannot select the charting clip area onto the printers DC.
006621
406
Appendix A
SQR Messages
Suggestion/Interpretation (Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator. (Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator. (Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator. (Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator. (Windows) This is an error that can occur due to lack of system resources or due to a damaged LIBSTI.INI file. The LIBSTI.INI file resides in the Windows main directory. Make sure that the GPATH= and IPT= entries point to a valid SQR BINW directory. Record the steps leading up to the error and contact your system administrator. (Windows) The variable SQRDIR must be defined in the sqr.ini file. (Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator.
006623
006624
006625
006626
006700
006701
Could not allocate memory while attempting to register the .spf filename extension.
407
SQR Messages
Appendix A
Error Message Could not allocate memory for the page cache.
Suggestion/Interpretation (Windows) This is an error that should never occur during normal operations. Record the steps leading up to the error and contact technical support. (Windows) This is an error that can occur during normal operations due to the system environment (for example, file locking and permissions). Record the steps leading up to the error and contact your system administrator. 01 = Name of the file 02 = System error code 03 = System error message
006704
006705
(Windows) The file was not produced by SQR or has been corrupted. 01 = Name of the file
006706
(Windows) The file was not produced by SQR or has been corrupted. 01 = Name of the file
006707
(Windows) This is an internal error which should not occur under normal operations. Contact technical support. 01 = Page number
006708
Too many errors were encountered while processing the file. Processing has been stopped.
(Windows) This is an error that can occur due to lack of system resources. Record the steps leading up to the error and contact your system administrator.
408
Appendix A
SQR Messages
Error Message Failed to open the image bitmap file (01). (02): 03 This message is displayed only once per SPF file.
Suggestion/Interpretation (Windows) This is an error that can occur during normal operations due to the system environment (for example, file locking and permissions). Record the steps leading up to the error and contact your system administrator. 01 = Name of the file 02 = System error code 03 = System error message
006800
This is an internal error that should never occur during normal operation. Record the steps leading up to the error and contact technical support. 01 = Name of the routine
006801
This is an internal error that should never occur during normal operation. Record the steps leading up to the error and contact technical support. 01 = Name of the routine
006802
Exponent Under/Overflow: Exponent of decimal number has exceeded the valid boundaries established for the decimal type. Review the documentation for the current upper and lower bounds of a decimal object. 01 = Name of the routine
006803
Integer Under/Overflow: Cannot convert input decimal object into a valid integer number. Decimal object exceeds the established integer boundaries for this machine architecture. Review the magnitude and sign of the decimal object to ensure that it falls within the upper and lower bounds of an integer number. 01 = Name of the routine
409
SQR Messages
Appendix A
Suggestion/Interpretation Floating Point Under/Overflow: Cannot convert input decimal object into a valid floating point number. The decimal object exceeds the established floating point boundaries for this machine architecture. Review the magnitude and sign of the decimal object to ensure that it falls within the upper and lower bounds of a floating point number. 01 = Name of the routine Decimal Precision Under/Overflow: Attempt made to initialize decimal object with an invalid precision. Verify the input precision value against the documented upper and lower boundaries for a decimal object. 01 = Name of the routine String To Decimal Conversion Error: The length of input string is greater than the precision of underlying decimal object. Either increase the precision of the decimal object or reduce the size of the input mantissa to match the decimal object precision. 01 = Name of the routine Truncation/Rounding Error: Input truncation or round value is outside the valid range for this decimal object. Ensure that the truncation/round value is greater than or equal to zero and less than the precision of the underlying decimal object. 01 = Name of the routine Decimal Math Divide by Zero Error: Attempt made to divide a decimal object by zero. Ensure that the divisor does not equal zero before attempting to divide. 01 = Name of the routine (Windows) SQR Print requires that a default printer be defined. Use the "Printers" applet in the Control Panel to define one.
006805
006806
006807
006808
006900
There is no default printer set up on your system. Use the Control Panel "Printers" applet to define it.
410
Appendix A
SQR Messages
Suggestion/Interpretation Verify the spelling of the locale name or the sqr.ini file. 01 = Locale name
007001
At least one qualifier must be specified. The value for 01 must be a list of 02 string literals, variables or columns.
007002
007003
007004
The value for 01 (02) must be a single character which is not in the list: "03".
007005
007006
The last character of the 01 value (02) cannot be a digit or the minus sign or the same as either of the separators.
Correct the source code. 01 = Qualifier 02 = Invalid character Correct the source code. 01 = Qualifier 02 = Invalid character This message precedes error messages encountered while processing the sqr.ini file. 01 = Locale name
007007
The first character of the 01 value (02) cannot be a digit or the minus sign or the same as either of the separators.
00700
The following errors occurred while processing the (01) locale from the sqr.ini file.
411
SQR Messages
Appendix A
Suggestion/Interpretation Correct the syntax. 01 = Qualifier Correct the syntax. 01 = Qualifier 02 = Value
007010
The value for 01 (02) is not properly formatted: Did not find the > for the <nnn> construct.
007011
The value for 01 (02) is not properly formatted: The value of an <nnn> construct must be from 1 to 255.
Correct the syntax. 01 = Qualifier 02 = Value Correct the syntax. 01 = Locale name 02 = Section name
007012
The default locale (01) specified in the [02] section of the sqr.ini file has not been defined.
007013
007014
Correct the sqr.ini entry. 01 = Qualifier from the sqr.ini file 02 = Qualifiers value
007100
The use of an edit mask or the keywords NUMBER, MONEY or DATE is not legal when storing numeric variables. The last keyword is not 01.
007101
007102
412
Appendix A
SQR Messages
Error Message The keyword (01) is not compatible with the variable (02).
007104
The use of an edit mask or the keyword DATE is not legal if both variables are date variables. The specified precision (01) is out of range (02 - 03).
007200
Correct the source code. 01 = Specified precision 02 = Minimum precision 03 = Maximum precision
007201
007202
Variable (01) is not a decimal variable and cannot have a precision associated with it. A string variable name is required here. A numeric variable name is required here. The variable (01) has already been defined as 02 and may not be redefined.
Correct the source code. 01 = Variable name Correct the source code.
007203
007204
007205
007206
The variable type has not been specified. This command is only allowed within local procedures. This command must be before all other commands in the procedure.
007207
007208
413
SQR Messages
Appendix A
Error Message Only string ($) and numeric (#) variables may be declared. Invalid variable name specified. You cannot declare a global variable from within a procedure. The specified character is invalid in the current character set. 01 is not a valid value for the ENCODING environment variable.
007210 007211
007400
007401
The specified encoding scheme is not known by SQR. 01 = ENCODING environment variable setting.
007402
The SQT file contains a reference to a LET function, which is not supported by this version of SQR. 01 = LET function name
007403
The SQT file contains a reference to an SQR command, which is not supported by this version of SQR. 01 = SQR command name
007404
The runtime file was created by the double-byte version of SQR and is incompatible with the current version. Correct the source code. 01 = Bar code text
007405
414
Appendix A
SQR Messages
Suggestion/Interpretation A date edit mask element, which could cause date data to be incorrectly interpreted, was detected. This warning message can be turned off by setting the OutputTwoDigitYearWarningMsg entry in the [Default- Settings] section of the sqr.ini file to FALSE. 01 = Edit mask element 02 = Edit mask being used 03 = Value being applied to the edit mask
007601
SQR cannot access the required file. 01 = Name of the file 02 = System error code 03 = System error message
007602
Correct the command line. 01 = Specified scale 02 = Minimum allowed 03 = Maximum allowed
007603
-Printer:EH functionality is not available on this platform. -Printer:PD functionality is not available on this platform. Did not find end of paragraph: 01 (No end-execute clause found.)
Enhanced HTML functionality is not available on this platform. PDF functionality is not available on this platform. Correct the source code. 01 = BEGIN-command in question. Correct the source code. Correct the source code.
007604
007701
007702 007703
Invalid entry for keyword, 01=02 May only specify either PROCEDURE=, or COMMAND=, or GETDATA=, exclusive. Must specify a SCHEMA.
007704
415
SQR Messages
Appendix A
Error Message Must specify either a PROCEDURE, COMMAND, or GETDATA. CONNECTION 01 not found. No such connection. The returned set of Procedure parameters (INOUT and OUT) (length = 01 items) did not include one or more of the specified items. Encountered a parameter of type 01. Valid types are either IN, OUT, or INOUT. If no type is entered, the type defaults to IN. The datasource failed to provide the expected return status value. Verify the query metadata. The datasource failed to provide the expected number of elements in the return status list. Failed to login to the requested datasource (Connection=01, username=02). DETAILS: 03 The requested rowset (01) was not available. Verify the query metadata. Missing or invalid Registry.properties file. Verify that the CLASSPATH includes SQRDIR, that SQRDIR contains the folder with the Registry.properties file, and that the Registry.properties file is valid. The datasource (01) does not support the requested capability (02). Check the capabilities list for the datasource, located in the Properties folder.
007706
007707
007708
007709
Datasource error.
007710
Datasource error.
007711
Logon failed.
007712
007713
007714
416
Appendix A
SQR Messages
Error Message Failed to start the Java Virtual Machine (JVM). Possible causes are: missing or invalid jdk files, incorrect CLASSPATH, or insufficient resources. The current rowset (01) contained no rows. Check the return status and/or metadata for the requested service to determine the cause. The query failed. DETAILS: 01 Failure setting property 01. DETAILS: 02 The value for keyword 01 exceeds the maximum length of 02 characters. A fatal error occurred while fetching against the current rowset: DETAILS: 01 Parameter 01 (02) was passed to the PROCEDURE as data type 03; expected (04) type 05. Verify the query metadata. Invalid query parameter: Reason: 01 Too many parameters (= 01) were supplied to the query. Verify the query metadata. Parameter 01 (02) was passed to the PROCEDURE as type 03; expected type 04. Verify the query metadata. Parameter 01 (02, JDO-type 03), specified NULL, is a required-parameter. Specify a value or variable name.
007716
No data.
007717 007718
007719
007720
007721
007722
007723
007724
007725
417
SQR Messages
Appendix A
Error Message The list-variable parameter to the query is too long. Maximum number of elements is 30. Unable to retrieve metadata for Procedure=01, Schema=02. DETAILS: 03 Parameter list type mismatch (#01, SQR type = 02). The datasource expected a parameter of type 03. Verify the query metadata. List size mismatch detected while fetching data of type ROW, 01 items, into SQR list- variable, 02 items. Fetching will proceed to the smaller size. Incorrect syntax for BEGIN-SELECT ... FROM. Options are: FROM ROWSETS=... FROM PARAMETER= $strvar | strlit Attempted to pass as INOUT or OUT a parameter which was of type ROWSET (01). Use of such parameters is supported as IN only, after which they may be used in a BEGIN- SELECT construct. Attempt to use a scalar SQR variable (01) to reference a ROWSET procedure parameter (02). Use either the keyword NULL, or an SQR LIST variable (%var). Verify the query metadata. The list of keywords entered to the PARAMETERS keyword must be terminated with a semicolon. Datasource 01 not found. The Connection being used by this query specifies a datasource which is not listed in the DDO Registry (02). DETAILS: 03.
007727
007728
007729
007730
007731
007732
007733
007734
<obsolete>
418
Appendix A
SQR Messages
Error Message Missing one or more DDO {fname} .jar files. Verify the location of the original- installation files, and that they are accessible. Error code: 01. Classpath: 02. Unable to open Connection (01) to datasource (02). Possible causes: (a) the Declare-Connection specification is invalid, or (b) the datasource is no longer available. DETAILS: 03. Unable to locate one or more entry points in an SQR {fname}.jar file. Verify that the original-installation files have not become corrupted. At least one JNI method pointer was lost. This should never occur: record the steps leading up to this failure, and contact Technical Support. DETAILS: Schema=01, Proc=02. Unable to locate query object 01 in the specified schema (02). DETAILS: 03. Invalid &pseudonym or TYPE= data-type specified for a beginselect column-variable. Valid types are: CHAR, TEXT, DATE, NUMBER. Illegal attempt to fetch a non-scalar field into a column variable. Correct the query. The output parameter specified in Begin- Select ... From Parameter = 01 is not available. Available parameters: 02. The output parameter specified in Begin- Select ... From Parameter = 01 is not of type ROWSET. Verify the query metadata.
Suggestion/Interpretation <obsolete>
007736
Bad environment.
007737
Bad environment.
007738
Bad environment.
007739
Bad environment.
007740
007741
007742
Bad command.
007743
Bad command.
419
SQR Messages
Appendix A
Error Message Illegal attempt to assign an SQR variable (01) of type 02 the value from a DDO object (03) of type 04. Verify the query metadata. Illegal attempt to assign an SQR column variable (01) of type 02 the value from a DDO object of type 03. Verify the query metadata. Failed to locate the requested Rowset (01) while processing the query. The last available Rowset number is 02. Verify the query metadata. The query raised a DDO exception. DETAILS: 01. A BEGIN-SELECT paragraph was coded, but the query returned no Rows. Invalid syntax for PARAMETERS= (...) statement. Use: PARAMETERS=( %v | $v | #v | &v | NULL | SKIP | numlit | datelit | textlit [IN | INOUT], ...) All parameters must be specified. Optional parameters which are to be ignored may be specified by the keyword NULL or SKIP. Correct the syntax. FATAL: Failure creating Java object. Attempt to create a List variable of size greater than the maximum size of 01 items. Parameter-list item 01 is not a member of the parameter list for this Query. Verify the query metadata. Attempt to access List- row (01) beyond the List size (02 rows).
Suggestion/Interpretation <obsolete>
007745
<obsolete>
007746
007747
<obsolete>
007748
No data warning.
007749
Incorrect syntax.
007750 007751
007752
007753
420
Appendix A
SQR Messages
Error Message Attempt to assign/modify a List row is not compatible with the List definition. Attempt to assign a row to a non-existent List variable. Define the List first, using the syntax: let %lname[ size ] = list( NUMBER | DATE | TEXT #var | $var [, ...] ) Incorrect syntax for List-variable reference. Use: let [$ | #]var = %listname[nlit | #var].colname Alter-connection statement missing DSN=.... List-definition size specifier must be literal. Attempt to access a non-existent List- column (01). Must specify one of the keywords, FROM- ROWSETS or FROM_PARAMETER . Incorrect syntax to Load-lookup PARAMETERS= keyword. Use: PARAMETERS=(slit | nlit | $var | #var | %var | &var, ...) No line wrapping is allowed for this usage. Too many parameters ( 02) entered to Load- Lookup command. Max parameters is 01. Problem executing the cursor for LOAD- LOOKUP table 01. DETAILS: 02.
007755
007756
007757
Improper alter-conn.
007758
Improper alter-conn.
007759
007760
007761
007762
007763
The database server returned an error while trying to execute the SQL statement needed to process the LOAD-LOOKUP command. 01 = Load lookup table name
421
SQR Messages
Appendix A
Error Message Bad return fetching row from database in LOAD-LOOKUP table 01. DETAILS: 02
Suggestion/Interpretation The database server returned an error while fetching the data. 01 = Load lookup table name Database sort not supported for LOAD_LOOKUP with DDO. <obsolete> Incorrect syntax for Load-lookup. Specify a keyword representing the query. Unknown data type returned by the server. Verify the metadata and correct the syntax.
007765
DC, DI sort options not supported with this SQR version. To sort, use SORT=SC or SORT=SI. Must specify a query keyword; PROCEDURE=, COMMAND= or GETDATA=. Unknown column variable type.
007766
007767
007768
The property 01 was not found in the property sheet for the specified datasource (02). Available property names are: 03.The datasource property sheet does not include the named property. The specified CONNECTION (01) references a datasource whose property sheet does not show support for the Get-Data query method.The datasource property sheet does not show support for Get-Data. Attempt to create a Selector (or MDSelector) object failed. This event should not occur. Contact your system administrator. Error reading the font information from the [01] section in sqr.ini. Font name 02 is too long. The maximum length allowed for a font name is 03.
007769
Verify the metadata and property sheet and correct the syntax.
007770
009000
Use a shorter font name in sqr.ini. 01 = Printing device specific font configuration section. 02 = Font name. 03 = Internal limit for font name.
422
Appendix A
SQR Messages
Error Message Error reading the font information from the [01] section in sqr.ini. Font file path 02 is too long. The maximum length allowed for a font file path is 03.
Suggestion/Interpretation Use a shorter font file path in sqr.ini. Relocate font file if necessary. 01 = Font configuration section name. 02 = Font file path. 03 = Internal limit for file path.
009002
Font 01 is not valid for 02 output. Please correct the font configuration in the [02 Fonts] section of the sqr.ini file.
Use a valid font. Refer to the documentation for supported fonts. If you are using disk based fonts like TrueType, also ensure that the font type specific configuration section (like [TrueType Fonts]) is correctly configured. 01 = Font name. 02 = Selected output type.
009003
File name for 01 font 02 is not specified correctly. Please correct the configuration in the [01 Fonts] section of sqr.ini file.
The font file path is not specified correctly. Correct the sqr.ini file. 01 = Font type. 02 = Font name.
009004
01 font file 02 cannot be opened. Please check if the file exists, or correct the font configuration in the [01 Fonts] section of the sqr.ini file.
Either the font file does not exist in the location specified in sqr.ini file, or the path specified in sqr.ini file is not correct. Correct the error and try again. 01 = Font type. 02 = Font file path.
009005
The directory ID specified for 01 in the [TrueType Fonts] section of the sqr.ini file exceeds the actual number of fonts included in the TrueType collection font file. 02 includes 03 fonts. Please specify a valid directory ID.
Correct the configuration in sqr.ini so that the directory ID is set correctly for the font. Note that the directory ID starts from 0. 01 = Font name. 02 = Font file path. 03 = Actual number of fonts included in TrueType collection.
423
SQR Messages
Appendix A
Suggestion/Interpretation Currently, SQR does not support CFF based OpenType font. Remove the font from the configuration and try again. This TrueType/OpenType font does not have the table SQR needs for processing. Remove the font from the configuration and try again. 01 = Font name. 02 = Table name.
009007
Font 01 is not a supported type of TrueType/OpenType font. The 02 table is missing from the font file.
009008
Font 01 is not a supported type of TrueType/OpenType font. This font does not allow embedding in a document.
SQR requires TrueType/OpenType font with embedding feature allowed to include the subset of the font in the print output. This TrueType/OpenType font does not allow embedding. Remove the font from the configuration and try again. SQR requires a TrueType/OpenType font with CMAP table with Platform ID 3 (Microsoft), Encoding ID 0 (Symbol), 4 (UCS-2), or 10 (UCS-4) and table format 4 or 12. Other CMAP table types and encodings are currently not supported. Remove the font from the configuration and try again. 01 = Font name
009009
Font 01 is not a supported type of TrueType/OpenType font. This font does not have a supported type of character to glyph mapping (CMAP) table.
009010
Error in the [01:Exclusion Ranges] section in theINI file. Start character code must be greater than the end character code.
In the exclusion range section, the start character code must be smaller than the end character code. Review the section in INI file and correct error. You can specify the range in a decimal or hexadecimal number. If you use a hexadecimal number, you must prefix the number with 0x or the number is recognized as a decimal.
424
APPENDIX B
APPEND.SQR
425
Appendix B
Name COMP_FOR.SQR
Description Prints a graph of the forecasted and actual sales for a given employee. Prints a graph of the forecasted and actual sales for a month or quarter. Prints a graph of the planned and actual sales for a given employee. Prints a graph of the planned and actual sales for month or quarter. Uses SQR to input data from a user, enter the data in the database, and write a form letter by using a DOCUMENT paragraph. Prints a list of all of the customers, bursted by page. Demonstrates printing mailing labels within columns. Demonstrates multiple detail lines and the NEXT-LISTING command. Demonstrates the use of the ON-BREAK argument to the PRINT command. Demonstrates the use of the INPUT command to change the report output. Demonstrates the use of arrays. Demonstrates dynamic queries to enable the user to qualify a report as it runs. Prints a group of information about each customer in the customer table. Demonstrates the flat file output for magnetic tape or other postprocessing. Needed for append.sqr.
COMP_F_G.SQR
COMP_PLN.SQR
COMP_P_G.SQR
COVLET02.SQR
CUSTOMR2.SQR
CUSTOMR3.SQR
CUSTOMR4.SQR CUSTOMR5.SQR
CUST_SUM.SQR
CUSTTAPE.SQR
DATAA.DAT
426
Appendix B
Description
Drops all of the SQR sample tables that are created by the LOADALL program. (Sybase) Deletes leftover, temporary stored procedures belonging to the user. Demonstrates the use of dynamic columns, dynamic tables, and variables that are passed to the ON-ERROR procedure. Prints a list of all of the employees, bursted by page. Calculates each employees commission, based on sales. Lists all employee quotas for a given month or quarter. Demonstrates the use of printing envelope with proper bar codes. Creates two SQR reports: one to export a database table and one to import that table. Data from the table is stored in an external operating system file in compressed format, with trailing blanks removed. Creates an SQR report to extract a database table and place it in a flat file. Demonstrates a floating bar chart. Creates a sales forecast for a given customer, grouped by month or quarter. Creates a sales forecast for a given employee, grouped by month or quarter. Creates a sales forecast for a given product, grouped by month or quarter. Creates a sales forecast for a given region, grouped by month or quarter.
DROPPROC.SQR
DYNAMCOL.SQR
EXPORT.SQR
FLATFILE.SQR
FLOATBAR.SQR FOR_CUST.SQR
FOR_EMP.SQR
FOR_PROD.SQR
FOR_REG.SQR
427
Appendix B
Name FOR_SUM.SQR
Description Creates a table of projected product sales with links to more information. Demonstrates form letters by using a document paragraph. Demonstrates a high-low-close chart. Demonstrates a histogram chart. Creates an SQR program to display rows at your terminal that are selected from a database table that you specify. The resulting SQR program prompts you to qualify the rows to be selected, display those rows, then repeat. Demonstrates creating multiple reports, printing invoices, and printing envelopes. Creates and loads the sample tables that are used in the preceding SQR programs. Creates a data file with a fixed length and NOLF attributes. Helps you create SQR reports more quickly. Demonstrates creating multiple reports. Demonstrates nesting procedures. Lists all of the orders and the order lines that are associated with them. Lists all orders for a given month and groups them by employee number. Lists all orders for a given month or quarter. Lists all orders for a given product. Creates a report of all orders from a given region, grouped by month or quarter.
INVOICE.SQR
LOADALL.SQR
ORD_MONG.SQR
428
Appendix B
Description Displays an summary of orders, grouped by month. Prints a graph of the percent of orders for each region (in a year) and four graphs of the percent of orders for each region (one for each quarter of that year). Demonstrates an overlapped bar chart. Demonstrates printing within columns, page headings, and page footings. Creates a sales plan for a given employee, grouped by month or quarter. Creates a sales plan, grouped by month or quarter. Creates a sales plan for given region, grouped by month or quarter. Lists products and their prices and graphs orders of products. Demonstrates DOCUMENT paragraphs. Demonstrates charting from stored data and printing several charts on one page. Demonstrates a scatter chart. (Sybase) Displays leftover, temporary stored procedures belonging to the user. Demonstrates a stacked area chart. Demonstrates a 3D bar chart. Demonstrates graphic and file input/output commands. Demonstrates a line chart. Demonstrates printing images.
OVERBAR.SQR PHONELST.SQR
PLN_EMP.SQR
PLN_GEN.SQR PLN_REG.SQR
SCATTER.SQR SHOWPROC.SQR
429
Appendix B
Description
Creates a tabular SQR report for a table that you select. Generates an SQR program that enables you to query and update database tables. The created program uses the SHOW command to simulate a menu interface.
430
academic institution
academic organization
accounting date
action reason
431
Glossary
Administration, PeopleSoft Enterprise Stock Administration, and the COBRA Administration feature of the Base Benefits business process. action template In PeopleSoft Enterprise Receivables, outlines a set of escalating actions that the system or user performs based on the period of time that a customer or item has been in an action plan for a specific condition. In PeopleSoft Enterprise Learning Management, an instance of a catalog item (sometimes called a class) that is available for enrollment. The activity defines such things as the costs that are associated with the offering, enrollment limits and deadlines, and waitlisting capacities. In PeopleSoft Enterprise Performance Management, the work of an organization and the aggregation of actions that are used for activity-based costing. In PeopleSoft Enterprise Project Costing, the unit of work that provides a further breakdown of projectsusually into specific tasks. In PeopleSoft Workflow, a specific transaction that you might need to perform in a business process. Because it consists of the steps that are used to perform a transaction, it is also known as a step map. address usage In PeopleSoft Enterprise Campus Solutions, a grouping of address types defining the order in which the address types are used. For example, you might define an address usage code to process addresses in the following order: billing address, dormitory address, home address, and then work address. In PeopleSoft Enterprise Campus Solutions, the adjustment calendar controls how a particular charge is adjusted on a students account when the student drops classes or withdraws from a term. The charge adjustment is based on how much time has elapsed from a predetermined date, and it is determined as a percentage of the original charge amount. In PeopleSoft Enterprise Campus Solutions, a particular functional area that processes checklists, communication, and comments. The administrative function identifies which variable data is added to a persons checklist or communication record when a specific checklist code, communication category, or comment is assigned to the student. This key data enables you to trace that checklist, communication, or comment back to a specific processing event in a functional area. In PeopleSoft Enterprise Campus Solutions, a designation used to distinguish first-year applications from transfer applications. In PeopleSoft Enterprise eSettlements, provides a way to group and specify processing options, such as payment terms, pay from a bank, and notifications by a buyer and supplier location combination. In PeopleSoft Enterprise Incentive Management, an expression within compensation plans that enables the system to assign transactions to nodes and participants. During transaction allocation, the allocation engine traverses the compensation structure from the current node to the root node, checking each node for plans that contain allocation rules. A feature in PeopleSoft Enterprise General Ledger that enables you to create a statutory chart of accounts and enter statutory account transactions at the detail transaction level, as required for recording and reporting by some national governments. In PeopleSoft Enterprise Campus Solutions, database tables that store large amounts of student information that may not appear in standard report formats. The analysis database tables contain keys for all objects in a report that an application program can use to reference other student-record objects that are not contained in the printed report. For instance, the analysis database contains data on courses that are considered
activity
adjustment calendar
administrative function
allocation rule
alternate account
analysis database
432
Glossary
for satisfying a requirement but that are rejected. It also contains information on courses captured by global limits. An analysis database is used in PeopleSoft Enterprise Academic Advisement. Application Messaging PeopleSoft Application Messaging enables applications within the PeopleSoft Enterprise product family to communicate synchronously or asynchronously with other PeopleSoft Enterprise and third-party applications. An application message defines the records and fields to be published or subscribed to. Abbreviation for receivables specialist. In PeopleSoft Enterprise Receivables, an individual in who tracks and resolves deductions and disputed items. The arbiter when multiple price rules match the transaction. This plan determines the order in which the price rules are applied to the transaction base price. In PeopleSoft Enterprise Receivables, a user-defined rule that the system uses to evaluate the condition of a customers account or of individual items to determine whether to generate a follow-up action. An asset group used for reporting purposes. It can be used in conjunction with the asset category to refine asset classification. In PeopleSoft Enterprise Directory Interface, relates the data that makes up an entry in the directory information tree. In PeopleSoft Strategic Sourcing, a sourcing event where bidders actively compete against one another to achieve the best price or score. In PeopleSoft Enterprise Campus Solutions, a segment of the database that relates to an initiative, or a membership organization that is based on constituent attributes rather than a dues-paying structure. Examples of audiences include the Class of 65 and Undergraduate Arts & Sciences. A server that is set up to verify users of the system. In PeopleSoft Enterprise Business Planning, the lowest level time period in a calendar. In PeopleSoft Enterprise Workforce Analytics Solution, a benchmark job is a job code for which there is corresponding salary survey data from published, third-party sources. In PeopleSoft Strategic Sourcing, the response by a bidder to an event. In PeopleSoft Enterprise Campus Solutions, the one career under which other careers are grouped for billing purposes if a student is active simultaneously in multiple careers. In PeopleSoft Enterprise Campus Solutions, a report that summarizes information stored in the system about a particular constituent. You can generate standard or specialized reports. In PeopleSoft Enterprise Asset Management, used for storing financial and tax information, such as costs, depreciation attributes, and retirement information on assets. A tree node that rolls up to nodes above it in the hierarchy, as defined in PeopleSoft Tree Manager. An account used by the system only and not by users; this type of account does not accept transactions. You can only budget with this account. Formerly called system-maintained account.
book
433
Glossary
In commitment control, the processing of source transactions against control budget ledgers, to see if they pass, fail, or pass with a warning. In commitment control, budget control ensures that commitments and expenditures dont exceed budgets. It enables you to track transactions against corresponding budgets and terminate a documents cycle if the defined budget conditions are not met. For example, you can prevent a purchase order from being dispatched to a vendor if there are insufficient funds in the related budget to support it. The interval of time (such as 12 months or 4 quarters) into which a period is divided for budgetary and reporting purposes. The ChartField allows maximum flexibility to define operational accounting time periods without restriction to only one calendar. The name of a subset of a detailed business process. This might be a specific transaction, task, or action that you perform in a business process. In PeopleSoft Enterprise Receivables, defines the processing characteristics for the Receivable Update process for a draft activity. In PeopleSoft Enterprise Sales Incentive Management, an original business transaction or activity that may justify the creation of a PeopleSoft Enterprise Incentive Management event (a sale, for example).
budget period
business process
A standard set of 17 business processes are defined and maintained by the PeopleSoft Enterprise product families and are supported by the Business Process Engineering group. An example of a business process is Order Fulfillment, which is a business process that manages sales orders and contracts, inventory, billing, and so forth. See also detailed business process.
In PeopleSoft Strategic Sourcing, these constraints apply to a selected Strategic Sourcing business unit. Spend is tracked across all of the events within the selected Strategic Sourcing business unit. The name of the specific function depicted in one of the business processes. A corporation or a subset of a corporation that is independent with regard to one or more operational or accounting functions. In PeopleSoft Enterprise eSettlements, an organization (or business unit, as opposed to an individual) that transacts with suppliers (vendors) within the system. A buyer creates payments for purchases that are made in the system. In PeopleSoft Strategic Sourcing, for event creators, the purchase of goods or services, most typically associated with a request for quote, proposal, or reverse auction.For bidders, the sale of goods or services. In PeopleSoft Enterprise Campus Solutions, an entity that is usually associated with a distinct physical administrative unit, that belongs to a single academic institution, that uses a unique course catalog, and that produces a common transcript for students within the same academic career. A repository for monies and payments taken locally. In PeopleSoft Enterprise Learning Management, a specific topic that a learner can study and have tracked. For example, Introduction to Microsoft Word. A catalog item contains general information about the topic and includes a course code, description, categorization, keywords, and delivery methods. A catalog item can have one or more learning activities. In PeopleSoft Enterprise Catalog Management, translates values from the catalog source data to the format of the companys catalog.
buy event
campus
catalog map
434
Glossary
In PeopleSoft Enterprise Catalog Management, shares responsibility with the enterprise catalog manager for maintaining catalog content. Associates partner offerings with catalog offerings and groups them into enterprise catalog categories. In PeopleSoft Enterprise Campus Solutions, a broad grouping to which specific comments or communications (contexts) are assigned. Category codes are also linked to 3C access groups so that you can assign data-entry or view-only privileges across functions. In PeopleSoft MultiChannel Framework, email, chat, voice (computer telephone integration [CTI]), or a generic event. A field that stores a chart of accounts, resources, and so on, depending on the PeopleSoft Enterprise application. ChartField values represent individual account numbers, department codes, and so forth. You can require specific ChartFields to match up (balance) on the debit and the credit side of a transaction. The process of editing journal lines for valid ChartField combinations based on user-defined rules. One or more fields that uniquely identify each row in a table. Some tables contain only one field as the key, while others require a combination. In PeopleSoft Enterprise Promotions Management, enables you to view financial data (such as planned, incurred, and actual amounts) that is related to funds and trade promotions. In PeopleSoft Enterprise Campus Solutions, a code that represents a list of planned or completed action items that can be assigned to a staff member, volunteer, or unit. Checklists enable you to view all action assignments on one page. In the wholesale distribution industry, a contract between supplier and distributor, in which monies are paid to the distributor on the sale of specified products or product groups to targeted customers or customer groups. In PeopleSoft Enterprise Campus Solutions, a specific offering of a course component within an academic term. See also course.
channel ChartField
checklist code
claimback
class
Class ChartField
A ChartField value that identifies a unique appropriation budget key when you combine it with a fund, department ID, and program code, as well as a budget period. Formerly called sub-classification. In PeopleSoft Enterprise Campus Solutions, the period of time during which a constituent in PeopleSoft Enterprise Contributor Relations is approved for involvement in an initiative or an action. Clearances are used to prevent development officers from making multiple requests to a constituent during the same time period. In PeopleCode, to make a unique copy. In contrast, to copy may mean making a new reference to an object, so if the underlying object is changed, both the copy and the original change. In PeopleSoft Enterprise Campus Solutions, the highest level of the three-level classification structure that you define for enrollment management. You can define a cohort level, link it to other levels, and set enrollment target numbers for it. See also population and division.
clearance
clone
cohort
435
Glossary
collection
To make a set of documents available for searching in Verity, you must first create at least one collection. A collection is set of directories and files that allow search application users to use the Verity search engine to quickly find and display source documents that match search criteria. A collection is a set of statistics and pointers to the source documents, stored in a proprietary format on a file server. Because a collection can only store information for a single location, PeopleTools maintains a set of collections (one per language code) for each search index object. In PeopleSoft Enterprise Receivables, a user-defined rule that defines actions to take for a customer based on both the amount and the number of days past due for outstanding balances. See communication key. In PeopleSoft Enterprise Campus Solutions, a single code for entering a combination of communication category, communication context, communication method, communication direction, and standard letter code. Communication keys (also called comm keys or speed keys) can be created for background processes as well as for specific users. In PeopleSoft Enterprise Incentive Management, a node within a compensation structure. Compensation objects are the building blocks that make up a compensation structures hierarchical representation. In PeopleSoft Enterprise Incentive Management, a hierarchical relationship of compensation objects that represents the compensation-related relationship between the objects. A component interface is a set of application programming interfaces (APIs) that you can use to access and modify PeopleSoft Enterprise database information using a program instead of the PeopleSoft client. In PeopleSoft Enterprise Receivables, occurs when there is a change of status for a customers account, such as reaching a credit limit or exceeding a user-defined balance due. Used to configure an external system with PeopleSoft Enterprise. For example, a configuration parameter catalog might set up configuration and communication parameters for an external server. In PeopleSoft Enterprise Incentive Management, configuration plans hold allocation information for common variables (not incentive rules) and are attached to a node without a participant. Configuration plans are not processed by transactions. In PeopleSoft Enterprise Campus Solutions, friends, alumni, organizations, foundations, or other entities affiliated with the institution, and about which the institution maintains information. The constituent types delivered with PeopleSoft Enterprise Contributor Relations Solutions are based on those defined by the Council for the Advancement and Support of Education (CASE). A business policy or rule that affects how a sourcing event is awarded. There are three types of constraints: business, global, and event. Content references are pointers to content registered in the portal registry. These are typically either URLs or iScripts. Content references fall into three categories: target content, templates, and template pagelets. In PeopleCode, determines which buffer fields can be contextually referenced and which is the current row of data on each scroll level when a PeopleCode program is running. In PeopleSoft Enterprise Campus Solutions, a specific instance of a comment or communication. One or more contexts are assigned to a category, which you link to
collection rule
compensation object
compensation structure
component interface
condition
constituents
context
436
Glossary
3C access groups so that you can assign data-entry or view-only privileges across functions. In PeopleSoft Enterprise Incentive Management, a mechanism that is used to determine the scope of a processing run. PeopleSoft Enterprise Incentive Management uses three types of context: plan, period, and run-level. control table Stores information that controls the processing of an application. This type of processing might be consistent throughout an organization, or it might be used only by portions of the organization for more limited sharing of data. A rate-based contract line associated with a fee component of Award, Fixed, Incentive, or Other. Rate-based contract lines associated with a fee type of None are not considered cost-plus contract lines. In PeopleSoft Enterprise Pricer, a pricing method that begins with cost of goods as the basis. A combination of a receipt cost method, a cost flow, and a deplete cost method. A profile is associated with a cost book and determines how items in that book are valued, as well as how the material movement of the item is valued for the book. A cost transaction and amount for a set of ChartFields. A face-to-face customer transaction where the customer typically selects items from the storefront or picks up products that they ordered ahead of time. Customers pay for the goods at the counter and take the goods with them instead of having the goods shipped from a warehouse. In PeopleSoft Enterprise Campus Solutions, a course that is offered by a school and that is typically described in a course catalog. A course has a standard syllabus and credit level; however, these may be modified at the class level. Courses can contain multiple components such as lecture, discussion, and lab. See also class. course share set In PeopleSoft Enterprise Campus Solutions, a tag that defines a set of requirement groups that can share courses. Course share sets are used in PeopleSoft Enterprise Academic Advisement. In PeopleSoft Enterprise Learning Management, a self-service repository for all of a learners in-progress learning activities and programs. In PeopleSoft Enterprise Incentive Management, the process during which raw business transactions are acquired from external source systems and fed into the operational data store (ODS). In PeopleSoft Analytic Calculation Engine, a data cube is a container for one kind of data (such as Sales data) and works with in tandem with one or more dimensions. Dimensions and data cubes in PeopleSoft Analytic Calculation Engine are unrelated to dimensions and online analytical processing (OLAP) cubes in PeopleSoft Cube Manager. Data elements, at their simplest level, define a subset of data and the rules by which to group them. For Workforce Analytics, data elements are rules that tell the system what measures to retrieve about your workforce groups. dataset A data grouping that enables role-based filtering and distribution of data. You can limit the range and quantity of data that is displayed for a user by associating dataset rules with user roles. The result of dataset rules is a set of data that is appropriate for the users roles.
course
data cube
data elements
437
Glossary
delivery method
In PeopleSoft Enterprise Learning Management, identifies the primary type of delivery method in which a particular learning activity is offered. Also provides default values for the learning activity, such as cost and language. This is primarily used to help learners search the catalog for the type of delivery from which they learn best. Because PeopleSoft Enterprise Learning Management is a blended learning system, it does not enforce the delivery method. In PeopleSoft Enterprise Supply Chain Management, identifies the method by which goods are shipped to their destinations (such as truck, air, and rail). The delivery method is specified when creating shipment schedules.
In PeopleSoft Enterprise Learning Management, identifies how learning activities can be deliveredfor example, through online learning, classroom instruction, seminars, books, and so forthin an organization. The type determines whether the delivery method includes scheduled components. A subset of the business process. For example, the detailed business process named Determine Cash Position is a subset of the business process called Cash Management. In PeopleSoft Analytic Calculation Engine, a dimension contains a list of one kind of data that can span various contexts, and it is a basic component of an analytic model. Within the analytic model, a dimension is attached to one or more data cubes. In PeopleSoft Cube Manager, a dimension is the most basic component of an OLAP cube and specifies the PeopleSoft metadata to be used to create the dimensions rollup structure. Dimensions and data cubes in PeopleSoft Analytic Calculation Engine are unrelated to dimensions and OLAP cubes in PeopleSoft Cube Manager. Items shipped from a warehouse or vendor to another warehouse. Items shipped from the vendor or warehouse directly to the customer (formerly referred to as drop ship). In PeopleSoft Enterprise Directory Interface, the representation of a directorys hierarchical structure. In PeopleSoft Enterprise Campus Solutions, the lowest level of the three-level classification structure that you define in PeopleSoft Enterprise Recruiting and Admissions for enrollment management. You can define a division level, link it to other levels, and set enrollment target numbers for it. See also population and cohort.
document sequencing
A flexible method that sequentially numbers the financial transactions (for example, bills, purchase orders, invoices, and payments) in the system for statutory reporting and for tracking commercial transaction activity. A tree that takes its detail valuesdynamic detailsdirectly from a table in the database, rather than from a range of values that are entered by the user. A table in the database that has its own record definition, such as the Department table. As fields are entered into a PeopleSoft Enterprise application, they can be validated against an edit table to ensure data integrity throughout the system. A method of dating information in PeopleSoft Enterprise applications. You can predate information to add historical data to your system, or postdate information in order to enter it before it actually goes into effect. By using effective dates, you dont delete values; you enter a new value with a current effective date. Abbreviation for Enterprise Incentive Management ledger. In PeopleSoft Enterprise Incentive Management, an object to handle incremental result gathering within the scope of a participant. The ledger captures a result set with all of the appropriate traces to the data origin and to the processing steps of which it is a result.
effective date
EIM ledger
438
Glossary
In PeopleSoft Enterprise General Ledger, a related group of intercompany accounts that is processed during consolidations. In PeopleSoft Enterprise General Ledger, Receivables, Payables, Purchasing, and Billing, a business process that generates multiple debits and credits resulting from single transactions to produce standard, supplemental accounting entries. In PeopleSoft Enterprise General Ledger, a business process that enables parent companies to calculate the net income of subsidiaries on a monthly basis and adjust that amount to increase the investment amount and equity income amount before performing consolidations. In PeopleSoft Enterprise Campus Solutions, the amounts of funds set by the institution to be awarded with discretionary or gift funds. The limit could be reduced by amounts equal to such things as expected family contribution (EFC) or parent contribution. Students are packaged by Equity Item Type Groups and Related Equity Item Types. This limit can be used to assure that similar student populations are packaged equally. A predefined point either in the Component Processor flow or in the program flow. As each point is encountered, the event activates each component, triggering any PeopleCode program that is associated with that component and that event. Examples of events are FieldChange, SavePreChange, and RowDelete. In PeopleSoft Enterprise Human Resources, also refers to an incident that affects benefits eligibility.
equitization
event
In PeopleSoft Strategic Sourcing, these constraints are associated with a specific sourcing event. Spend is tracked within the selected event. In PeopleSoft Enterprise Sales Incentive Management, a process that determines, through logic, the propagation of an original PeopleSoft Enterprise Incentive Management event and creates a derivative (duplicate) of the original event to be processed by other objects. PeopleSoft Enterprise Enterprise Sales Incentive Management uses this mechanism to implement splits, roll-ups, and so on. Event propagation determines who receives the credit. In PeopleSoft Enterprise Receivables, an item that either is a deduction or is in dispute. In PeopleSoft Enterprise Order Management, a type of arbitration plan that is associated with a price rule. Exclusive pricing is used to price sales order transactions. In PeopleSoft Enterprise applications, facts are numeric data values from fields from a source database as well as an analytic application. A fact can be anything you want to measure your business by, for example, revenue, actual, budget data, or sales numbers. A fact is stored on a fact table. In PeopleSoft Enterprise Campus Solutions, a combination of a period of time that the school determines as an instructional accounting period and an academic career. It is created and defined during the setup process. Only terms eligible for financial aid are set up for each financial aid career. For U.S. based companies and their foreign subsidiaries, a federal regulation from the Office of Foreign Assets Control (OFAC) requires that vendors be validated against a Specially Designated Nationals (SDN) list prior to payment. For PeopleSoft Payables, eSettlements, Cash Management, and Order to Cash, you can validate your vendors against any financial sanctions list (for example, the SDN list, a European Union list, and so on).
financial sanctions
forecast item
A logical entity with a unique set of descriptive demand and forecast data that is used as the basis to forecast demand. You create forecast items for a wide range of uses, but they ultimately represent things that you buy, sell, or use in your organization and for which you require a predictable usage.
439
Glossary
fund
In PeopleSoft Enterprise Promotions Management, a budget that can be used to fund promotional activity. There are four funding methods: top down, fixed accrual, rolling accrual, and zero-based accrual. In PeopleSoft Enterprise Campus Solutions, an artificial figure that sets aside an amount of unmet financial aid need that is not funded with Title IV funds. A gap can be used to prevent fully funding any student to conserve funds, or it can be used to preserve unmet financial aid need so that institutional funds can be awarded. In PeopleSoft Process Scheduler, process types are identified by a generic process type. For example, the generic process type SQR includes all SQR process types, such as SQR process and SQR report. In PeopleSoft Enterprise Campus Solutions, a table or so-called donor pyramid describing the number and size of gifts that you expect will be needed to successfully complete the campaign in PeopleSoft Enterprise Contributor Relations. The gift table enables you to estimate the number of donors and prospects that you need at each gift level to reach the campaign goal. Abbreviation for Global Distribution System. Broad-based term to describe all computer reservation systems for making travel plans. Abbreviation for general ledger business unit. A unit in an organization that is an independent entity for accounting purposes. It maintains its own set of accounting books. See also business unit.
gap
gift table
GL entry template
Abbreviation for general ledger entry template. In PeopleSoft Enterprise Campus Solutions, a template that defines how a particular item is sent to the general ledger. An item-type maps to the general ledger, and the GL entry template can involve multiple general ledger accounts. The entry to the general ledger is further controlled by high-level flags that control the summarization and the type of accountingthat is, accrual or cash. Abbreviation for General Ledger Interface process. In PeopleSoft Enterprise Campus Solutions, a process that is used to send transactions from PeopleSoft Enterprise Student Financials to the general ledger. Item types are mapped to specific general ledger accounts, enabling transactions to move to the general ledger when the GL Interface process is run. In PeopleSoft Strategic Sourcing, these constraints apply across multiple Strategic Sourcing business units. Spend is tracked across all of the events from the multiple Strategic Sourcing business units. In PeopleSoft Enterprise Billing and Receivables, a posting entity that comprises one or more transactions (items, deposits, payments, transfers, matches, or write-offs). In PeopleSoft Enterprise Human Resources Management and Supply Chain Management, any set of records that are associated under a single name or variable to run calculations in PeopleSoft business processes. In PeopleSoft Enterprise Time and Labor, for example, employees are placed in groups for time reporting purposes.
GL Interface process
global constraints
group
ideal response
In PeopleSoft Strategic Sourcing, a question that requires the response to match the ideal value for the bid to be considered eligible for award. If the response does not match the ideal value, you can still submit the bid, but it will be disqualified and ineligible for award. In PeopleSoft Enterprise Incentive Management, the incentive-related objects that define and support the PeopleSoft Enterprise Incentive Management calculation process and results, such as plan templates, plans, results data, and user interaction objects.
incentive object
440
Glossary
incentive rule
In PeopleSoft Enterprise Sales Incentive Management, the commands that act on transactions and turn them into compensation. A rule is one part in the process of turning a transaction into compensation. In PeopleSoft Enterprise Promotions Management, to become liable for a promotional payment. In other words, you owe that amount to a customer for promotional activities. In PeopleSoft Enterprise Campus Solutions, the basis from which all advancement plans are executed. It is an organized effort targeting a specific constituency, and it can occur over a specified period of time with specific purposes and goals. An initiative can be a campaign, an event, an organized volunteer effort, a membership drive, or any other type of effort defined by the institution. Initiatives can be multipart, and they can be related to other initiatives. This enables you to track individual parts of an initiative, as well as entire initiatives. In PeopleSoft Enterprise Campus Solutions, a type of security access that permits the user only to view data. See also update access.
incur
initiative
inquiry access
institution
In PeopleSoft Enterprise Campus Solutions, an entity (such as a university or college) that is independent of other similar entities and that has its own set of rules and business processes. A relationship between two compatible integration points that enables communication to take place between systems. Integrations enable PeopleSoft Enterprise applications to work seamlessly with other PeopleSoft Enterprise applications or with third-party systems or software. An interface that a system uses to communicate with another PeopleSoft Enterprise application or an external application. A logical grouping of integrations that applications use for the same business purpose. For example, the integration set ADVANCED_SHIPPING_ORDER contains all of the integrations that notify a customer that an order has shipped. In PeopleSoft Enterprise Inventory, a tangible commodity that is stored in a business unit (shipped from a warehouse). In PeopleSoft Enterprise Demand Planning, Inventory Policy Planning, and Supply Planning, a noninventory item that is designated as being used for planning purposes only. It can represent a family or group of inventory items. It can have a planning bill of material (BOM) or planning routing, and it can exist as a component on a planning BOM. A planning item cannot be specified on a production or engineering BOM or routing, and it cannot be used as a component in a production. The quantity on hand will never be maintained. In PeopleSoft Enterprise Receivables, an individual receivable. An item can be an invoice, a credit memo, a debit memo, a write-off, or an adjustment.
integration
item
In PeopleSoft Enterprise Campus Solutions, a process that enables you to change a payment allocation without having to reverse the payment. In PeopleSoft Expenses, a collection of travel reservations. Itineraries can have reservations that are selected and reserved with the travel vendor. These itineraries are not yet paid for and can be referred to as pending reservations. Reservations that have been paid for are referred to as confirmed reservations. In PeopleSoft Enterprise Campus Solutions, one letter that is addressed jointly to two people. For example, a letter might be addressed to both Mr. Sudhir Awat and Ms. Samantha Mortelli. A relationship must be established between the two individuals in the database, and at least one of the individuals must have an ID in the database.
joint communication
441
Glossary
keyword
In PeopleSoft Enterprise Campus Solutions, a term that you link to particular elements within PeopleSoft Enterprise Student Financials, Financial Aid, and Contributor Relations. You can use keywords as search criteria that enable you to locate specific records in a search dialog box. An abbreviation for key performance indicator. A high-level measurement of how well an organization is doing in achieving critical success factors. This defines the data value or calculation upon which an assessment is determined. Abbreviation for Known Value Item. Term used for products or groups of products where the selling price cannot be reduced or increased. In PeopleSoft Real Estate Management, an entity that owns real estate and leases the real estate to tenants. Abbreviation for Lightweight Directory Access Protocol (LDAP) Data Interchange Format file. Contains discrepancies between PeopleSoft Enterprise data and directory data. In PeopleSoft Enterprise Learning Management, a group of learners who are linked to the same learning environment. Members of the learner group can share the same attributes, such as the same department or job code. Learner groups are used to control access to and enrollment in learning activities and programs. They are also used to perform group enrollments and mass enrollments in the back office. In PeopleSoft Enterprise Learning Management, the foundational building blocks of learning activities. PeopleSoft Enterprise Learning Management supports six basic types of learning components: web-based, session, webcast, test, survey, and assignment. One or more of these learning component types compose a single learning activity. In PeopleSoft Enterprise Learning Management, identifies a set of categories and catalog items that can be made available to learner groups. Also defines the default values that are assigned to the learning activities and programs that are created within a particular learning environment. Learning environments provide a way to partition the catalog so that learners see only those items that are relevant to them. In PeopleSoft Enterprise Learning Management, a self-service repository for all of a learners completed learning activities and programs. In PeopleSoft Real Estate Management, a legally binding agreement between a landlord and a tenant, where the tenant rents all or part of a physical property from the landlord. In PeopleSoft Real Estate Management, a summarized version of the complete lease contract with only the important terms. The lease abstract usually fits on one page and does not include legal terminology. You use ledger mapping to relate expense data from general ledger accounts to resource objects. Multiple ledger line items can be mapped to one or more resource IDs. You can also use ledger mapping to map dollar amounts (referred to as rates) to business units. You can map the amounts in two different ways: an actual amount that represents actual costs of the accounting period, or a budgeted amount that can be used to calculate the capacity rates as well as budgeted model results. In PeopleSoft Enterprise Warehouse, you can map general ledger accounts to the EW Ledger table. In PeopleSoft Enterprise Incentive Management, a section that is defined in a plan (or template) and that is available for other plans to share. Changes to a library section are reflected in all plans that use it. In PeopleSoft Strategic Sourcing, an individual item or service upon which there can be a bid.
KPI
learner group
learning components
learning environment
lease abstract
ledger mapping
library section
line
442
Glossary
linked section
In PeopleSoft Enterprise Incentive Management, a section that is defined in a plan template but appears in a plan. Changes to linked sections propagate to plans using that section. In PeopleSoft Enterprise Incentive Management, a variable that is defined and maintained in a plan template and that also appears in a plan. Changes to linked variables propagate to plans using that variable. Abbreviation for learning management system. In PeopleSoft Enterprise Campus Solutions, LMS is a PeopleSoft Enterprise Student Records feature that provides a common set of interoperability standards that enable the sharing of instructional content and data between learning and administrative environments. In PeopleSoft Enterprise Inventory, identifies a group of goods that are shipped together. Load management is a feature of PeopleSoft Enterprise Inventory that is used to track the weight, the volume, and the destination of a shipment. In PeopleSoft Enterprise HRMS, the set of information that is available for a specific country. You can access this information when you click the appropriate country flag in the global window, or when you access it by a local country menu. Locations enable you to indicate the different types of addressesfor a company, for example, one address to receive bills, another for shipping, a third for postal deliveries, and a separate street address. Each address has a different location number. The primary locationindicated by a 1is the address you use most often and may be different from the main address. In PeopleSoft Enterprise Services Procurement, an administrative task that is related to hiring a service provider. Logistical tasks are linked to the service type on the work order so that different types of services can have different logistical tasks. Logistical tasks include both preapproval tasks (such as assigning a new badge or ordering a new laptop) and postapproval tasks (such as scheduling orientation or setting up the service provider email). The logistical tasks can be mandatory or optional. Mandatory preapproval tasks must be completed before the work order is approved. Mandatory postapproval tasks, on the other hand, must be completed before a work order is released to a service provider. In PeopleSoft Enterprise Incentive Management, additional functionality that is specific to a given market or industry and is built on top of a product category. In PeopleSoft Enterprise Campus Solutions, mass change is a SQL generator that can be used to create specialized functionality. Using mass change, you can set up a series of Insert, Update, or Delete SQL statements to perform business functions that are specific to the institution. See also 3C engine.
linked variable
LMS
load
local functionality
location
logistical task
match group
In PeopleSoft Enterprise Receivables, a group of receivables items and matching offset items. The system creates match groups by using user-defined matching criteria for selected field values. Abbreviation for PeopleSoft MultiChannel Framework server. Comprises the universal queue server and the MCF log server. Both processes are started when MCF Servers is selected in an application server domain configuration. In PeopleSoft Enterprise Promotions Management, a specific discount type that is associated with a trade promotion (such as off-invoice, billback or rebate, or lump-sum payment) that defines the performance that is required to receive the discount. In the industry, you may know this as an offer, a discount, a merchandising event, an event, or a tactic.
MCF server
merchandising activity
443
Glossary
meta-SQL
Meta-SQL constructs expand into platform-specific SQL substrings. They are used in functions that pass SQL strings, such as in SQL objects, the SQLExec function, and PeopleSoft Application Engine programs. Metastrings are special expressions included in SQL string literals. The metastrings, prefixed with a percent (%) symbol, are included directly in the string literals. They expand at run time into an appropriate substring for the current database platform. In PeopleSoft Enterprise General Ledger, multiple ledgers having multiple-base currencies that are defined for a business unit, with the option to post a single transaction to all base currencies (all ledgers) or to only one of those base currencies (ledgers). The ability to process transactions in a currency other than the business units base currency. In PeopleSoft Enterprise Promotions Management, a promotion at the corporate level that is funded by nondiscretionary dollars. In the industry, you may know this as a national promotion, a corporate promotion, or a corporate discount. Abbreviation for Non-Discountable Products. Term used for products or groups of products where the selling price cannot be decreased. In PeopleSoft Enterprise Campus Solutions, the difference between the cost of attendance (COA) and the expected family contribution (EFC). It is the gap between the cost of attending the school and the students resources. The financial aid package is based on the amount of financial need. The process of determining a students need is called need analysis. A tree that is based on a detail structure, but the detail values are not used. A PeopleTools component that Strategic Sourcing leverages to evaluate bids and determine an ideal award allocation. The award recommendation is based on maximizing the value while adhering to purchasing and company objectives and constraints. Each block of content on the home page is called a pagelet. These pagelets display summary information within a small rectangular area on the page. The pagelet provide users with a snapshot of their most relevant PeopleSoft Enterprise and non-PeopleSoft Enterprise content. In PeopleSoft Enterprise Incentive Management, participants are recipients of the incentive compensation calculation process. Each participant object may be related to one or more compensation objects. See also compensation object.
metastring
multibook
NDP need
pagelet
A company that supplies products or services that are resold or purchased by the enterprise. In PeopleSoft Enterprise Payables, a set of rules that define the criteria by which it should select scheduled payments for payment creation. In PeopleSoft Enterprise Campus Solutions, a process allowing payments that have been previously posted to a students account to be automatically reapplied when a higher priority payment is posted or the payment allocation definition is changed. In PeopleSoft Enterprise Receivables, an individual receivable (such as an invoice, a credit memo, or a write-off) that has been entered in or created by the system, but hasnt been posted.
pending item
444
Glossary
PeopleCode
PeopleCode is a proprietary language, executed by the PeopleSoft Enterprise component processor. PeopleCode generates results based on existing data or user actions. By using various tools provided with PeopleTools, external services are available to all PeopleSoft Enterprise applications wherever PeopleCode can be executed. See event. The fundamental architecture on which PeopleSoft 8 applications are constructed, consisting of a relational database management system (RDBMS), an application server, a web server, and a browser. In PeopleSoft Enterprise Incentive Management, a variable used to store data (similar to an aggregator, but without a predefined formula) within the scope of an incentive plan. Performance measures are associated with a plan calendar, territory, and participant. Performance measurements are used for quota calculation and reporting. In PeopleSoft Enterprise Incentive Management, because a participant typically uses the same compensation plan for multiple periods, the period context associates a plan context with a specific calendar period and fiscal year. The period context references the associated plan context, thus forming a chain. Each plan context has a corresponding set of period contexts. A person about whom the organization maintains information but who is not part of the workforce. In PeopleSoft Enterprise Campus Solutions, the user-accessible menu item that contains an individuals name, address, telephone number, and other personal information. A level 1 task, meaning that if a task had subtasks, the level 1 task would be considered the phase. The product quantity that the customer is taking with them from the counter sales environment. In PeopleSoft Enterprise Sales Incentive Management, a collection of allocation rules, variables, steps, sections, and incentive rules that instruct the PeopleSoft Enterprise Incentive Management engine in how to process transactions. In PeopleSoft Enterprise Incentive Management, correlates a participant with the compensation plan and node to which the participant is assigned, enabling the PeopleSoft Enterprise Incentive Management system to find anything that is associated with the node and that is required to perform compensation processing. Each participant, node, and plan combination represents a unique plan contextif three participants are on a compensation structure, each has a different plan context. Configuration plans are identified by plan contexts and are associated with the participants that refer to them. In PeopleSoft Enterprise Incentive Management, the base from which a plan is created. A plan template contains common sections and variables that are inherited by all plans that are created from the template. A template may contain steps and sections that are not visible in the plan definition. In PeopleSoft Enterprise Learning Management, a self-service repository for all of a learners planned learning activities and programs. In PeopleSoft Enterprise Supply Planning, a set of data (business units, items, supplies, and demands) constituting the inputs and outputs of a supply plan. In PeopleSoft Enterprise Campus Solutions, the middle level of the three-level classification structure that you define in PeopleSoft Enterprise Recruiting and
period context
plan context
plan template
445
Glossary
Admissions for enrollment management. You can define a population level, link it to other levels, and set enrollment target numbers for it. See also division and cohort. portal registry In PeopleSoft Enterprise applications, the portal registry is a tree-like structure in which content references are organized, classified, and registered. It is a central repository that defines both the structure and content of a portal through a hierarchical, tree-like structure of folders useful for organizing and securing content references. A task that you must complete before you start another task. In PeopleSoft Strategic Sourcing, a price discount or surcharge that a bidder may apply based on the quantity awarded. In PeopleSoft Strategic Sourcing, the various components, such as material costs, labor costs, shipping costs, and so on that make up the overall bid price. Enables you to select products and conditions for which the price list applies to a transaction. During a transaction, the system either determines the product price based on the predefined search hierarchy for the transaction or uses the products lowest price on any associated, active price lists. This price is used as the basis for any further discounts and surcharges. The conditions that must be met for adjustments to be applied to the base price. Multiple rules can apply when conditions of each rule are met. Conditions that select the price-by fields, the values for the price-by fields, and the operator that determines how the price-by fields relate to the transaction. The fields that are available to define price rule conditions (which are used to match a transaction) on the price rule. In PeopleSoft Enterprise Campus Solutions, a number that the system uses to prioritize financial aid applications when students are enrolled in multiple academic careers and academic programs at the same time. The Consolidate Academic Statistics process uses the primacy number indicated for both the career and program at the institutional level to determine a students primary career and program. The system also uses the number to determine the primary student attribute value that is used when you extract data to report on cohorts. The lowest number takes precedence. In PeopleSoft Enterprise Campus Solutions, the name type that is used to link the name stored at the highest level within the system to the lower-level set of names that an individual provides. In PeopleSoft Process Scheduler, processes that are grouped for server load balancing and prioritization. In PeopleSoft Enterprise Financials, a group of application processes (performed in a defined order) that users can initiate in real time, directly from a transaction entry page. Process definitions define each run request. A unique number that identifies each process request. This value is automatically incremented and assigned to each requested process when the process is submitted to run. You can link process definitions into a job request and process each request serially or in parallel. You can also initiate subsequent processes based on the return code from each prior request.
price rule price rule conditions price rule key primacy number
process job
446
Glossary
process request
A single run request, such as a Structured Query Report (SQR), a COBOL or Application Engine program, or a Crystal report that you run through PeopleSoft Process Scheduler. A PeopleTools variable used to retain PeopleSoft Process Scheduler values needed at runtime for all requests that reference a run control ID. Do not confuse these with application run controls, which may be defined with the same run control ID, but only contain information specific to a given application process request. A PeopleSoft Enterprise or third-party product. PeopleSoft organizes its software products into product families and product lines. Interactive Services Repository contains information about every release of every product that PeopleSoft sells, as well as products from certified third-party companies. These products appear with the product name and release number. The pricing functionality where buying product A gets product B for free or at a price (formerly referred to as giveaways). In PeopleSoft Strategic Sourcing, the placing of a bid on behalf of the bidder, up or down to the bidders specified amount, so that the bidder can be the leading bidder. In PeopleSoft Enterprise Incentive Management, indicates an application in the PeopleSoft Enterprise Incentive Management suite of products. Each transaction in the PeopleSoft Enterprise Incentive Management system is associated with a product category. A group of products that are related by common functionality. The family names that can be searched using Interactive Service Repository are Oracles PeopleSoft Enterprise, PeopleSoft EnterpriseOne, PeopleSoft World, and third-party, certified partners. The name of a PeopleSoft Enterprise product line or the company name of a third-party certified partner. Integration Services Repository enables you to search for integration points by product line. In PeopleSoft Enterprise Learning Management, a high-level grouping that guides the learner along a specific learning path through sections of catalog items. PeopleSoft Enterprise Learning Systems provides two types of programscurricula and certifications. In PeopleSoft Enterprise Services Procurement, tracks deliverable-based projects. This is similar to the time sheet in function and process. The service provider contact uses the progress log to record and submit progress on deliverables. The progress can be logged by the activity that is performed, by the percentage of work that is completed, or by the completion of milestone activities that are defined for the project. In PeopleSoft Enterprise Project Costing, an individual transaction line that represents a cost, time, budget, or other transaction row. In PeopleSoft Enterprise Promotions Management, a trade promotion, which is typically funded from trade dollars and used by consumer products manufacturers to increase sales volume. In PeopleSoft Enterprise Campus Solutions, students who are interested in applying to the institution. In PeopleSoft Enterprise Contributor Relations, individuals and organizations that are most likely to make substantial financial commitments or other types of commitments to the institution.
product
product family
product line
programs
progress log
prospects
proxy bidding
In PeopleSoft Strategic Sourcing, the placing of a bid on behalf of the bidder, up or down to the bidders specified amount, so that the bidder can be the leading bidder.
447
Glossary
In PeopleSoft Enterprise Incentive Management, a stage in processing that makes incentive-related results available to participants. In PeopleSoft Enterprise Campus Solutions, variables used with the Equation Editor to retrieve specified populations. A set of logically and functionally related control tables and views. Record groups help enable TableSet sharing, which eliminates redundant data entry. Record groups ensure that TableSet sharing is applied consistently across all related tables and views. Abbreviation for record input value-added tax flag. Within PeopleSoft Enterprise Purchasing, Payables, and General Ledger, this flag indicates that you are recording input VAT on the transaction. This flag, in conjunction with the record output VAT flag, is used to determine the accounting entries created for a transaction and to determine how a transaction is reported on the VAT return. For all cases within Purchasing and Payables where VAT information is tracked on a transaction, this flag is set to Yes. This flag is not used in PeopleSoft Enterprise Order Management, Billing, or Receivables, where it is assumed that you are always recording only output VAT, or in PeopleSoft Enterprise Expenses, where it is assumed that you are always recording only input VAT. Abbreviation for record output value-added tax flag. See record input VAT flag.
recname recognition
The name of a record that is used to determine the associated field to match a value or set of values. In PeopleSoft Enterprise Campus Solutions, the recognition type indicates whether the PeopleSoft Enterprise Contributor Relations donor is the primary donor of a commitment or shares the credit for a donation. Primary donors receive hard credit that must total 100 percent. Donors that share the credit are given soft credit. Institutions can also define other share recognition-type values such as memo credit or vehicle credit. In PeopleSoft Enterprise Sales Incentive Management, system objects that represent the sales organization, such as territories, participants, products, customers, and channels. In PeopleSoft Enterprise Incentive Management, this dimension-type object further defines the business. Reference objects can have their own hierarchy (for example, product tree, customer tree, industry tree, and geography tree). In commitment control, a reference transaction is a source transaction that is referenced by a higher-level (and usually later) source transaction, in order to automatically reverse all or part of the referenced transactions budget-checked amount. This avoids duplicate postings during the sequential entry of the transaction at different commitment levels. For example, the amount of an encumbrance transaction (such as a purchase order) will, when checked and recorded against a budget, cause the system to concurrently reference and relieve all or part of the amount of a corresponding pre-encumbrance transaction, such as a purchase requisition. In PeopleSoft Enterprise Purchasing, provides the infrastructure to maintain, display, and select an appropriate vendor and vendor pricing structure that is based on a regional sourcing model where the multiple ship to locations are grouped. Sourcing may occur at a level higher than the ship to location. In PeopleSoft Enterprise Incentive Management, these objects further define a compensation structure to resolve transactions by establishing associations between compensation objects and business objects. Data that is extracted from a separate database and migrated into the local database.
reference data
reference object
reference transaction
regional sourcing
relationship object
448
Glossary
Abbreviation for real-time event notification server in PeopleSoft MultiChannel Framework. In PeopleSoft Enterprise eSettlements, an individual who requests goods or services and whose ID appears on the various procurement pages that reference purchase orders. In PeopleSoft Expenses, travel reservations that have been placed with the travel vendor. In PeopleSoft Enterprise Campus Solutions, an indicator that denotes when a particular payment has been reversed, usually because of insufficient funds. In PeopleSoft Strategic Sourcing, a request for information. In PeopleSoft Strategic Sourcing, a request for proposal or request for a quote event when bidders submit their overall best bids and during which bidders do not actively compete against one another. Describes how people fit into PeopleSoft Workflow. A role is a class of users who perform the same type of work, such as clerks or managers. Your business rules typically specify what user role needs to do an activity. A PeopleSoft Workflow user. A persons role user ID serves much the same purpose as a user ID does in other parts of the system. PeopleSoft Workflow uses role user IDs to determine how to route worklist items to users (through an email address, for example) and to track the roles that users play in the workflow. Role users do not need PeopleSoft user IDs. In a tree, to roll up is to total sums based on the information hierarchy. A run control is a type of online page that is used to begin a process, such as the batch processing of a payroll run. Run control pages generally start a program that manipulates data. A unique ID to associate each user with his or her own run control table entries. In PeopleSoft Enterprise Incentive Management, associates a particular run (and batch ID) with a period context and plan context. Every plan context that participates in a run has a separate run-level context. Because a run cannot span periods, only one run-level context is associated with each plan context. In PeopleSoft Strategic Sourcing, a bid that has been created but not submitted. Only submitted bids are eligible for award. In PeopleSoft Strategic Sourcing, the numerical sum of answers (percentages) to bid factors on an event. Scores appear only to bidders on auction events. Abbreviation for Supply Chain Planning Supply Chain Business Modeler Extensible Markup Language message. Supply Chain Business Modeler uses XML as the format for all data that it imports and exports. You use this set of objects to pass a query string and operators to the search engine. The search index returns a set of matching results with keys to the source documents. In PeopleSoft Enterprise Campus Solutions and PeopleSoft Enterprise Human Resources Management Solutions, a feature that enables you to search for and identify duplicate records in the database. In PeopleSoft Enterprise Campus Solutions, an address that recurs for the same length of time at the same time of year each year until adjusted or deleted.
role
role user
seasonal address
449
Glossary
section
In PeopleSoft Enterprise Incentive Management, a collection of incentive rules that operate on transactions of a specific type. Sections enable plans to be segmented to process logical events in different sections. In commitment control, security events trigger security authorization checking, such as budget entries, transfers, and adjustments; exception overrides and notifications; and inquiries. In PeopleSoft Strategic Sourcing, for event creators, the sale of goods or services most typically associated with forward auctions. For bidders, the purchase of goods or services. In PeopleSoft Enterprise Manufacturing, the ability to track the composition of a specific, serial-controlled item. In PeopleSoft Enterprise Manufacturing, enables the tracing of serial information for manufactured items. This is maintained in the Item Master record. In PeopleSoft Enterprise Campus Solutions, the resulting action triggered by a service indicator. For example, a service indicator that reflects nonpayment of account balances by a student might result in a service impact that prohibits registration for classes. In PeopleSoft Enterprise Campus Solutions, indicates services that may be either withheld or provided to an individual. Negative service indicators indicate holds that prevent the individual from receiving specified services, such as check-cashing privileges or registration for classes. Positive service indicators designate special services that are provided to the individual, such as front-of-line service or special services for disabled students. In PeopleSoft Enterprise Campus Solutions, time elements that subdivide a term into multiple time periods during which classes are offered. In PeopleSoft Enterprise Contributor Relations, a session is the means of validating gift, pledge, membership, or adjustment data entry . It controls access to the data entered by a specific user ID. Sessions are balanced, queued, and then posted to the institutions financial system. Sessions must be posted to enter a matching gift or pledge payment, to make an adjustment, or to process giving clubs or acknowledgements. In PeopleSoft Enterprise Learning Management, a single meeting day of an activity (that is, the period of time between start and finish times within a day). The session stores the specific date, location, meeting time, and instructor. Sessions are used for scheduled training.
security event
sell event
service indicator
session
session template
In PeopleSoft Enterprise Learning Management, enables you to set up common activity characteristics that may be reused while scheduling a PeopleSoft Enterprise Learning Management activitycharacteristics such as days of the week, start and end times, facility and room assignments, instructors, and equipment. A session pattern template can be attached to an activity that is being scheduled. Attaching a template to an activity causes all of the default template information to populate the activity session pattern. In PeopleSoft Enterprise Incentive Management, a relationship object type that associates a configuration plan with any structure node. In PeopleSoft Enterprise Business Planning, a named planning method similar to a driver expression, but which you can set up globally for shared use within a single planning application or to be shared between multiple planning applications through PeopleSoft Enterprise Warehouse. A customer not in the system who is entered during sales order entry using a template.
short-term customer
450
Glossary
single signon
With single signon, users can, after being authenticated by a PeopleSoft Enterprise application server, access a second PeopleSoft Enterprise application server without entering a user ID or password. In PeopleSoft Enterprise Campus Solutions, a process that relates a particular transaction to the source of the charge or financial aid. On selected pages, you can drill down into particular charges. In commitment control, any transaction generated in a PeopleSoft Enterprise or third-party application that is integrated with commitment control and which can be checked against commitment control budgets. For example, a pre-encumbrance, encumbrance, expenditure, recognized revenue, or collected revenue transaction. For constraints, the option to designate whether a business rule is required (mandatory) or is only recommended (target). See communication key. A user-defined shorthand key that designates several ChartKeys to be used for voucher entry. Percentages can optionally be related to each ChartKey in a SpeedChart definition. A code representing a combination of ChartField values. SpeedTypes simplify the entry of ChartFields commonly used together. A method of consolidating selected partner offerings with the offerings from the enterprises other partners. In PeopleSoft Enterprise Campus Solutions, a standard letter code used to identify each letter template available for use in mail merge functions. Every letter generated in the system must have a standard letter code identification. Account required by a regulatory authority for recording and reporting financial results. In PeopleSoft Enterprise, this is equivalent to the Alternate Account (ALTACCT) ChartField. In PeopleSoft Enterprise Sales Incentive Management, a collection of sections in a plan. Each step corresponds to a step in the job run. In PeopleSoft Enterprise Inventory, identifies the level of a material storage location. Material storage locations are made up of a business unit, a storage area, and a storage level. You can set up to four storage levels. A value that groups customers into a division for which you can generate detailed history, aging, events, and profiles. You use summary ChartFields to create summary ledgers that roll up detail amounts based on specific detail values or on selected tree nodes. When detail values are summarized using tree nodes, summary ChartFields must be used in the summary ledger data record to accommodate the maximum length of a node name (20 characters). An accounting feature used primarily in allocations, inquiries, and PS/nVision reporting to store combined account balances from detail ledgers. Summary ledgers increase speed and efficiency of reporting by eliminating the need to summarize detail ledger balances each time a report is requested. Instead, detail balances are summarized in a background process according to user-specified criteria and stored on summary ledgers. The summary ledgers are then accessed directly for reporting. In PeopleSoft Enterprise Business Planning, any time period (other than a base time period) that is an aggregate of other time periods, including other summary time periods and base time periods, such as quarter and year total.
source transaction
statutory account
summary ledger
451
Glossary
summary tree
A tree used to roll up accounts for each type of report in summary ledgers. Summary trees enable you to define trees on trees. In a summary tree, the detail values are really nodes on a detail tree or another summary tree (known as the basis tree). A summary tree structure specifies the details on which the summary trees are to be built. To distribute a production version of the enterprise catalog to partners. In PeopleSoft Enterprise Receivables, an activity that defines how the system generates accounting entries for the general ledger. The system source identifies the source of a transaction row in the database. For example, a transaction that originates in PeopleSoft Enterprise Expenses contains a system source code of BEX (Expenses Batch). When PeopleSoft Enterprise Project Costing prices the source transaction row for billing, the system creates a new row with a system source code of PRP (Project Costing pricing), which represents the system source of the new row. System source codes can identify sources that are internal or external to the PeopleSoft Enterprise system. For example, processes that import data from Microsoft Project into PeopleSoft Enterprise applications create transaction rows with a source code of MSP (Microsoft Project).
A means of sharing similar sets of values in control tables, where the actual data values are different but the structure of the tables is the same. Shared data that is stored in many tables that are based on the same TableSets. Tables that use TableSet sharing contain the SETID field as an additional key or unique identifier. The value of the entry currency or currencies converted to a single currency for budget viewing and inquiry purposes. A deliverable item on the detailed sourcing plan. In PeopleSoft Enterprise Campus Solutions, a user-defined element that combines a description and percentage of a tax with an account type, an item type, and a service impact. A template is HTML code associated with a web page. It defines the layout of the page and also where to get HTML for each part of the page. In PeopleSoft Enterprise, you use templates to build a page by combining HTML from a number of sources. For a PeopleSoft Enterprise portal, all templates must be registered in the portal registry, and each content reference must be assigned a template. In PeopleSoft Real Estate Management, an entity that leases real estate from a landlord. In PeopleSoft Enterprise Sales Incentive Management, hierarchical relationships of business objects, including regions, products, customers, industries, and participants. A company or vendor that has extensive PeopleSoft Enterprise product knowledge and whose products and integrations have been certified and are compatible with PeopleSoft Enterprise applications. Enables different portions of a schedule to be priced differently from one another. A relative period, such as year-to-date or current period, that various PeopleSoft General Ledger functions and reports can use when a rolling time frame, rather than a specific date, is required. In PeopleSoft Strategic Sourcing, the estimated dollar cost (sum of real price dollars and potential soft or non-price dollars) of a particular award approach.
template
total cost
452
Glossary
travel group
In PeopleSoft Expenses, the organizations travel rules and polices that are associated with specific business units, departments, or employees. You must define at least one travel group when setting up the PeopleSoft Expenses travel feature. You must define and associate at least one travel group with a travel vendor. In PeopleSoft Expenses, the travel vendor with which the organization has a contractual relationship. Abbreviation for Communications, Checklists, and Comments engine. In PeopleSoft Enterprise Campus Solutions, the 3C engine enables you to automate business processes that involve additions, deletions, and updates to communications, checklists, and comments. You define events and triggers to engage the engine, which runs the mass change and processes the 3C records (for individuals or organizations) immediately and automatically from within business processes. Abbreviation for Communications, Checklists, and Comments group. In PeopleSoft Enterprise Campus Solutions, a method of assigning or restricting access privileges. A 3C group enables you to group specific communication categories, checklist codes, and comment categories. You can then assign the group inquiry-only access or update access, as appropriate. In PeopleSoft Enterprise Manufacturing, enables the control of which components will be traced during the manufacturing process. Serial- and lot-controlled components can be traced. This is maintained in the Item Master record. In PeopleSoft Enterprise Incentive Management, the process of identifying the owner of a transaction. When a raw transaction from a batch is allocated to a plan context, the transaction is duplicated in the PeopleSoft Enterprise Incentive Management transaction tables. In PeopleSoft Enterprise Incentive Management, a value assigned by an incentive rule to a transaction. Transaction states enable sections to process only transactions that are at a specific stage in system processing. After being successfully processed, transactions may be promoted to the next transaction state and picked up by a different section for further processing. A system edit table that stores codes and translate values for the miscellaneous fields in the database that do not warrant individual edit tables of their own. The graphical hierarchy in PeopleSoft Enterprise systems that displays the relationship between all accounting units (for example, corporate divisions, projects, reporting groups, account numbers) and determines roll-up hierarchies. In PeopleSoft Enterprise Campus Solutions, a feature in the Tuition Calculation process that enables you to specify a point in a term after which students are charged a minimum (or locked) fee amount. Students are charged the locked fee amount even if they later drop classes and take less than the normal load level for that tuition charge. In PeopleSoft Enterprise Incentive Management, a transaction that is not claimed by a node or participant after the allocation process has completed, usually due to missing or incomplete data. Unclaimed transactions may be manually assigned to the appropriate node or participant by a compensation administrator. Every PeopleSoft Enterprise portal includes the universal navigation header, intended to appear at the top of every page as long as the user is signed on to the portal. In addition to providing access to the standard navigation buttons (like Home, Favorites, and signoff) the universal navigation header can also display a welcome message for each user. In PeopleSoft Enterprise Campus Solutions, a type of security access that permits the user to edit and update data.
3C group
trace usage
transaction allocation
transaction state
tuition lock
unclaimed transaction
update access
453
Glossary
See also inquiry access. user interaction object In PeopleSoft Enterprise Sales Incentive Management, used to define the reporting components and reports that a participant can access in his or her context. All PeopleSoft Enterprise Sales Incentive Management user interface objects and reports are registered as user interaction objects. User interaction objects can be linked to a compensation structure node through a compensation relationship object (individually or as groups). In PeopleSoft Enterprise Sales Incentive Management, the intermediate results of calculations. Variables hold the calculation results and are then inputs to other calculations. Variables can be plan variables that persist beyond the run of an engine or local variables that exist only during the processing of a section. Abbreviation for value-added tax exception. A temporary or permanent exemption from paying VAT that is granted to an organization. This terms refers to both VAT exoneration and VAT suspension. Abbreviation for value-added tax exempt. Describes goods and services that are not subject to VAT. Organizations that supply exempt goods or services are unable to recover the related input VAT. This is also referred to as exempt without recovery. Abbreviation for value-added tax exoneration. An organization that has been granted a permanent exemption from paying VAT due to the nature of that organization. Abbreviation for value-added tax suspension. An organization that has been granted a temporary exemption from paying VAT. A PeopleSoft Enterprise data warehouse that consists of predefined ETL maps, data warehouse tools, and DataMart definitions. In PeopleSoft Strategic Sourcing, how important the line or question is to the overall event. Weighting is used to score and analyze bids. For RFx and RFI events, weightings may or may not appear to bidders. In PeopleSoft Enterprise Services Procurement, enables an enterprise to create resource-based and deliverable-based transactions that specify the basic terms and conditions for hiring a specific service provider. When a service provider is hired, the service provider logs time or progress against the work order. A person who is part of the workforce; an employee or a contingent worker. A group of people and organizations that are linked together as a set. You can use worksets to simultaneously retrieve the data for a group of people and organizations and work with the information on a single page. A way of presenting data through a PeopleSoft Enterprise Business Analysis Modeler interface that enables users to do in-depth analysis using pivoting tables, charts, notes, and history information. The automated to-do list that PeopleSoft Workflow creates. From the worklist, you can directly access the pages you need to perform the next action, and then return to the worklist for another item. The XML Linking language enables you to insert elements into XML documents to create a links between resources. An XML definition that standardizes the representation of application messages, component interfaces, or business interlinks. Abbreviation for eXtended Process Integrator. PeopleSoft XPI is the integration infrastructure that enables both real-time and batch communication with JD Edwards EnterpriseOne applications.
variable
VAT exception
VAT exempt
work order
worker workset
worksheet
worklist
454
Glossary
In PeopleSoft Enterprise Manufacturing, the ability to plan the loss of a manufactured item on an operation-by-operation basis. Abbreviation for zero-rated value-added tax. A VAT transaction with a VAT code that has a tax percent of zero. Used to track taxable VAT activity where no actual VAT amount is charged. Organizations that supply zero-rated goods and services can still recover the related input VAT. This is also referred to as exempt with recovery.
455
Glossary
456
Index
Numerics/Symbols
# character 16 $ character 16 % character 16 & character 15 @ character 16 character, in text literals 20 : character, in variable names 16 _ character, in variable names 16 3D-EFFECTS argument, DECLARECHART command 69 ALTER-LOCALE command 25, 269, 278, 280, 296 example 28 ALTER-PRINTER command 32, 85, 93, 269, 279 example 33 ALTER-REPORT command 33 example 34 any_col abbreviation 21 any_lit abbreviation 21 any_var abbreviation 21 -AP command-line parameter 306 APPEND argument, SECURITY command 214 applets, HTML 7 application fundamentals xi arccosine (acos) function 135 arcsine (asin) function 135 arctangent (atan) function 136 args... command-line argument 5 arguments separating from commands 4 using with procedures 107 array field operands 133 array function 145 ARRAY-ADD command 34 example 35, 36 ARRAY-DIVIDE command 34 example 36 ARRAY-MULTIPLY command 34 example 35 ARRAY-SUBTRACT command 34 example 35 arrays arithmetic 35 ARRAY-ADD command 34 ARRAY-DIVIDE command 34 ARRAY-MULTIPLY command 34 ARRAY-SUBTRACT command 34 CLEAR-ARRAY command 57 CREATE-ARRAY command 62 elements 63 maximums 62 moving data into 209 resetting fields 58
A
-A flag 6, 255, 264 absolute value (abs) function 135 acos function 135 ADD command 22 example 23 additional documentation xii -AF command-line parameter 306 AFTER argument, BEGIN-EXECUTE command 39 AFTER-BOLD argument DECLARE PRINTER command 277 DECLARE-PRINTER command 90 PRINT command 184 AFTER-PAGE argument DECLARE PROCEDURE command 278 DECLARE-PROCEDURE command 95 DECLARE-TOC command 98 USE-PROCEDURE command 229 AFTER-REPORT argument DECLARE PROCEDURE command 278 DECLARE-PROCEDURE command 95 USE-PROCEDURE command 229 AFTER-TOC argument, DECLARE-TOC command 98 aggregate functions 15 ALTER-COLOR-MAP command 23 example 24
457
Index
retrieving data from 118 searching 167 ascii function 145 asciic function 146 asin function 135 ASK command 5, 49, 101, 127, 128 example 37 preventing user input 14 understanding 36 AT-END argument, NEXT-COLUMN command 175 atan function 136
B
bar codes printing 200 types 200 UPC-A 201 BATCH-MODE argument, INPUT command 130, 131 BEEP argument, SHOW command 219 BEFORE argument, BEGIN-EXECUTE command 39 BEFORE-BOLD argument DECLARE PRINTER command 277 DECLARE-PRINTER command 90 PRINT command 184 BEFORE-PAGE argument DECLARE PROCEDURE command 278 DECLARE-PROCEDURE command 95 DECLARE-TOC command 98 USE-PROCEDURE command 229 BEFORE-REPORT argument DECLARE PROCEDURE command 278 DECLARE-PROCEDURE command 95 USE-PROCEDURE command 229 BEFORE-TOC argument, DECLARE-TOC command 98 BEGIN TRANSACTION command, Sybase and Microsoft SQL Server 212 BEGIN-DOCUMENT command 37, 109 example 38 BEGIN-DOCUMENT paragraph marker locations 16 BEGIN-EXECUTE command 38 example 40
BEGIN-FOOTING command 41, 109 example 42, 109 BEGIN-HEADING command 42, 109 example 43 BEGIN-PROCEDURE command 43, 111 example 45 BEGIN-PROGRAM command 46, 111, 269, 270 example 46 BEGIN-REPORT command 269, 270 BEGIN-SELECT command 39, 46, 111 example 48 BEGIN-SETUP command 2, 49, 111 example 50 BEGIN-SQL command 49, 50, 111 example 52 bind variables 48 blanks, trailing 11, 13, 15 BLINK argument, SHOW command 219 -Bnn argument, BEGIN-SELECT command 48 -Bnn flag 6 BOLD argument PRINT command 184 SHOW command 219 BORDER argument, DECLARE-CHART command 69 BOTTOM-MARGIN argument, DECLARE-LAYOUT command 81 BOX argument GRAPHIC command 123 PRINT command 184 boxes, drawing 122 braces, use of in syntax 3 branching, EVALUATE command 111 BREAK argument, EVALUATE command 112 BREAK command 53 browser, determining 8 buffer 6 -BURST:{xx} flag 6, 256, 264 buttons, HTML 299
C
-C flag 6, 255 C, writing functions in 161 -CA command-line parameter 305 CALL command 53 example 55 CALL SYSTEM command 53
458
Index
Cancel dialog box 6 -CAP command-line parameter 305 CAPTION argument, PRINT-BAR-CODE command 201 case/switch 111 -CB flag 6, 256 -CD command-line parameter 305 ceil function 136 CENTER argument, PRINT command 184 CHAR, TEXT data type 129 CHAR-SIZE argument, DECLARE PRINTER command 274 CHAR-WIDTH argument DECLARE-LAYOUT command 78, 82 character columns 15 character sequences, finding 117 character sets, specifying in Windows 299 characters control 10, 283, 284 converting single-byte to multibyte 213 display 108 multibyte 213 nondisplay 108, 283, 284 printer control 11 single-byte 213 CHARS-INCH argument, DECLARE PRINTER command 274 CHART.FILL option 67 CHART-SIZE argument, DECLARECHART command 68 ChartAreaBackground 68 ChartAreaForeground 68 ChartBackground 68 ChartForeground 68 charts 202 business 68 colors 68 defining attributes 67 printing 203 types 204 CHECKSUM argument, PRINT-BARCODE command 201 chr function 146 CLEAR-ARRAY command 57, 63 example 58 CLEAR-LINE argument, SHOW command 219
CLEAR-SCREEN argument, SHOW command 219 CLOSE command 58, 177 example 58 -Cnn argument BEGIN-SELECT command 48 BEGIN-SQL command 52 -CO command-line parameter 305 CODE-PRINTER argument, PRINT command 184 COLOR argument, DECLARE-PRINTER command 87 color palettes 67 COLOR_1 argument, CREATE-COLORPALETTE command 64 COLOR_2 argument, CREATE-COLORPALETTE command 64 COLOR_n argument, CREATE-COLORPALETTE command 64 COLOR-PALETTE argument, DECLARE-CHART command 69 colors altering defined 23 aqua 24 black 24 blue 24 defaults 24, 75, 120, 215 defining in SQR reports 75 defining new 23 fuchsia 24 gray 24 green 24 lime 24 maroon 24 naming 23, 120 navy 24 olive 24 palettes 64, 67 purple 24 red 24 references 64 retrieving 119 RGB values 23 silver 24 teal 24 white 24 yellow 24 Colors section, pssqr.ini 304 columns 15 character 15
459
Index
date 15 determining value 111 displaying 103 dynamic 15 global 16 local 16 not supported in DECLARE-CHART or PRINT-CHART command 67 number 15 reserved variable for current 16 reserved variable for maximum 18 setting current 227 COLUMNS argument, POSITION command 179 COLUMNS command 59, 174, 227 COMMAND argument, BEGINEXECUTE command 39 command line, SQR 4 command-line arguments 4 args... 5 connectivity 5 @file... 5 flags 5 program 4 command-line flags 5 SQR Print 264 commands abbreviations in 21 avoiding older 269 breaking 4 case insensitivity 4 hyphens in 4 length of 16 listed alphabetically 21 overview 21 rules for entering 4 separating from arguments 4 comments 4 comments, submitting xvi COMMIT command example 60 suppressing 14 understanding 59 COMMIT TRANSACTION command 60 common elements xvi comparison operators 125, 132 compiler directives 108, 110, 127, 128 nesting 124 table of 124
CONCAT command edit masks 192 example 61 understanding 60 concatenation, with STRING command 222 cond function 146 conditional processing 111, 126, 230 Configuration Manager 305 CONNECT command 59, 61 example 62 CONNECTION argument, BEGIN-EXECUTE command 39 connection_name argument 75 connectivity command-line argument 5 constants specifying 101 understanding 20 contact information xvi control characters 10, 283, 284 copyright banner 10 cos function 136 cosh function 137 cosine (cos) function 136 -COWN command-line parameter 305 CREATE-ARRAY command 35, 49, 62, 209 example 63 CREATE-COLOR-PALETTE command 64 example 64 cross-references xv -CS command-line parameter 305 -CT command-line parameter 305 currency symbols redefining 280 specifying 27, 278 #current-column reserved variable 16 $current-date reserved variable 16 #current-line reserved variable 17, 173 cursors controlling 217 database 61 displaying 13 Customer Connection website xii
D
data elements 15 input 129
460
Index
retrieving from array 118 types supported by INPUT command 129 data elements columns 15 defining 15 literals 20 variables 16 DATA-ARRAY argument, PRINT-CHART command 202, 206 DATA-ARRAY-COLUMN-COUNT argument, PRINT-CHART command 202, 206 DATA-ARRAY-COLUMN-LABELS argument, PRINT-CHART command 202, 206 DATA-ARRAY-ROW-COUNT argument, PRINT-CHART command 202, 206 DATA-LABELS argument, DECLARE-CHART command 69 database commit 59 cursors 61 joins 165 preventing signin 14 suppressing commit 14 types 18 username 19 using designated 226 database functions 15 datasource, logon parameters 76 date columns 15 default formats 27, 193 displaying 103 edit format characters 189 edit masks 27 reserved variable for current 16 variables 16 DATE argument DECLARE-VARIABLE command 100 DISPLAY command 104 MOVE command 169 PRINT command 185 SHOW command 219 DATE column type 185 DATE data type 129 date functions dateadd 147
datediff 147 datenow 147 datetostr 148 strtodate 156 date_col abbreviation 21 DATE-EDIT-MASK keyword, ALTER-LOCALE command 26, 27 DATE-SEPARATOR keyword, ALTER-LOCALE command 26, 28 DATE-TIME command 269, 270 date_var abbreviation 21 dateadd function 147 datediff function 147 datenow function 147, 269, 270 DATETIME column type 185 datetostr function 148 DAY-OF-WEEK-CASE keyword, ALTER-LOCALE command 26, 28 DAY-OF-WEEK-FULL keyword, ALTER-LOCALE command 27, 28 DAY-OF-WEEK-SHORT keyword, ALTER-LOCALE command 27, 28 DB2 212 COMMIT command 59 ROLLBACK command 212 -DBconnectionstring argument, BEGIN-SELECT command 48, 52 -DBdatabase flag 7, 256 #DEBUG command 65 example 65 -DEBUG flag 7, 65, 124, 127, 128 -DEBUGLP ON command-line parameter 307 DECIMAL argument, DECLAREVARIABLE command 100 decimal variables 16, 22 DECIMAL-SEPARATOR keyword, ALTER-LOCALE command 26, 28 DECLARE LAYOUT command 272 DECLARE PRINTER command 269, 272 DECLARE PROCEDURE command 269, 277 DECLARE-CHART command 49, 66, 109, 202 example 73 DECLARE-COLOR-MAP command 74
461
Index
example 75 DECLARE-CONNECTION command 75 example 76 DECLARE-IMAGE command 49, 77, 109 example 77 DECLARE-LAYOUT command 49, 78, 109, 173, 269 arguments of 80 example 82 FORMFEED argument 281 MAX-COLUMNS argument 282 MAX-LINES argument 282 PAPER-SIZE argument 282 DECLARE-PRINTER command 49, 85, 109, 184, 269, 270, 272, 279 example 94 FILL specification 67 INIT-STRING argument 284 RESET-STRING argument 283 DECLARE-PROCEDURE command 50, 94, 109, 207, 228, 269, 277 example 95 DECLARE-REPORT command 50, 78, 96, 109 example 96 DECLARE-TOC command 50, 97 example 98 DECLARE-VARIABLE command 50, 99, 109 example 100 default colors 215 DEFAULT layout 78 default settings section pssqr.ini 286 DEFAULT value 27 DEFAULT-NUMERIC argument, DECLARE-VARIABLE command 100 #DEFINE command 101, 127, 128 example 102 deg function 137 degrees 137 delete function 144 destination field 168 dimension hierarchy extending 216 specifying 216 display characters 108 DISPLAY command
edit masks 192 example 104 understanding 103 DISTINCT argument, BEGIN-SELECT command 48 DIVIDE command 106 example 106 -DL command-line parameter 306 -Dnn flag 7, 256, 264 -DNT flag 7, 99 DO argument, EXECUTE command 114 DO command 45, 46, 107 example 107 document marker 38, 179 document paragraphs 4, 37, 179, 428 documentation printed xii related xii updates xii DOLLAR-SYMBOL command 269, 278, 280 DOT-LEADER argument, DECLARE-TOC command 98 double precision floating point numbers 22 double-byte character strings 18 double-byte strings 168 dst_any_var argument, MOVE command 169 dynamic columns 15 dynamic query variables 48
E
-E[file] flag 7, 256, 264 e10 function 137 EDIT argument PRINT command 185 SHOW command 219 edit function 148 edit masks 61 case sensitivity 191 changing dynamically 192 currency symbols 27, 278 date 27 date samples 191 numeric 27 numeric samples 187 uses 189 edit types 185
462
Index
EDIT-OPTION-AD keyword, ALTER-LOCALE command 26, 28 EDIT-OPTION-AM keyword, ALTER-LOCALE command 26, 28 EDIT-OPTION-BC keyword, ALTER-LOCALE command 26, 28 EDIT-OPTION-NA keyword, ALTER-LOCALE command 26, 28 EDIT-OPTION-PM keyword, ALTER-LOCALE command 26, 28 -EH_APPLETS:dir flag 7, 256, 265 -EH_BQD flag 7, 257, 265 -EH_BQD:file flag 7, 257, 265 -EH_BROWSER:xx flag 8, 257, 265 -EH_CSV flag 8, 257, 265 -EH_CSV:file flag 8, 257, 265 -EH_CSVONLY flag 8, 257, 265 -EH_FULLHTML:xx flag 8, 257, 265 -EH_Icons:dir flag 8, 257, 265 -EH_IMAGES:dir flag 8 -EH_KEEP flag 9 -EH_LANGUAGE:xx flag 9, 257 -EH_PDF flag 9, 257, 265 -EH_Scale:{nn} flag 9, 257, 266 -EH_XML:file flag 9 -EH_ZIP[:file] flag 9 ellipses, use of in syntax 3 ELSE command 108 #ELSE compiler directive 108, 124 ENCODE command 108 example 109 ENCODING environment variable 18 END-DECLARE command 109 END-DOCUMENT command 37, 109 END-EVALUATE command 109 END-EXECUTE command 38 #end-file reserved variable 17, 211 END-FOOTING command 41, 109 example 109 END-HEADING command 42, 109 END-IF command 110, 126 #END-IF compiler directive 110 example 110 END-PROCEDURE command 43, 110 END-PROGRAM command 46, 110, 269
example 111 END-REPORT command 269 END-SELECT command 46, 110 END-SETUP command 2, 49, 110 END-SQL command 50, 110 END-WHILE command 110, 231 #ENDIF compiler directive 110, 124 ending a query 115 Enhanced-HTML section, pssqr.ini 303 Environment sections, pssqr.ini 294 ERASE-PAGE argument, NEXT-COLUMN command 175 error messages, See messages errors testing conditions 212 trapping 48 escape sequences 108 EVALUATE command 109, 111, 231 branching 111 example 112 exiting from with BREAK 53 nesting 111 exclamation points displaying 4 for comment lines 4 use of in syntax 3, 4 exclusion ranges 302 execute begin 38 end 38 EXECUTE command example 114 Sybase and Microsoft SQL Server 113 exists function 144 EXIT-SELECT command 115 example 115 exp function 138 exponents 137 expressions 132 operands 133 operators 133 EXTENT argument, LOAD-LOOKUP command 165 EXTRACT command 115 example 116
F
-F[file|directory] flag 10, 258, 266 FIELD argument, CREATE-ARRAY command 63
463
Index
-FILE command-line parameter 306 file number 177 file types FIXED 177 FIXED_NOLF 177 VARY 177 @file... command-line argument 5 file-related functions 144 delete 144 exists 144 rename 144 files closing 58 include 128 including external source 128 reading 210 FILL argument DECLARE-CHART command 69 PRINT command 194 FIND command 117 example 118 FIXED argument, OPEN command 177 FIXED file type 177 FIXED_NOLF argument, OPEN command 177 FIXED_NOLF file types 177 flagging SQR 5 flags command-line argument 5 FLOAT argument, DECLARE-VARIABLE command 100 float variables 16, 22 floating point numbers 22 floor function 138 FONT argument ALTER-PRINTER command 33 DECLARE PRINTER command 276 DECLARE-PRINTER command 89 FONT-TYPE argument ALTER-PRINTER command 33 DECLARE PRINTER command 275 DECLARE-PRINTER command 87 fonts adding entries 298 changing 280 HP LaserJet 90 PostScript 91 Windows 93 Fonts section, pssqr.ini 93, 298 specifying character sets 299 FooterBackground 68
FooterForeground 68 footers 2 FOOTING argument, ALTER-REPORT command 33, 34 FOOTING section 2, 41 FOOTING-SIZE argument, ALTER-REPORT command 34 footings 33 FOR-APPEND argument, OPEN command 177 FOR-READING argument, OPEN command 177 FOR-REPORTS argument BEGIN-FOOTING command 41 BEGIN-HEADING command 43 DECLARE-PRINTER command 86 DECLARE-PROCEDURE command 95 DECLARE-TOC command 98 USE-PROCEDURE command 229 FOR-TOCS argument BEGIN-FOOTING command 41 BEGIN-HEADING command 43 FOR-WRITING argument, OPEN command 177 FOREGROUND/BACKGROUND argument, PRINT command 194 form feeds, trailing 14 form letters 4 form-letter reports 4 FORMAT argument, INPUT command 130 format_mask argument, MOVE command 169 FORMFEED argument, DECLARELAYOUT command 80, 281 frame.html 8 FROM PARAMETER, BEGIN-EXECUTE command 39 FROM ROWSET argument, BEGIN-EXECUTE command 39 functions custom 161 file-related 134, 144 miscellaneous 134, 144 numeric 134, 162 random 162 string 161 transcendental 143 functions, miscellaneous
464
Index
array 145 ascii 145 asciic 146 chr (character) 146 cond 146 edit 148 getenv (get environment variable) isblank 149 isnull 150 to_char 158 to_multi_byte 159 to_number 159 to_single_byte 159 wrapdepth 161
148
G
GET command 118 example 118 GET-COLOR command 119 example 120 getenv function 148 glossary 431 GOTO command 121 example 121 GOTO-TOP argument, NEXT-COLUMN command 175 -GPRINT=YES | NO flag 10, 258 GRAPHIC BOX command 121 example 123 GRAPHIC command 121 GRAPHIC FONT command 269, 279 GRAPHIC HORZ-LINE command 121 example 123 GRAPHIC VERT-LINE command 121 example 123 grid, SQR 78
H
HeaderBackground 68 HeaderForeground 68 headers 2 HEADING argument, ALTER-REPORT command 33, 34 HEADING section 2, 42 HEADING-SIZE argument, ALTER-REPORT command 34 headings 33, 42 HEIGHT argument, PRINT-BAR CODE command 201
HORZ-LINE argument, GRAPHIC command 123 hostname, reserved variable for current 18 HPLASERJET 86 HTML activating procedures 237 adding horizontal divider 236 applets 7 blinking text 242 <BODY> tags 239 centering 236 citations 243 code listings 243 column headers 254 columns in tables 254 definition lists 249 definitions in definition lists 248 directory lists 248 displaying 8 ending paragraphs 238 enhanced code 8 general-purpose procedures 235 generating 8 generating output 235 <HEAD> tags 239 heading procedures 239 highlighting procedures 242 hypertext link procedures 246 hypertext links 247 inserting images 237 keyboard input 244 line breaks 236 list items 249 list procedures 247 marking text that cannot wrap 237 menus 250 ordered lists 250 preventing wrapping 237 publishing 235 rows in tables 254 sample style text 244 starting new paragraph 238 strikethrough text 245 subscript text 245 superscript text 246 table captions 252 table procedures 251 tables 253 terms in definition lists 249 unordered lists 251
465
Index
HTML buttons 299 html_a procedure 247 html_a_end procedure 247 html_blink procedure 242 html_blink_end procedure 242 html_br procedure 236 html_caption procedure 252 html_caption_end procedure 252 html_center procedure 236 html_center_end procedure 236 html_cite procedure 243 html_cite_end procedure 243 html_code procedure 243 html_code_end procedure 243 html_dd procedure 248 html_dd_end procedure 248 html_dir procedure 248 html_dir_end procedure 248 html_dl procedure 249 html_dl_end procedure 249 html_dt procedure 249 html_dt_end procedure 249 html_h1 procedure 240 html_h1_end procedure 240 html_h2 procedure 240 html_h2_end procedure 240 html_h3 procedure 241 html_h3_end procedure 241 html_h4 procedure 241 html_h4_end procedure 241 html_h5 procedure 241 html_h5_end procedure 242 html_h6 procedure 242 html_h6_end procedure 242 html_hr procedure 236 HTML-Images section, pssqr.ini 299 html_img procedure 237 html_kbd procedure 244 html_kbd_end procedure 244 html_li procedure 249 html_li_end procedure 250 html_menu procedure 250 html_menu_end procedure 250 html_nobr procedure 237 html_nobr_end procedure 237 html_ol procedure 250 html_ol_end procedure 251 html_on procedure 237 html_p procedure 238 html_p_end procedure 238
html_samp procedure 244 html_samp_end procedure 244 html_set_body_attributes procedure 239 html_set_head_tags procedure 239 html_strike procedure 245 html_strike_end procedure 245 html_sub procedure 245 html_sub_end procedure 245 html_sup procedure 246 html_sup_end procedure 246 html_table procedure 253 html_table_end procedure 253 html_td procedure 254 html_td_end procedure 254 html_th procedure 254 html_th_end procedure 254 html_tr procedure 254 html_tr_end procedure 254 html_ul procedure 251 html_ul_end procedure 251 hyperbolic cosine (cosh) function 137 hyperbolic sine 141 hyphens in command names 3 in command-line flags 5 in commands 4
I
-I command-line parameter 305 -ID flag 10, 258, 266 -Idir_list flag 10 IF command 110, 126 and WHILE commands 231 example 127 nested within a WHILE loop 231 nesting 126 #IF compiler directive 110, 124 example 125 #IFDEF compiler directive 110, 124, 125, 127 #IFNDEF compiler directive 110, 124, 125, 127 IMAGE-SIZE argument DECLARE-IMAGE command 77 PRINT-IMAGE command 208 images 77 declaring 77 printing 208 #INCLUDE command 10, 128 example 128
466
Index
include files nesting 128 understanding 128 INDENTATION argument, DECLARE-TOC command 98 indenting text 38 Informix COMMIT command 59 ROLLBACK command 212 STOP command 222 INIT-STRING argument, DECLARE-PRINTER command 86, 284 initcap function 56 initialization file 285 INPUT command example 130 preventing user input 14 prompts 129 understanding 129 INPUT commands 5 INPUT-DATE-EDIT-MASK keyword, ALTER-LOCALE command 26, 27 INSERT command 129 instr function 149 instrb function 149 int_lit abbreviation 22 INTEGER argument, DECLAREVARIABLE command 100 INTEGER data type 129 integer variables 16 INTO argument, EXECUTE command 114 isblank function 149 isnull function 150 ITEM-COLOR argument, DECLARE-CHART command 68, 69
J
joins 165
K
-KEEP flag 10, 12, 96, 258 KEY argument, LOAD-LOOKUP command 165
L
labels 121 LAST-PAGE command 131
example 132 layout DEFAULT 78 reports 78 LAYOUT argument, DECLARE-REPORT command 96 LEFT-MARGIN argument DECLARE PRINTER command 273 DECLARE-LAYOUT command 80 LEGEND argument, DECLARE-CHART command 70 LEGEND-PLACEMENT argument, DECLARE-CHART command 70 LEGEND-PRESENTATION argument, DECLARE-CHART command 70 LEGEND-TITLE argument, DECLARE-CHART command 70 LegendBackground 68 LegendForeground 68 length function 150 lengthb function 150 lengthp function 151 lengtht function 151 LET command 132 datenow function 270 edit masks 192 example 163 LEVEL argument, TOC-ENTRY command 224 -LG command-line parameter 307 LINE-HEIGHT argument, DECLARE-LAYOUT command 78, 82 LINE-SIZE argument, DECLARE PRINTER command 274 LINE-WIDTH argument, DECLARE-LAYOUT command 81 LINEPRINTER 86 lines breaking in HTML 236 drawing 122 horizontal 123 reserved variable for current 17 reserved variable for maximum 18 use of in syntax 4 vertical 123 LINES-INCH argument, DECLARE PRINTER command 274 lis files 11 list variables 16, 19 accessing 19
467
Index
arguments 19 assigning 19 creating 19 defining 19 literals 20 determining value 111 displaying 103, 217 numeric 20 text 20 -LL{s | d}{c | i} flag 11 LOAD-LOOKUP command 11, 50, 163, 167 example 166 loading an internal table 164 LOCAL argument, BEGIN-PROCEDURE command 45 local procedures 45 LOCALE keyword, ALTER-LOCALE command 27 Locale section, pssqr.ini 296 locales changing parameters 25 defined 25 reserved variable for current 18 selecting 25 SYSTEM 25 log base 10 139 log base e 138 log function 138 log messages 11 log10 function 139 logical comparison operators 132 logical expressions 126 logon, defining parameters 76 LOOKUP command 164, 167 example 167 lookup tables, searching 167 LOOPS argument, BEGIN-SELECT command 48 lower function 151 LOWER value, DAY-OF-WEEK-CASE keyword 28 LOWERCASE command 167 example 168 lowercase, use of in syntax 3, 4 lpad function 152 -LPFLAGS "<flags>" command-line parameter 307 ltrim function 152
M
marker locations 16 MATCH argument, PRINT command 194 mathematical operators 132 MAX-COLUMNS argument, DECLARE-LAYOUT command 81 MAX-LINES argument, DECLARELAYOUT command 81 MAXLEN argument, INPUT command 129, 130 MBTOSBS command 168 members, returning set 217 messages database errors 17 directing to a file 7 disabling display 14 numbered 312 setting path and name of error message file 15 unnumbered 309 -Mfile flag 11 Microsoft SQL Server BEGIN TRANSACTION command 212 ROLLBACK TRANSACTION command 212 STOP command 222 miscellaneous functions ltrim 153 range 154 replace 155 roman 155 rpad 155 rtrim 156 mod function 139 MODE argument, SECURITY command 214 MONEY argument DISPLAY command 104 MOVE command 169 PRINT command 195 SHOW command 219 MONEY-EDIT-MASK keyword, ALTER-LOCALE command 26, 27 MONEY-SIGN keyword, ALTER-LOCALE command 26, 27 MONEY-SIGN-LOCATION keyword, ALTER-LOCALE command 26, 27
468
Index
MONEY-SYMBOL command 280 MONTHS-CASE keyword, ALTER-LOCALE command 28 MONTHS-FULL keyword, ALTER-LOCALE command 28 MONTHS-SHORT keyword, ALTER-LOCALE command 28 MOVE command edit masks 192 example 169 understanding 168 -MR command-line parameter multibyte characters 213 multiple reports 32, 41 MULTIPLY command 172 example 172 multirow lists 19
306
N
NAME argument ALTER-COLOR-MAP command 23 BEGIN-FOOTING command 41 BEGIN-HEADING command 43 CLEAR-ARRAY command 58 CREATE-ARRAY command 63 CREATE-COLOR-PALETTE command 64 LOAD-LOOKUP command 165 natural log base e raised to x power 138 navigation bar 14 NEED argument, NEXT-LISTING command 176 nesting arguments 134 IF command 126 NEW-PAGE command 173 example 173 NEW-REPORT command 173 example 174 NEXT-COLUMN command 59, 174 example 175 NEXT-LISTING command 175 example 176 nn abbreviation 22 NO-ADVANCE argument, NEXT-LISTING command 176
NO-CHANGE value, DAY-OF-WEEKCASE keyword 28 NO-DUPLICATE argument, DECLARE-CONNECTION command 75 NO-FORMFEED command 269, 281 NOLF argument, PRINT-DIRECT command 207 NOLINE argument DISPLAY command 103, 104 SHOW command 219 -NOLIS flag 11, 96, 258 nondisplay characters 108, 283, 284 nonrecursive variables 19 NOP argument, PRINT command 195 NOPROMPT argument, INPUT command 130 NORMAL argument, SHOW command 219 notes xv NOWAIT argument, CALL command 55 num_col abbreviation 21 num_lit abbreviation 22 num_var abbreviation 21 NUMBER argument DISPLAY command 104 MOVE command 169 PRINT command 195 SHOW command 219 number columns 15 NUMBER data type 129 NUMBER-EDIT-MASK keyword, ALTER-LOCALE command 26, 27 numerals numeric literals 20 numeric edit format characters 186 numeric edit masks 27 numeric functions 134, 162 absolute value 135 arccosine (acos) 135 arcsine (asin) 135 arctangent (atan) 136 ceil 136 cosine (cos) 136 degrees (deg) 137 e10 (10 raised to x power) 137 exp (natural log base e raised to x power) 138 floor (largest integer) 138 hyperbolic cosine (cosh) 137
469
Index
hyperbolic sine (sinh) 141 hyperbolic tangent (tanh) 143 log base e 138 log10 (log base 10) 139 mod 139 power 139 radians (rad) 140 round 140 sign 141 sin 141 sine 141 square root (sqrt) 142 tangent (tan) 142 truncate (trunc) 143 numeric literals 20 numeric operands 133 numeric variables 16 nvl function 153
O
-O[file] flag 11, 258, 266 ODBC COMMIT command 59 ROLLBACK command 212 -OF command-line parameter 306 -olim flag 11 ON-BREAK argument, PRINT command 195 ON-ERROR argument BEGIN-EXECUTE command 39 BEGIN-SELECT command 48 BEGIN-SQL command 52 CONNECT command 62 DIVIDE command 106 EXECUTE command 114 -OP command-line parameter 306 OPEN command 176 example 177 operands converting 133 understanding 133 operating system issuing commands 53 opening files 177 reserved variable for returning 18 operators, precedence 133 Oracle 48 BEGIN-SQL command, -Cnn 52 COMMIT command 59 PL/SQL 51
ROLLBACK command 212 ORIENTATION argument DECLARE PRINTER command 273 DECLARE-LAYOUT command 78, 80 -OT command-line parameter 306 output available types 2 choosing printer type 12 HTML 235 layout of files 78 overriding default file 10 reserved variable for returning file name 19 SQR Print 263, 268 using the command line 263 writing directly to files 207 OUTPUT argument, EXECUTE command 114
P
-P flag 11, 258, 266 page buffer 207 page footers 2 page headers 2 page numbers last 131 reserved variable for current 17 page overflow 173 #page-count reserved variable 17 PAGE-DEPTH argument, DECLARE-LAYOUT command 78, 81 PAGE-NUMBER command 178 example 178 PAGE-SIZE command 269, 282 pages adding numbers 178 new 173 setting position 179 writing 173 writing data at specified position 180 palettes 67 PAPER-SIZE argument, DECLARELAYOUT command 78, 80, 282 paragraphs completing 109, 111 document 4, 37, 179, 428 SELECT 47, 115 SQL 50
470
Index
PARAMETER_LIST argument, BEGIN-EXECUTE command 39 PARAMETERS argument, DECLARE-CONNECTION command 75 parentheses, use of in syntax 3 PASSWORD argument, DECLARECONNECTION command 75 -PB flag 11, 258 PDF Fonts section, pssqr.ini 300 PDF Fonts: Exclusion Ranges section, pssqr.ini 302 PeopleBooks ordering xii PeopleCode, typographical conventions xiv pie chart, printing 206 PIE-SEGMENT-EXPLODE argument, DECLARE-CHART command 71 PIE-SEGMENT-PERCENT-DISPLAY argument, DECLARE-CHART command 70 PIE-SEGMENT-QUANTITY-DISPLAY argument, DECLARE-CHART command 70 PITCH argument ALTER-PRINTER command 33 DECLARE-PRINTER command 88 PL/SQL 51 PlotAreaBackground 68 PlotAreaForeground 68 POINT-MARKERS argument, DECLARE-CHART command 70 POINT-SIZE argument ALTER-PRINTER command 33 DECLARE PRINTER command 275 DECLARE-PRINTER command 87 position abbreviation 22 position argument, PRINT-IMAGE command 208 POSITION command 179 example 179 postscri.str file 184 POSTSCRIPT 86 power function 139 precedence, operators 133 precision 133 predefined variables, See reserved variables prerequisites xi PRINT ... CODE command 270, 283
PRINT ... CODE-PRINTER command 270, 283 PRINT command 119, 180 encode characters 108 format commands 180 Print dialog box, Windows 268 PRINT-BAR-CODE command 200 example 201 PRINT-CHART command 67, 202 example 206 PRINT-DIRECT command encode characters 108 example 207 understanding 207 PRINT-IMAGE command and DECLARE-IMAGE 77 example 208 understanding 207 PRINT-TEXT-BACKGROUND argument GET-COLOR command 119 SET-COLOR command 215 PRINT-TEXT-FOREGROUND argument GET-COLOR command 119 SET-COLOR command 215 printed documentation xii PRINTER argument, PRINT-DIRECT command 207 printer control characters 11 printer type choosing 12 setting 227 PRINTER.COLOR option 67 PRINTER-DEINIT command 269, 283 -PRINTER:EH flag 12 -PRINTER:EP flag 12 -PRINTER:HP flag 12 -PRINTER:HT flag 12 PRINTER-INIT command 270, 284 -PRINTER:LP flag 12 -PRINTER:PD flag 12 -PRINTER:PS flag 12 PRINTER-TYPE argument, DECLARE-REPORT command 96 -PRINTER:WP flag 12, 93 -PRINTER:xx flag 12, 259, 267 printers altering parameters at runtime 32 overriding defaults 85 printing Hebrew 186
471
Index
on Windows 93 PROCEDURE argument, BEGIN-EXECUTE command 39 PROCEDURE section 2 procedures beginning 44 calling recursively 44 declaring 94 global 44 invoking 107 local 44 passing date arguments to 44 passing numeric variables to 44 passing string arguments to 44 running 2, 107 stored 51 USE-PROCEDURE command 228 process file, reserved variable for returning 19 process ID, reserved variable for returning 18 Processing-Limits section, pssqr.ini 292 program command-line argument 4 PROGRAM section 2, 46 program structure 2 program.lis file 10 program.log file 11 program.spf file 15 program.sqr file 10 program.sqt file 12 programs, samples 425 prompts, INPUT command 129 PROPERTIES argument, BEGIN-EXECUTE command 39 pssqr.exe, command-line options 304 pssqr.ini for other platforms 285 for Windows 285 pssqr.ini sections Colors 304 default settings 286 Enhanced-HTML 303 Environment 294 Fonts 298 HTML-Images 299 Locale 296 PDF Fonts 300 PDF Fonts: Exclusion Ranges 302 Processing-Limits 292 TrueType font 302
publishing HTML 235 PUT command example 210 rules 209 understanding 209
Q
queries, ending 115 QUIET argument LOAD-LOOKUP command STOP command 222 quotes use of in commands 21 165
R
-R command-line parameter 305 radians (rad) function 140 random function 162 range function 154 READ command 210 example 211 RECORD argument, OPEN command 177 records reading 210 writing to a file 232 related documentation xii relinking SQR 161 REMOVE argument, SECURITY command 214 rename function 144 replace function 155 report footer 2 report headers 2 report procedures running 2 {report}.bqd file 7 {report}.csv file 8 reports BEGIN-HEADING command 42 closing 173 defining 96 designing 2 displaying output on screen 7 layout 2, 78 marking sections for security 213 multiple 32, 41, 174 opening 173 output types 2
472
Index
referencing external source files 128 reserved variable for returning name of output file 19 samples 20 switching between 230 testing 13 reserved variables 16 global versus local 44 $username 61 RESET-STRING argument, DECLARE-PRINTER command 87 #return-status reserved variable 17 RETURN_VALUE argument, LOAD-LOOKUP command 165 REVERSE argument, SHOW command 219 rgb argument CREATE-COLOR-PALETTE command 64 DECLARE-COLOR-MAP command 75 RGB values 23 RIGHT-MARGIN argument, DECLARE-LAYOUT command 81 ROLLBACK command 212, 222 and COMMIT command 59 example 212 ROLLBACK TRANSACTION command 60 ROLLBACK TRANSACTION command, Sybase and Microsoft SQL Server 212 roman function 155 ROUND argument ADD command 23, 106 MULTIPLY command 172 SUBTRACT command 224 round function 140 ROWCOUNT command, Oracle and Sybase 17 rows affected by SELECT paragraph 17 buffering 6 eliminating duplicates from query 48 reserved variable for counting 17 specifying number to retrieve 48 specifying number to retrieve simultaneously 48 ROWS argument, LOAD-LOOKUP command 165 -RP command-line parameter 305
rpad function 155 -RS flag 12, 13 RSV argument, BEGIN-EXECUTE command 39 rtrim function 156 runtime file saving 12 using 13
S
-S flag 13, 259 sample programs 425 sample reports 20 SBTOMBS command 213 scaling factor 9 SCHEMA argument, BEGIN-EXECUTE command 39 screen I/O 217 searches, using LOAD-LOOKUP 164 sections, completing 109, 111 SECURITY command 213 example 214 security IDs 214 SELECT paragraphs beginning 47 exiting 115 sequential processing, FORREADING 177 SET argument, SECURITY command 214 SET-COLOR command 214 example 215 SET-GENERATIONS command 216 example 216 SET-LEVELS command 216 example 217 SET-MEMBERS command 217 example 217 SETUP section 2, 49 SHADE argument, PRINT command 184, 197 SHOW command edit masks 192 example 219 understanding 217 versus DISPLAY command 103 sid argument, SECURITY command 214 sign function 141 sin function 141 sine function 141
473
Index
single quotes, displaying 4 single quotes, use of in syntax 3 single-byte characters 213 single-byte strings 168 sinh function 141 SIZE argument, CREATE-ARRAY command 63 SKIPLINES argument, NEXT-LISTING command 176 SORT argument, LOAD-LOOKUP command 165 SOURCE argument DECLARE-IMAGE command 77 PRINT-IMAGE command 208 source code 2 source field 168 source files, including external 128 spaces, use of in syntax 4 spf files 11, 12 SPF Viewer, invoking 15 SQL paragraphs 50 SQL, syntax errors 48 #sql-count reserved variable 17 $sql-error reserved variable 17 #sql-status reserved variable 17 SQR avoiding older commands 269 banner 14 benefits of 2 command-line arguments 4 command-line interface 4 compiling 124 data elements 15 defined 1 executables 4 flags 5 grid 78 high-level programming capabilities 2 initialization file 15, 285 language 1, 2 language overview 1 object-oriented program logic 2 page buffer 207 preventing database signin 14 procedures 2 process file 19 process ID 18 program structure 1, 2 relinking 161 relinking to CALL 54
reserved variable for returning process file 19 reserved variable for returning process ID 18 reserved variables 16 rules for entering commands 1, 4 sample programs 425 stopping 222 syntax conventions 1, 3 tools 1 understanding 1, 2 writing applications with 2 SQR commands rules for entering 1 SQR executable 4 SQR Execute 1, 4 flags 255 running 255 SQR Print 1, 4, 263 command-line flags 264 generating output 268 Windows Print dialog box 268 SQR reports 2 SQR Samples 1 $sqr-database reserved variable 18 {sqr-database} reserved variable 18 SQR_DB_DATE_FORMAT setting 44, 60 SQR_DB_DATE_ONLY_FORMAT setting 44, 61 SQR_DB_TIME_ONLY_FORMAT setting 44, 61 $sqr-dbcs reserved variable 18 {sqr-dbcs} reserved variable 18 sqr-encoding reserved variable 18 {sqr-encoding- console} reserved variable 17 $sqr-encoding- database reserved variable 17 {sqr-encoding- database} reserved variable 17 $sqr-encoding- file-input reserved variable 17 {sqr-encoding} reserved variable 18 $sqr-encoding-console reserved variable 17 {sqr-encoding-file-input} reserved variable 17 $sqr-encoding-file-output reserved variable 18
474
Index
{sqr-encoding-file-output} reserved variable 18 $sqr-encoding-report-output reserved variable 18 {sqr-encoding-report-output} reserved variable 18 $sqr-encoding-source reserved variable 18 {sqr-encoding-source} reserved variable 18 sqr-hostname, reserved variable 18 {sqr-hostname} reserved variable 18 sqr.ini file 15 Default-Settings section of 27 $sqr-locale reserved variable 18 sqr.log file 11 #sqr-max-columns reserved variable 18 #sqr-max-lines reserved variable 18 #sqr-pid reserved variable 18 $sqr-platform reserved variable 18 {sqr-platform} reserved variable 18 $sqr-program reserved variable 19 $sqr-report reserved variable 19 $sqr-ver reserved variable 19 sqrerr.dat file 15 SQREXT.MAK 54 SQRMAKE 54 SQRP executable 4, 263 SQRT executable 4, 255 sqrt function 142 SQRW executable 4 SQRWP executable 4, 263 SQRWT executable 4, 255 square brackets, use of in syntax 3 square root 142 STARTUP-FILE argument DECLARE PRINTER command 275 DECLARE-PRINTER command 88 STATUS argument BEGIN-EXECUTE command 39 INPUT command 130 INPUT command, values for 130 OPEN command 177 READ command 211 WRITE command 233 STOP command 222 example 222 stored procedures executing 113 preventing creation 15, 48, 52
understanding 51 STRING command 222 example 223 string functions 161 extract 115 instr 149 instrb 149 length 150 lengthb 150 lengthp 151 lengtht 151 lower 151 lowercase 167 lpad 152 ltrim 152 substr 157 substrb 157 substrp 158 substrt 158 transform 160 translate 160 unicode 160 upper 161 string operands 133 string values 144 string variables, converting to uppercase 226 strings converting double-byte to single-byte 168 copying 116 copying into text variables 225 double-byte 168 finding character sequences within 117 single-byte 168 strtodate function 156, 191 Structured Query Report, See SQR structuring a program 2 SUB-TITLE argument, DECLARECHART command 69 subroutines calling 53, 55 writing 53 substitution variables ASK command 36 #DEFINE command 101 #IF compiler directive 124 #IFDEF compiler directive 127 #IFNDEF compiler directive 128 substr function 157
475
Index
substrb function 157 substrings 115, 225 substrp function 158 substrt function 158 SUBTRACT command 223 example 224 suggestions, submitting xvi Sybase BEGIN TRANSACTION command 212 ROLLBACK TRANSACTION command 212 STOP command 222 USE command 226 SYBASE CT-Lib 48 SYMBOL-SET argument ALTER-PRINTER command 33 DECLARE PRINTER command 275 DECLARE-PRINTER command 87 syntax conventions 3 SYSTEM argument, CALL command 55, 56 SYSTEM locale 25 SYSTEM value 27
T
-T{B} flag 13 -T{B|Z|BZ|ZB} flag 260 -T{Z} flag 14 TABLE argument, LOAD-LOOKUP command 165 table of contents 97 See Also DECLARE-TOC command creating entries 224 defining 97 footing for 41 heading for 43 sharing 98 suppressing 15 tables loading internal 164 tabs use of in syntax 4 tabular reports, NEXT-LISTING command 176 tan (tangent) function 142 tanh function 143 temporary stored procedures 15 terms 431 testing
error conditions 212 STOP command 222 TEXT argument DECLARE-VARIABLE command 100 PRINT-BAR-CODE command 201 TOC-ENTRY command 224 text edit format characters 185 text literals 20 text variables 16 concatenating 222 copying strings into 225 THOUSAND-SEPARATOR keyword, ALTER-LOCALE command 26, 28 TIME column type 185 TIME-SEPARATOR keyword, ALTER-LOCALE command 26, 28 times displaying 103 reserved variable for current 16 TITLE argument, DECLARE-CHART command 69 -Tnn flag 13, 259 to_char function 158 to_multi_byte function 159 to_number function 159 to_single_byte function 159 TOC argument, DECLARE-REPORT command 96 TOC-ENTRY command 224 example 224 TOP-MARGIN argument DECLARE PRINTER command 273 DECLARE-LAYOUT command 80 -TR command-line parameter 306 trailing blanks preserving 11, 15 trimming 13 trailing form feeds 14 trailing zeros 14 transcendental functions 143 transform function 160 translate function 160 TrueType Font section, pssqr.ini 302 trunc (truncate) function 143 txt_col abbreviation 21 txt_lit abbreviation 22 txt_var abbreviation 21 TYPE argument
476
Index
DECLARE PRINTER command 273 DECLARE-CHART command 70 DECLARE-IMAGE command 77 DECLARE-PRINTER command 86 INPUT command 129, 130 PRINT-BAR-CODE command 201 PRINT-IMAGE command 208 typographical conventions xiv
V
VALUE argument, ALTER-COLOR-MAP command 23 value determination 111 variables 16 assigning 20 assigning values of expressions to 132 bind 48 case sensitivity 16 converting to uppercase 226 date 16 decimal 16, 22 declaring 99 determining value 111 displaying 103, 217 dynamic query 48 float 16, 22 global 16 in syntax 3 initialization 16 integer 16 length of 16 list 16, 19 list variable arguments 19 local 16 names 16 naming 16 nonrecursive 19 numeric 16 reference 37 reserved 16 rules 16 string 116 substitution 37, 101, 127 text 16 VARY argument, OPEN command 177 VARY file type 177 VERT-LINE argument, GRAPHIC command 123 vertical bars, use of in syntax 3 visual cues xv -Vserver flag 14, 260
U
UCALL function arguments 54 avoiding database calls 53 UCALL.C source file 54 UFUNC.C 161 UNDERLINE argument PRINT command 198 SHOW command 219 underscores in procedure names 3 in variable names 3 unicode function 160 UNSTRING command 225 example 225 UPC-A bar code 201 UPDATE command 129 upper function 161 UPPER value, DAY-OF-WEEK-CASE keyword 28 UPPERCASE command 226 example 226 uppercase, use of in syntax 3, 4 USE command 50, 226 example 226 USE-COLUMN command 59, 227 example 227 USE-PRINTER-TYPE command 227 example 228 USE-PROCEDURE command 228 example 229 USE-REPORT command 230 example 230 USER argument, DECLARECONNECTION command 75 user input INPUT command 129 preventing 14 $username reserved variable 19, 61 username, database 19
W
WAIT argument, CALL command warnings xv WHEN argument, EVALUATE command 112 55
477
Index
WHEN-OTHER argument, EVALUATE command 112 WHERE argument, LOAD-LOOKUP command 165 WHILE ... END-WHILE loop 53 WHILE command 111 example 231 exiting from with BREAK 53 understanding 230 WHILE loop 230 wildcard characters, on UNIX/Linux-based systems 4 Windows generating output 268 selecting a printer 268 WITH RECOMPILE argument, EXECUTE command 114 WRAP argument, PRINT command 198 wrapdepth function 161 WRITE command 232 example 233
X-AXIS-TICK-MARK-PLACEMENT or Y-AXIS-TICK-MARK-PLACEMENT argument, DECLARE-CHART command 73 -XB flag 14, 260, 267 -XC argument, EXECUTE command 114 -XC flag 14 -XCB flag 14, 260 -XI flag 14 -XL flag 14, 261 -XLFF flag 14 -XMB flag 14, 261 -XNAV flag 14, 261, 267 -XP argument BEGIN-SELECT command 48 BEGIN-SQL command 52 -XP flag 15, 261 -XTB flag 15, 261, 267 -XTOC flag 15, 261, 267
Y
Y-AXIS-MAJOR-TICK- MARKS argument, DECLARE-CHART command 72 Y-AXIS-MAX-VALUE argument, DECLARE-CHART command 71 Y-AXIS-MIN-VALUE argument, DECLARE-CHART command 71 Y-AXIS-MINOR-TICK-MARKS argument, DECLARE-CHART command 72
X
X-AXIS-GRID or Y-AXIS-GRID argument, DECLARE-CHART command 73 X-AXIS-LABEL or Y-AXIS-LABEL argument, DECLARE-CHART command 71 X-AXIS-MAJOR INCREMENT or Y-AXIS-MAJOR INCREMENT argument, DECLARE-CHART command 72 X-AXIS-MAJOR-TICK- MARKS argument, DECLARE-CHART command 72 X-AXIS-MAX-VALUE argument, DECLARE-CHART command 71 X-AXIS-MIN-VALUE argument, DECLARE-CHART command 71 X-AXIS-MINOR INCREMENT or Y-AXIS-MINOR INCREMENT argument, DECLARE-CHART command 72 X-AXIS-MINOR-TICK-MARKS argument, DECLARE-CHART command 72 X-AXIS-SCALE or Y-AXIS-SCALE argument, DECLARE-CHART command 71
Z
zeros, trailing 14 -ZIF{file} flag 15, 261, 267 ZIP+4 Postnet 201 -ZIV flag 15, 261 -ZMF{file} flag 15, 261, 267
478