QUEST Procedure Reference

Similar documents
APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software. Each of these steps can be executed independently.

APPENDIX 2 Customizing SAS/ASSIST Software

DBLOAD Procedure Reference

Using the SQL Editor. Overview CHAPTER 11

CHAPTER 13 Importing and Exporting External Data

Introduction. LOCK Statement. CHAPTER 11 The LOCK Statement and the LOCK Command

Macro Facility. About the Macro Facility. Automatic Macro Variables CHAPTER 14

Using Data Transfer Services

Storing and Reusing Macros

CHAPTER 7 Using Other SAS Software Products

SAS/ASSIST Software Setup

Creating and Executing Stored Compiled DATA Step Programs

Formats. Formats Under UNIX. HEXw. format. $HEXw. format. Details CHAPTER 11

The SAS Interface to REXX

SAS File Management. Improving Performance CHAPTER 37

Using Cross-Environment Data Access (CEDA)

Data Representation. Variable Precision and Storage Information. Numeric Variables in the Alpha Environment CHAPTER 9

Chapter 7 File Access. Chapter Table of Contents

Chapter 28 Saving and Printing Tables. Chapter Table of Contents SAVING AND PRINTING TABLES AS OUTPUT OBJECTS OUTPUT OBJECTS...

SAS Support for TELNET on Windows

from the source host, use the FTP put command to copy a file from the source host to the target host.

Chapter 3 Managing Results in Projects. Chapter Table of Contents

Overview. CHAPTER 2 Using the SAS System and SAS/ ASSIST Software

SAS I/O Engines. Definition. Specifying a Different Engine. How Engines Work with SAS Files CHAPTER 36

Permission Program. Support for Version 6 Only. Allowing SAS/SHARE Client Access to SAS Libraries or Files CHAPTER 40

SAS/FSP 9.2. Procedures Guide

OS/2: SPX Access Method

Data Set Options. Specify a data set option in parentheses after a SAS data set name. To specify several data set options, separate them with spaces.

External Files. Definition CHAPTER 38

Customizing Your SAS Session

Introduction. Getting Started with the Macro Facility CHAPTER 1

SYSTEM 2000 Essentials

Introduction. CHAPTER 3 Working in the SAS Windowing Environment

Routing the SAS Log and SAS Procedure Output

The SERVER Procedure. Introduction. Syntax CHAPTER 8

Informats. Informats Under UNIX. HEXw. informat. $HEXw. informat. Details CHAPTER 13

Chapter 25 PROC PARETO Statement. Chapter Table of Contents. OVERVIEW SYNTAX SummaryofOptions DictionaryofOptions...

Using Dynamic Data Exchange

The EXPLODE Procedure

Changes and Enhancements

DATA Step Debugger APPENDIX 3

Windows: SPX Access Method

CV2ODBC Procedure. Overview. CV2ODBC Procedure Syntax APPENDIX 4

Chapter 6 Creating Reports. Chapter Table of Contents

SCL Arrays. Introduction. Declaring Arrays CHAPTER 4

Graphics. Chapter Overview CHAPTER 4

Optimizing System Performance

SAS Catalogs. Definition. Catalog Names. Parts of a Catalog Name CHAPTER 32

Locking SAS Data Objects

The correct bibliographic citation for this manual is as follows: SAS Institute Inc Proc EXPLODE. Cary, NC: SAS Institute Inc.

Tasks Menu Reference. Introduction. Data Management APPENDIX 1

CHAPTER 5 Macintosh: TCP/IP Access Method

OpenVMS Operating Environment

Executing SAS/AF Applications

SAS Data Libraries. Definition CHAPTER 26

Chapter 14 Introduction to the FACTEX Procedure

Alternative ODS HTML Statements for Running Examples in Different Operating Environments

Introduction to the OpenVMS Operating Environment

WKn Chapter. Note to UNIX and OS/390 Users. Import/Export Facility CHAPTER 9

Using SAS Files. Introduction CHAPTER 5

Changes and Enhancements

The GTESTIT Procedure

UNIX Spawner Program. Starting the UNIX Spawner Program CHAPTER 36

Functions and CALL Routines

The TRANTAB Procedure

Defining Your Data Sources

Routing Output. Producing Output with SAS Software CHAPTER 6

Introduction. Understanding SAS/ACCESS Descriptor Files. CHAPTER 3 Defining SAS/ACCESS Descriptor Files

10 The First Steps 4 Chapter 2

The GANNO Procedure. Overview CHAPTER 12

SAS/ACCESS Data Set Options

Chapter 23 Animating Graphs. Chapter Table of Contents ANIMATING SELECTION OF OBSERVATIONS ANIMATING SELECTED GRAPHS...347

CHAPTER 7 Examples of Combining Compute Services and Data Transfer Services

Loading Data. Introduction. Understanding the Volume Grid CHAPTER 2

SAS Component Language (SCL) Interface to Agent Services

Using the SAS/ACCESS Interface to IMS-DL/I DATA Step Interface

SAS/ACCESS Interface to R/3

Chapter 41 SAS/INSIGHT Statements. Chapter Table of Contents

OS/390 Platform Examples

Using Unnamed and Named Pipes

The GSLIDE Procedure. Overview. About Text Slides CHAPTER 27

UNIX Platform Error Messages

Chapter 2 User Interface Features. networks Window. Drawing Panel

Choosing the Right Procedure

Changes and Enhancements

Examples That Use Remote Objecting

SAS/ACCESS 9.2. Interface to PC Files Reference. SAS Documentation

Introduction to MDDBs

Installation Instructions for SAS/ACCESS Interface to SAP BW

SAS Web Infrastructure Kit 1.0. Overview

What Is a Communications Access Method? CHAPTER 1 Using Communications Access Methods

SAS Drug Development. SAS Macro API 1.3 User s Guide

SAS. IT Service Level Management 2.1: Migration Documentation

Batch Importing. Overview CHAPTER 4

SAS Business Rules Manager 1.2

Chapter 27 Saving and Printing Graphics

The FORMS Procedure. Overview CHAPTER 20

Chapter 28 Command Reference. Chapter Table of Contents TSVIEW COMMAND FORECAST COMMAND

Chapter 25 Editing Windows. Chapter Table of Contents

Allocating External Files

Transcription:

111 CHAPTER 9 QUEST Procedure Reference Introduction 111 QUEST Procedure Syntax 111 Description 112 PROC QUEST Statement Options 112 Procedure Statements 112 SYSTEM 2000 Statement 114 ECHO ON and ECHO OFF 115 SYSTEM 2000 Strings and Functions 116 Single-User and Multi-User Operation 116 Single-User Operation 116 The S2KPARMS File 116 Attention Interrupts in TSO 117 Multi-User Operation 117 Temporary Output File 117 Command File 117 Attention Interrupts in TSO 118 Introduction This chapter provides reference information for the QUEST procedure. It includes the PROC QUEST syntax as well as details of some SYSTEM 2000 statements and parameters as they specifically pertain to using the QUEST procedure. For examples of how to use the statement options, refer to Chapter 5, Browsing and Updating SYSTEM 2000 Data, on page 43. The QUEST procedure enables you to create, access, and manage SYSTEM 2000 databases. Refer to SAS Language Reference: Dictionary and the SAS documentation for your host system if you need help with the terminology used in this procedure description. For information about SYSTEM 2000 statements, see the current version of SYSTEM 2000 Quick Reference Guide for SCF Commands. Help is also available from within the SAS System by choosing Help then SAS System Help from the menu bar, then Help on SAS System Products and SAS/ACCESS in the help system. QUEST Procedure Syntax PROC QUEST <S2KMODE= M S> <BLANKS>; MCS; QUIT;

112 Description 4 Chapter 9 SCS; SYSTEM 2000 statement; SAS statements that can be issued anywhere, for example, TITLE and FILENAME, are also available when you are using the QUEST procedure. Note: If you issue a RUN statement, the SAS System ignores it during a QUEST session. 4 Description The QUEST procedure enables you to access SYSTEM 2000 software from within the SAS System to perform a variety of tasks, for example, 3 retrieving data from a database 3 updating data in a database 3 defining a new database 3 assigning passwords to a database 3 saving a database 3 restoring a database 3 enabling rollback. The QUEST procedure is interactive. You enter SYSTEM 2000 statements, and the SYSTEM 2000 software executes them as soon as you submit them. You do not need a RUN statement. PROC QUEST Statement Options You can use the PROC QUEST statement without any arguments. Do not use any arguments if you want to use the QUEST procedure in a Multi-User environment. Also, by default, the SAS System will delete leading, trailing, and extraneous embedded blanks in SYSTEM 2000 statements. The following options can be used with the PROC QUEST statement: S2KMOD S2KMD= M S specifies your mode of accessing SYSTEM 2000 software, M for Multi-User or S for single-user. Use M to access Multi-User SYSTEM 2000 software running in a different CMS machine or OS/390 address space. Use S to load and execute your own copy of SYSTEM 2000 software in your machine or address space. The default is M. S2KMD= is an alias for S2KMODE=. (ACCESS=, ACC=, DBACCESS=, and DBACC=, which were available for Version 5, are also acceptable synonyms.) BLANKS BLANK retains all blanks in SYSTEM 2000 statements and passes them along to SYSTEM 2000 software. If you do not specify the BLANKS option, SAS software deletes extraneous blanks by default; that is, leading, trailing, and multiple blanks between words are stripped from the statements before SYSTEM 2000 reads the statements. You can specify the BLANKS option in order to retain blanks in LIST column headings, TEXT values, and report titles and headings. BLANK is an alias for BLANKS. Procedure Statements The QUEST procedure statements specify how SYSTEM 2000 statements will be submitted within the QUEST procedure: a command at time (single command

QUEST Procedure Reference 4 MCS 113 submission) or as a series of queued commands (multiple command submission). Or, you can submit SYSTEM 2000 statements in a Command File and not use any statements. Multiple command submission and Command Files are supported only in Multi-User access mode. The QUEST statements are described below. All of the statements are optional. Guidelines for specifying SYSTEM 2000 statements are provided in SYSTEM 2000 Statement on page 114. For information about the single-user and Multi-User execution environments, see Single-User and Multi-User Operation on page 116. MCS Optional statement Syntax MCS; Details The MCS statement puts the QUEST procedure into statement-queuing mode (multiple command submission). That is, the QUEST procedure accumulates statements in a 32760-byte buffer before submitting them to SYSTEM 2000 software. You submit the accumulated statements to SYSTEM 2000 software by submitting two semicolons. You will remain in MCS mode until you issue the SCS statement. The MCS statement is ignored in single-user access. In a Multi-User environment, you can use the MCS statement or a Command File to submit a long sequence of SYSTEM 2000 statements that must be processed together as a set, for example, 3 to define a new database or modify an existing definition 3 to submit statements to the Report Writer feature 3 to submit a set of IF-THEN-ELSE statements 3 to submit QUEUE/TERMINATE statement blocks. If your accumulated statements fill up the buffer, the system displays message -898-. This message asks you either to submit the statements in the buffer by entering two semicolons or to submit the SCS statement to erase the buffer contents and terminate MCS mode. Issue the RECALL command to bring the submitted statements back to the program editor window. Issue the SAVE command to store the statements in an external file. Then, you can use the LOCAL COMMAND IS statement to have SYSTEM 2000 software process the statements in that file. Also, if you exit the SAS System, the MCS buffer is emptied without sending the statements to SYSTEM 2000 software. To exit the SAS System and close the database, enter BYE on the program editor s command line or submit an ENDSAS statement. If you submit long strings of statements that terminate with the ENDSAS statement, you must end the SYSTEM 2000 session with a double semicolon. Otherwise the statements are not sent to SYSTEM 2000 software.

114 QUIT 4 Chapter 9 QUIT Terminates the QUEST procedure Optional statement Syntax QUIT END EXIT; Details The QUIT statement closes the SYSTEM 2000 database, terminates the SYSTEM 2000 session, and ends the QUEST procedure. END and EXIT are aliases for the QUIT statement. You can issue the SYSTEM 2000 EXIT statement any time during the QUEST session. SCS Optional statement Syntax SCS; Details The SCS statement puts the QUEST procedure into single-statement queuing mode (single command submission). Note: SCS erases the 32760-byte buffer (used with MCS mode) even if it contains statements not yet sent to SYSTEM 2000 software. 4 SYSTEM 2000 Statement The SYSTEM 2000 statement in the QUEST procedure can be any valid SYSTEM 2000 statement that is available in the Self-Contained Facility, including 3 CONTROL statements to save and restore databases, to assign passwords and authorities, to create and remove indexes, and so on 3 DEFINE statements to define, change, and delete database components in the database definition 3 QUEST statements to access a database for retrieval and updates 3 REPORT statements to produce customized reports. For more information, see the SYSTEM 2000 Quick Reference Guide. Note: When you submit SYSTEM 2000 statements through the QUEST procedure, the statements are subject to SAS syntax rules. For example, statements must end with

QUEST Procedure Reference 4 ECHO ON andecho OFF 115 a semicolon (;) instead of a colon (:), /* and */ delimit comments, and so on. SYSTEM 2000 statements containing a character literal longer than 200 characters are rejected. Also, if you want to use the single quote or the double quote as the delimiter in a SYSTEM 2000 where-clause, you must use one of the techniques described below. Otherwise, the quotes cause ambiguity between the SAS System parser and the SYSTEM 2000 parser. 4 A quoted string is required if the SYSTEM 2000 where-clause condition contains 3 a value that is mixed case 3 a where-clause keyword, such as AT, AND, or OR in the value, for example, PRINT ENTRY WHERE C303 CONTAINS INSTRUCTOR AT ACC ; 3 a single quote or a double quote in the value. Also, you might want to use quoted strings simply because you are accustomed to using them in other systems. To use the single quote or double quote around a value in a where-clause condition, you can use either of these methods: 3 Create a short SYSTEM 2000 Command File that contains the following two statements, which make the where-clause delimiter the single quote: DELIMITER IS ; COMMAND FILE IS INPUT; 3 Invoke this Command File once to change the delimiter; the second statement returns you to your usual way of entering statements in the QUEST procedure. Running this short Command File at the beginning of your QUEST session saves you from having to put every statement that contains a quoted string into a separate Command File. Note: Commands must be uppercase in a Command File. 4 3 If you do not want to create the short Command File, you can submit the following statements from the PROGRAM EDITOR window. delimiter is ; ; x ; You will receive messages from SYSTEM 2000 software and a syntax error, but after the x ; statement finishes processing, you can safely use the single quote as the where-clause delimiter. If a value contains a single quote, change the delimiter to the double quote with one of the methods shown above. ECHO ON and ECHO OFF SYSTEM 2000 messages are displayed on the log window, along with SAS System messages. The ECHO ON statement displays echoes of SYSTEM 2000 statements in the output window along with the statement s output. This is convenient for debugging or interpreting results. With ECHO OFF, the SYSTEM 2000 statement echoes do not appear in the output window. Note: If you use ECHO ON and the MCS statement, often the echo of a SYSTEM 2000 command will not appear immediately above the output for the command. 4

116 SYSTEM 2000 Strings andfunctions 4 Chapter 9 SYSTEM 2000 Strings and Functions You will probably need to modify any existing SYSTEM 2000 strings and functions for the QUEST procedure because 3 the statement terminator must be the semicolon, not the colon. Any colons embedded in the strings or functions will not work properly. Therefore, a string or function with embedded statement terminators can be invoked from within the QUEST procedure or from outside, but not both. 3 statements cannot start with the default SYSTEM 2000 separator, the asterisk. To the SAS System, an asterisk signifies the start of a comment. You cannot use the percent sign as a system separator; it denotes a macro statement to the SAS System. To avoid problems with the system separator, issue the SEPARATOR IS statement to change the separator. For example, the following statement changes the separator to the # sign: separator is #; Single-User and Multi-User Operation Single-User Operation When you invoke the QUEST procedure with single-user access (S2KMODE=S), the SAS System displays the following information: 3 SYSTEM 2000 initialization parameters 3 SYSTEM 2000 version number 3 copyright information. Issue the USER statement to establish your password and start your SYSTEM 2000 session. For example, the following statements attach the EMPLOYEE database: user,demo; data base name is employee; The SYSTEM 2000 interface to the SAS System accesses the database and displays any output on the output window or in the SAS print file (if you are executing in interactive line mode). The S2KPARMS File Since you are running in your own address space when you have single-user access, you can specify a variety of parameters. (Refer to the SYSTEM 2000 Product Support Manual for information about SYSTEM 2000 execution parameters.) To specify execution parameters for the QUEST procedure with single-user access, you must set up a file with a fileref of S2KPARMS. If there is no S2KPARMS fileref, system defaults are used. For example, the LIST=YES parameter displays the parameter values on the log window when the system is initialized. To suppress this display, edit a file to contain LIST=NO and allocate it with a fileref of S2KPARMS in your SYSTEM 2000 CLIST or EXEC.

QUEST Procedure Reference 4 Multi-User Operation 117 Attention Interrupts in TSO If you press the Attention Interrupt key while processing a where-clause in single-user access, your request is canceled. A canceled retrieval produces no output, and a canceled update does not alter the database. If you interrupt processing at any other time, the interrupt is ignored. When you return to the SAS System, the usual SAS interrupt-handling mechanism is restored. While it is not recommended, you can prevent single-user access from intercepting the SAS attention-interrupt mechanism by specifying STAX=NO in the S2KPARMS file. Be aware, however, that if you terminate both the QUEST procedure and the SAS System with the SAS Attention exit after having updated the database, you might have unwritten buffers left in memory. As a result, the database could be damaged. Multi-User Operation When you invoke the QUEST procedure in a Multi-User environment (S2KMODE=M), the SAS System responds with these messages: QUEST Ready S2K3212/00 - SYSTEM 2000 INTERACTIVE INTERFACE READY - Issue the USER statement to establish your password and start your SYSTEM 2000 session. For example, the following statements attach the EMPLOYEE database: user,demo; data base name is employee; The SYSTEM 2000 interface to the SAS System accesses the database and displays any output on the output window or in the SAS print file (if you are executing in interactive line mode). Temporary Output File The QUEST procedure uses a disk file to temporarily store output. In CMS, the file is allocated automatically. In TSO, you need to allocate a file with at least ten tracks of 3350 disk space (or the equivalent) with the DDname S2KOUTP. If the file is not allocated, you get a warning message (-895-), and any response from SYSTEM 2000 software that exceeds 4096 bytes will be truncated. Ten tracks of 3350 disk space is enough for typical use. If some output cannot be stored on S2KOUTP, message -897- appears, and you will lose some output. Reallocate the file with more space later. Command File You can save SYSTEM 2000 statements in a file with the SAS Text Editor. You can direct the QUEST procedure to read statements from that file by submitting this statement: local command file is fileref; where fileref is the DDname for the file. However, any SAS macros in the file will not be expanded because the QUEST procedure will submit the statements directly to SYSTEM 2000 software without the SAS System reading them. The following statement lets you continue to submit statements from the PROGRAM EDITOR window; write it at the end of the Command File: LOCAL COMMAND FILE IS INPUT;

118 Multi-User Operation 4 Chapter 9 If you omit this command, the QUEST procedure automatically returns to the PROGRAM EDITOR window when it finds an end-of-file on the Command File. Note: SYSTEM 2000 commands in a Command File must be specified in uppercase or a syntax error will occur. 4 The QUEST procedure allows you to use alternate user files for the Data File, Message File, and Report File also. They can be local files or files allocated in the Multi-User region. Attention Interrupts in TSO If you interrupt processing while running the QUEST procedure under TSO, the usual SAS message (asking whether you want to terminate or continue) is not displayed. Instead, if you interrupt processing while looking at the output screen, the attention interrupt is interpreted to mean that you want to purge any further output. The first line on the next page is displayed, but any further output from your last statement is discarded. If you interrupt processing at any other time, the interrupt is ignored. To cancel the session, you must first terminate the QUEST procedure.

The correct bibliographic citation for this manual is as follows: SAS Institute Inc., SAS/ACCESS Interface to SYSTEM 2000 Data Management Software: Reference, Version 8, Cary, NC: SAS Institute Inc., 1999. SAS/ACCESS Interface to SYSTEM 2000 Data Management Software: Reference, Version 8 Copyright 1999 by SAS Institute Inc., Cary, NC, USA. ISBN 1 58025 549 3 All rights reserved. Printed in the United States of America. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, by any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS Institute, Inc. U.S. Government Restricted Rights Notice. Use, duplication, or disclosure of the software by the government is subject to restrictions as set forth in FAR 52.227 19 Commercial Computer Software-Restricted Rights (June 1987). SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513. 1st printing, October 1999 SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. Other brand and product names are registered trademarks or trademarks of their respective companies. The Institute is a private company devoted to the support and further development of its software and related services.