Sas/Share 9.2: User's Guide
Sas/Share 9.2: User's Guide
2 ®
User’s Guide
®
SAS Documentation
The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2008.
SAS/SHARE ® 9.2 User’s Guide, Cary, NC: SAS Institute Inc.
SAS/SHARE® 9.2 User’s Guide
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA
ISBN 978-1–59994—334-3
All rights reserved. Produced in the United States of America.
For a hard-copy book: No part of this publication may be reproduced, stored in a
retrieval system, or transmitted, in any form or by any means, electronic, mechanical,
photocopying, or otherwise, without the prior written permission of the publisher, SAS
Institute Inc.
For a Web download or e-book: Your use of this publication shall be governed by the
terms established by the vendor at the time you acquire this publication.
U.S. Government Restricted Rights Notice. Use, duplication, or disclosure of this
software and related documentation by the U.S. government is subject to the Agreement
with SAS Institute and the restrictions 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 electronic book, March 2008
SAS® Publishing provides a complete selection of books and electronic products to help
customers use SAS software to its fullest potential. For more information about our
e-books, e-learning products, CDs, and hard-copy books, visit the SAS Publishing Web site
at [Link]/publishing or call 1-800-727-3228.
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.
Contents
PART 1 Usage 1
Chapter 1 4 Getting Started with SAS/SHARE 3
SAS/SHARE: Learning to Use 4
Frequently Asked Questions (FAQs) about SAS/SHARE 13
Appendix 3 4 Tuning Tips for Applications That Use SAS/SHARE Software 211
Authors 212
Introduction to Tuning Tips for Applications That Use SAS/SHARE Software 212
Overview of Tuning Tips for Applications That Use SAS/SHARE Software 212
The SAS Library Model 213
How Data Flows When You Use SAS Files 213
Concurrent Access: Update versus Read-only 215
Computer Resources Used by a Server 216
Minimizing and Optimizing Resource Consumption 220
Using Operating Environment Tools 229
Conclusion 231
vi
Glossary 249
Index 259
vii
What’s New
Overview
SAS/SHARE has the following changes and enhancements in this release:
3 an introduction to the role of SAS/SHARE in a SAS Intelligence Platform
environment, a new system option, and a new option in the LIBNAME statement
3 several new or improved options and a new value for an option in the PROC
SERVER statement
3 a method to free a library that contains a locked data set
3 relocated information about SAS data security technologies
maximum concurrent number of connections from thin clients that access the
SAS/SHARE server.
3 Experimental option THREADEDTCP in the PROC SERVER statement now
enables threaded TCP to be compatible with the collection of active-time usage
statistics.
3 The FILELOCKWAITMAX= system option is set to zero, by default, when the
PROC SERVER statement is used. A SAS session will not wait to access a SAS
file that is currently locked by another process.
3 The NOXCMD system option is enabled, by default, when the PROC SERVER
statement is used to invoke a SAS session. NOXMCD prevents operating system
commands from being executed during a SAS session.
1
P A R T
Usage
CHAPTER
1
Getting Started with SAS/SHARE
Is there a limit on how many users or libraries a SAS/SHARE server can support? 16
Do I need to ask my server administrator to start and stop my application’s server each
day? 16
FAQs by Server Administrators 16
How do I get started with SAS/SHARE software? 16
I’ve used servers before. A SAS/SHARE server is similar to the file servers we have on our
network, isn’t it? 16
Is being a SAS/SHARE server administrator a full-time job? 16
Can a server administrator control access to a server? 17
Can a server administrator control which libraries users can access through a server? 17
How can I terminate a user’s connection to a SAS/SHARE server? 17
How can I stop a SAS/SHARE server? 17
Can a server use more than one communications access method? 17
How can I determine when I need to create a second SAS/SHARE server? 17
Accessibility Features in SAS Products 18
Introduction
If you’re a new user of SAS/SHARE, this section provides answers to frequently
asked questions (FAQs). A step-by-step example exercise shows the different types of
activities that are involved when using SAS/SHARE. Where applicable, operating
environment specifics are provided.
Note: The following exercise is an example only and should not be used to set up
production applications. 4
If you have some experience with SAS/SHARE and choose not to perform this exercise
or read the FAQs, proceed to Chapter 2, “Using SAS/SHARE Software,” on page 19.
Execute the following statement in the server, the client, and the operator
sessions:
%let servername=demoserv;
3 If you do not have authority to edit the SERVICES file, ask your server
administrator to add demoserv to the SERVICES file. A server administrator
ensures that SAS/SHARE servers are identified in the SERVICES file on each
operating environment that accesses SAS/SHARE.
3 The TCP/IP access method allows you to specify syntax that uses two consecutive
underscores with a port number, in place of a server ID that has been defined in
the client TCP/IP SERVICES file. As an alternative to editing the TCP/IP
SERVICES file, execute the following statement in the server, the client, and the
operator sessions:
%let servername=_ _port-number;
for port-number specify a number that is not already used in the TCP/IP
SERVICES file. Do not space after the first underscore or the second underscore.
Note: If you choose to use a communications access method that is different from
TCP/IP, some configuration of your operating environment might be required. For more
information, see Communications Access Methods for SAS/CONNECT and
SAS/SHARE. 4
1 In the SERVER session, submit the following statements from the Program Editor
window:
options comamid=tcp;
libname demo (work);
proc server id=&servername authenticate=optional;
run;
The LIBNAME statement associates a SAS library reference (libref) with a SAS
library.
The omission of the USER= and PASSWORD= options in the LIBNAME
statement means that the SAS/SHARE client/server session is running unsecured.
The COMAMID= option specifies the access method that is used to
communicate between a client SAS session and the server. You must specify the
COMAMID= option before you invoke PROC SERVER.
PROC SERVER manages concurrent update access to SAS libraries and the
members in those libraries. PROC SERVER runs in its own SAS session, which
serves client SAS sessions by executing input and output requests to SAS libraries.
The value OPTIONAL for the AUTHENTICATE= option allows users with valid
access permission to connect to a server without requiring verification. See
“Ensuring That User IDs Are Valid” on page 38. For more information about the
AUTHENTICATE= option, see the PROC SERVER statement.
2 Examine the SERVER Log window, which now contains information similar to this:
4
See the TCP/IP chapter for your specific operating environment in Communications
Access Methods for SAS/CONNECT and SAS/SHARE for more information.
Getting Started with SAS/SHARE 4 Creating a SAS Data Set (All New Users) 7
Examine the USER1 Log window, which contains the following information:
NOTE: Libref DEMO was successfully assigned as follows:
Engine: REMOTE
Physical Name: /local/u/john
1 options comamid=tcp;
2 libname demo server=&servername;
For convenience in this exercise, the libref DEMO is associated with the server
library WORK. In SAS, the default name WORK means that the data files that
are created are temporary.
2 Examine the SERVER Log window, which now contains information similar to the
following lines about your connection to the server. The messages include the
server name, the name of the server library that you specified, and the user
identification in the form user-ID(n), where n is the server connection number.
30Apr2007:15:16:46.521 User john(1) has connected to server demoserv.
30Apr2007:15:16:52.566 User john(1) has created "DMS Process"(1)
under "Kernel"(0).
30Apr2007:15:16:59.079 Server library (’/local/u/john’ V9) accessed as
DEMO by user john(1).
data [Link];
do i=1 to 5;
output;
end;
run;
This DATA step creates a SAS data set that contains five observations and one
variable that you will use in the remainder of this example. The Log window
displays information about the DATA step and the name of the SAS data set that
is opened for output and then closed.
2 Examine the SERVER Log window again.
An FSEDIT window appears in the center of the screen. It shows the value 1 in
the first observation.
i: 1
Examine the USER2 Log window, which contains the following information:
NOTE: Libref DEMO was successfully assigned as follows:
Engine: REMOTE
Physical Name: /local/u/sasvcl
1 options comamid=tcp;
2 libname demo server=shr9;
3 proc fsedit data=[Link];
4 run;
2 Examine the SERVER Log window, to which information similar to the following
lines was added:
30Apr2007:15:29:39.116 User john(2) has connected to server demoserv.
30Apr2007:15:29:42.483 User john(2) has created "Process"(1)
under "Kernel"(0).
30Apr2007:15:29:48.155 Server library (’/local/u/john’ V9) accessed as
DEMO by user john(2).
30Apr2007:15:29:54.124 User john(2) has created "FSEDIT"(2)
under "DMS Process"(1).
30Apr2007:15:29:56.109 [Link](1) opened for input/2 via
engine V9 by "FSEDIT"(2) of user john(2).
30Apr2007:15:29:56.933 [Link](1) reopened for update/R by
"FSEDIT"(2) of user john(2).
The FSEDIT procedure accesses the data set that was created by USER1 in the
previous section. The first observation is currently locked by USER2 for update
access.
3 In the FSEDIT window in the USER2 session, change the value in the first
observation by placing the cursor over the value 1 and typing 5, but do not save it.
The FSEDIT window of USER2 now looks like this:
i: 5
PROC FSEDIT also accesses the data set that was created by USER1.
When the FSEDIT window opens, the following message is displayed because the
first observation is already locked by the PROC FSEDIT statement in USER2’s session:
Getting Started with SAS/SHARE 4 Stopping the Server (All New Users) 9
USER1 cannot update the observation until after USER2 releases it. Notice that the
value of i is still 1 because USER2 did not save the change in the previous step.
Examine the USER1 Log window, which now contains the following information:
16 proc operate server=&servername;
PROC OPERATE is set to default server DEMOSERV.
==================================================
17 stop server;
Default server DEMOSERV is now stopped.
PROC OPERATE was previously set to default server
DEMOSERV but is not set to any server now.
==================================================
18 quit;
10 Identifying the Server (Server Administrators and Applications Developers) 4 Chapter 1
Note: If you are not on the same machine as the server, you must specify the
network node name in the SERVER= option in the PROC OPERATE statement:
proc operate server=network_node_name.&servername;
4
3 In the SERVER Program Editor window, close the server session by submitting
the following:
endsas;
4 On the command lines of both the USER1 and USER2 Program Editor windows,
close the user sessions by issuing the following command:
bye
For SAS/SHARE end users, you have finished the example exercise. See “Frequently
Asked Questions (FAQs) about SAS/SHARE” on page 13.
Examine the USER2 Log window, which contains the following information:
proc operate server=&servername;
PROC OPERATE is set to default server DEMOSERV.
Usually, you should specify the COMAMID= option before using PROC OPERATE to
connect to a server. If you know that you will use the default access method on your
operating environment, you might omit the COMAMID= option. You do not need to
specify a value for the COMAMID= option in this step because it was already specified
for this SAS session in an earlier step. See “Locking an Observation (All New Users)”
on page 8.
In the USER2 session, submit the following from the Program Editor window:
display library _all_;
The DISPLAY LIBRARY command in the PROC OPERATE step displays information
about the libref, status, the number of users, and the library name of all SAS libraries
that have been defined to the server.
Examine the USER2 Log window.
The DISPLAY USER command displays information about the user ID, the status,
and the number of libraries that have been defined by each connected client.
Examine the USER2 Log window, which now contains the following information:
USER NUMBER OF
ID STATUS LIBRARIES
-------------------------------
john ACTIVE 0
john ACTIVE 1
john ACTIVE 1
==============================
7 display user _all_;
2 Examine the SERVER Log window, which displays information similar to the
following:
30Apr2007:15:56:57.207 PROC OPERATE command from user john(3):
QUIESCE USER 1 2;
30Apr2007:15:59:52.065 [Link](1) closed by "FSEDIT"(3)
of user john(1).
30Apr2007:15:00:02.161 User john(1) has terminated "FSEDIT"(3)
(under "DMS Process"(1)).
Examine the USER1 Log window, which contains the following information:
10 proc fsedit data=[Link];
You cannot open data set [Link] because user JOHN(1)
is quiesced on server DEMOSERV.
11 run;
NOTE: The SAS System stopped processing this step because of errors.
The messages in the Log window tell you that the attempt by USER1 to communicate
with the server is rejected. Because USER1 is stopped, you cannot access the data set.
The STOP SERVER command in the PROC OPERATE step terminates a server as
quickly as possible. If users are connected to the server when you execute a STOP
SERVER command, changes that they have not saved are lost. The QUIT command
terminates PROC OPERATE in interactive mode.
2 On the command lines of both the USER1 and USER2 Program Editor windows,
close the user session by submitting the following:
bye
Getting Started with SAS/SHARE 4 General Questions 13
General Questions
The three roles can be performed by the same person, or one person might perform
two roles, or each role might be assigned to a separate group of people.
It’s not unusual for the same person to perform the tasks of an applications developer
and a server administrator, for example, when the person who develops an application
is responsible for the SAS/SHARE server or servers used by that application.
Three people? I hope this software doesn’t require the effort of a large
team of people.
No, three roles. The three roles help organize the efforts so that shared maintenance
of data is possible. In real life, the responsibilities of the various people involved in a
project might overlap. Often, the same person who develops an application also
maintains a SAS/SHARE server.
To help you keep track of how responsibilities usually are divided when multiple
users need to update a SAS file at the same time, the remainder of this section answers
the questions most frequently asked by end users, application developers, and server
administrators.
How can I find out if I’m accessing a SAS library through a SAS/SHARE
server?
The SERVER= option is required in a LIBNAME statement (or, in SCL programs,
any LIBNAME() function) for a library to be accessed through a SAS/SHARE server.
When a library is accessed through a server, the information that is displayed in the
Log window about the LIBNAME statement shows you that the engine that was used
to access the library is named REMOTE, and the physical name is a subdirectory
accessed by the server SAS session.
Use the LIST option in a LIBNAME statement to obtain information about how a
SAS library is defined to a SAS session. This information includes the following:
3 the name of the server through which the library is accessed.
3 the libref used by the server to refer to the library. (This libref might be the same
as or different from the user’s libref for that library.)
3 the engine used in the server SAS session to read and write files in the library.
3 the operating environment and machine type on which the server is running.
Topics of importance for applications developers include SAS library access, locking
data objects, and SAS programming considerations. See Chapter 4, “Writing End-User
Applications to Access Shared Data,” on page 43. For a sample SCL application, see
Appendix 4, “SAS Component Language (SCL) Application,” on page 233. For complete
details about locking, see Chapter 5, “Locking SAS Data Objects,” on page 61.
You might also find helpful information about how server administrators manage
SAS/SHARE servers. See Chapter 3, “Managing a SAS/SHARE Server (Server
Administrators),” on page 29. For specific details about creating a SAS/SHARE server
and setting SAS options to enhance performance and to establish logging parameters,
by operating environment, see Appendix 2, “Creating the SAS/SHARE Server
Environment,” on page 197.
I’ve used servers before. A SAS/SHARE server is similar to the file servers
we have on our network, isn’t it?
Not really. Usually, file servers are not aware of the content of the files they
manage, but a SAS/SHARE server allows several users to update the same copy of a
SAS file at the same time.
SAS/SHARE is tuned to manage locking conflicts within SAS files, such as two users
attempting to update the same observation of a SAS data file or two users attempting
to modify the same entry in a SAS catalog. SAS/SHARE is not optimized to provide the
bulk data transfer services at which many file servers excel.
Do I have to use a different SAS/SHARE server for each file that is updated
by the users of my application?
No. A server can share many files in the same SAS library and in many different
SAS libraries at the same time.
I’ve used servers before. A SAS/SHARE server is similar to the file servers
we have on our network, isn’t it?
Not really. Ordinarily, file servers are not aware of the content of the files they
manage, but a SAS/SHARE server allows several users to update a single copy of a SAS
file at the same time. Also, SAS/SHARE servers automatically translate transmitted
data when the client operating environment represents data differently from the server
operating environment.
Just as you periodically check the resource consumption of the other service processes
on a computer, you should, from time-to-time, consider the amount of CPU, I/O, and
virtual storage the servers are using. Using operating environment management tools,
you might notice that a server is executing a very large number of disk I/O operations
or needs a very high percentage of the processor. When you observe those conditions,
consider moving some of the work from that server to another, possibly new, server.
Distributing the workload among servers must be a cooperative effort between server
administrators and applications developers. SAS provides a set of autocall macros that
assign resources to servers symbolically. These macros can make moving resources from
one server to another much easier. See Chapter 6, “SAS/SHARE Macros for Server
Access,” on page 77.
CHAPTER
2
Using SAS/SHARE Software
3 While one or more users are using the FSEDIT procedure, the FSVIEW procedure
in edit mode, the UPDATE statement in the SQL procedure, or an SCL program to
update a SAS data set, other users can perform the following activities:
3 update the SAS data set by using the MODIFY, REMOVE, or REPLACE
statement in a DATA step
3 read the SAS data set as input data by using the SET statement in a DATA
step
3 add observations to the SAS data set by using the APPEND or SQL
procedure or remove observations by using the SQL procedure
3 copy the SAS data set that is being updated (and copy other members of the
library) into another library by using the COPY or the CATALOG procedure
network. SAS clients use the REMOTE engine to access data through a SAS/SHARE
server.
“Other client” refers to a client that is not a SAS application. For each of these
clients, the appropriate client-side drivers and libraries must be invoked.
Using SAS/SHARE Software 4 Accessing SAS Files through a SAS/SHARE Server 23
In this instance, your operating environment provides two types of access: read-only
and read-write. With read-only access, multiple users can simultaneously read the
same member or different members in the same library.
SAS files that have read-write access are usually associated with only one user.
Some operating environments support only read access to libraries that are accessed
directly by more than one user. Other operating environments permit two users to
write to different files in the same SAS library but do not permit them to write to the
same file simultaneously. Still other operating environments permit multiple users to
write to the same file at the same time, even though doing so is not safe and often
results in lost changes made by one or more users.
The only safe way for more than one user to share a SAS file (and on some operating
environments an entire library) is to use a common third-party process to sequentially
access the low-level parts of the file and coordinate updates to the data. SAS/SHARE is
a product that regulates access to SAS files. For more information about the SAS
library model, see SAS Language Reference: Concepts.
The SAS/SHARE server enables multiple clients to effectively share the same SAS
file at the same time. In this context, “share” means to allow access by multiple clients
to a different unit (for example, an observation) in the same SAS file. In the preceding
figure, Client 1 can read from and write to observation 1, and Client 2 can read from
and write to observation 2 in the same SAS file. Both clients can also read the same
observation at the same time. However, only one client at a time can write to an
observation.
The server enables client access to the lowest unit of the SAS library hierarchy
through its powerful lock manager facility. Locks are applied in either of two ways:
The SAS/SHARE server evaluates each incoming client request to access a specific
SAS library unit (for example, a data library, a data set, or an observation) against a
complex set of locking rules whose application seems transparent to clients. The server
balances the client requests for access to data while ensuring the integrity of that data.
The server grants permission to a qualifying client and denies a conflicting request.
The denied client receives an informational message. For more information about
server locking rules, see Chapter 5, “Locking SAS Data Objects,” on page 61. For
information about the use of the LOCK command and the LOCK statement, see
“Locking Objects Explicitly (LOCK Statement)” on page 65, and “Locking Explicitly in a
SAS Window (LOCK Command)” on page 70.
CAUTION:
Although a SAS/SHARE server can effectively control multi-client access to a SAS library,
independent direct access to the data from other SAS sessions or operating environments
can interfere with the SAS/SHARE server. Simultaneous and unregulated access to a
common SAS library causes unpredictable results and possibly corrupt data. Your
site policies should prohibit unregulated data access. Make sure that your data
access policies are clearly communicated. 4
Using SAS/SHARE Software 4 About the SAS Metadata Repository and the SAS Intelligence Platform 25
About the SAS Metadata Repository and the SAS Intelligence Platform
The SAS Metadata Repository is a collection of files that store metadata that is used
by SAS client applications that are deployed in a SAS Intelligence Platform
environment. Objects that define SAS/SHARE servers and their access to specified SAS
libraries through various engines are examples of metadata that is available to client
applications.
The SAS/SHARE objects that are configured as metadata using the user interface
SAS Management Console are similar to the arguments that can be specified in PROC
SERVER and LIBNAME statements in a SAS/SHARE application. SAS/SHARE
applications that execute in the traditional SAS interactive and batch execution modes
do not typically access and use SAS/SHARE metadata that has been configured in a
SAS Metadata Repository. However, a LIBNAME statement for the METADATA engine
can be used to programmatically access and use SAS/SHARE metadata that is stored in
a SAS Metadata Repository. For details, see SAS Language Interfaces to Metadata.
Also, the AUTHDOMAIN= option in the LIBNAME statement can be used obtain a
user ID and password that is stored in the SAS Metadata Repository. For details, see
AUTHDOMAIN= option on page 125.
For information about SAS/SHARE in a SAS Intelligence Platform environment, see the
SAS Intelligence Platform: Overview. For details about using SAS/SHARE in the
traditional interactive or batch modes, use the information in this document.
26 Configuring a SAS/SHARE Server and Server Libraries in a SAS Intelligence Platform Environment 4 Chapter 2
OPERATE procedure
manages server, library, and client resources. For example, you can allocate a
library to a server, free a library, stop a server, restart a server, and display
information about clients.
REMOTE engine
enables a client SAS session to access SAS data by means of a SAS/SHARE server.
(The REMOTE engine is also licensed and distributed as part of SAS/CONNECT
software.)
The REMOTE engine does not operate directly on files in a SAS library; it
communicates with a SAS/SHARE server. Each client runs a private copy of the
REMOTE engine to communicate with a server.
A server uses one or more library engines or view engines to operate directly on
files in SAS libraries that clients access through the server. The server routes
requests from the REMOTE engine to the appropriate engine for the SAS library
or the file that the client accesses. A server’s default library engine is specified in
the ENGINE= system option. You might override the default and specify another
engine when you start a server. Other engines are documented in the SAS
documentation for your operating environment.
SAS/SHARE Users
SAS/SHARE users are divided into three groups:
End users
update or use concurrently accessed data in other ways. End users might not even
be aware of SAS/SHARE. They just need some basic information about how to
update data sets and search for observations that they want to modify.
Programmers or developers
write applications that use a server to access shared data. They must know how to
define a libref for a SAS library that is accessed through a SAS/SHARE server and
have knowledge of how the server handles locking.
Server administrators
start a server, manage its session, and evaluate its performance. They give a
server access to SAS libraries (taking into account library security) and supply
clients with information to access these libraries. Server administrators also make
a server accessible to clients who have permission to use it. At some sites, a server
administrator might delegate specific functions to other personnel and work with
systems personnel to automate administrative functions.
Note: SAS 9.2 has many of the same features as Version 8, but a SAS 9.2 client
cannot access a SAS 6 server, and a SAS 6 client cannot access a SAS 9.2 server.
Because SAS 8 can communicate with both SAS 6 and SAS 9.2, SAS 8 serves as the
intermediate release. 4
Access to data depends on the following:
3 the SAS data object being accessed (library, file, view, or catalog).
3 the version and release of SAS being used (SAS 6 through SAS 9.2) to create the
data that is being accessed or to develop the client application.
3 the version and release of SAS being used by the client session or by the server
session.
For more information about cross-version issues, see Appendix 5, “SAS/SHARE
Cross-Version Issues, SAS 9.2,” on page 241.
29
CHAPTER
3
Managing a SAS/SHARE Server
(Server Administrators)
3 System resources become overloaded and require that the workload be shifted to a
new server.
If you are a new user of SAS/SHARE, there are various issues to consider as you
fine-tune your server environment, such as system options, predefined libraries, and
automated start-up. However, you might want to defer some of these issues and start a
server right away so that your applications developers can begin to create new
applications or migrate old ones to the multi-user environment.
To get a server started and running with minimal effort, perform the following tasks
in a SAS session on the server machine:
2 Start the server and assign it the name that you just configured. For example,
start a server named SHARE1 as follows:
proc server authenticate=optional id=share1;
run;
The following message appears in the server SAS log with a default time stamp:
30Apr2003:09:47:30.000 SAS server SHARE1 started.
The server SHARE1 can now be used by SAS clients and other clients that are not
SAS applications.
CAUTION:
Here are two limitations to the fast-track approach to starting a server. Server security is
not set. It might be possible for a client that accesses the server to have the same
permissions as the server to access data. Also, any SAS client that can access the
server can manage the server by using PROC OPERATE statements. This means
that a client can stop the server or stop access to any library through the server. For
details about setting server and library security, see “Server Security” on page 36.
If you run a server SAS session interactively, the SAS session assumes that, by
using a dialog box, you can resolve any problems that it encounters. While the SAS
session waits for a response to its query, the server might not be able to continue to
service client requests until the query is answered. However, you might not be aware
that a response is required if the window in which the server is running is not visible
or is not being monitored. Therefore, it is recommended that you specify the SAS
system option NOTERMINAL so that SAS does not display dialog boxes and
performs whatever is required without prompting. 4
For a complete list of valid connections among operating environments and access
methods for SAS/SHARE, see Communications Access Methods for SAS/CONNECT
and SAS/SHARE.
Operating environments and access methods usually require the configuration of
access method resources on the operating environments on which the server will run.
Consult your network administrator about this configuration. For details about
configuring access method resources, see Communications Access Methods for
SAS/CONNECT and SAS/SHARE.
Server administrators should also be aware of special considerations and limitations
when the server is accessed by clients on an operating environment that is different
from that of the server. For information about cross-architecture limitations and
considerations, see Appendix 1, “Cross-Architecture Access,” on page 181.
After you verify that access method resources have been configured but before you
start a server, you must specify the access method by using the following syntax:
OPTIONS COMAMID=access-method;
access-method is the abbreviation for the method that is used by the server to
communicate with a client. In SAS 9.2, the supported access-method identifiers are
TCP/IP and XMS.
For a server that runs under an operating environment on which only one access
method is available, use only the COMAMID option. For example:
options comamid=tcp;
When the server starts, all of the communications access methods are initialized.
The server is simultaneously available to client sessions that use the TCP/IP access
method and to clients that use the XMS access method.
For more information about access methods, see Communications Access Methods for
SAS/CONNECT and SAS/SHARE.
32 Predefining SAS Libraries to the Server 4 Chapter 3
After you define a library to the server, a message is displayed in the SAS log. For
example, here is a message for a server on a UNIX operating environment:
1 libname mylib ’.’;
NOTE: Libref MYLIB was successfully assigned as follows:
Engine: V9
Physical Name: /payroll/div2/emp
CAUTION:
You are discouraged from using the FILELOCKWAIT= option in the LIBNAME statement,
which specifies the maximum length of time that a SAS/SHARE client or server will
wait for a SAS file that has been locked by another process to become available for
use. If the wait time expires before the file becomes available, the SAS/SHARE
request to open the file will fail and a message is written to the log. When using
SAS/SHARE to access SAS files, do not perform additional jobs that might contend
for access to the same files. For details about the FILELOCKWAIT= option in the
Managing a SAS/SHARE Server (Server Administrators) 4 Identifying the Server 33
LIBNAME statement, see the SAS Companion for UNIX Environments or the SAS
Companion for the Microsoft Windows Environment, as appropriate. 4
Note: In addition to these recommended methods, you can also define a libref
externally to SAS. For this information, see the SAS documentation for your operating
environment. 4
Starting a Server
For complete information about the LOG option, see Chapter 9, “The SERVER
Procedure,” on page 107. For a more complete example of a SAS log, see “Usage
Statistics in the Server Log” on page 90.
To charge users for the amount of server resources that they consume, allocate
consumption proportionately according to the usage statistics. You can allocate
consumption based on a single statistic or on a combination of statistics. The most
useful statistics for this purpose are the number of messages that are processed, the
number of bytes that are transferred, and the amount of active time used.
You might need to experiment with the relative weights of these statistics in your
charge-back formula. These statistics are sensitive to the specific operating
environment, access method, level of server activity, and types of applications.
The number of messages that are processed represents actual, billable work by the
server. When used together, the MESSAGE, BYTECOUNT, and ACTIVETIME values
in the LOG= option report data that characterizes the work that a user asked the
server to perform. Here are some examples:
3 Small BYTECOUNT and MESSAGE values and a large ACTIVETIME value
might indicate that a small amount of data was selected from a large file by
sequentially searching the file or by interpreting a complex view.
3 Moderate or large BYTECOUNT values and a large MESSAGE value might
indicate that a small amount of data is being read by the user on each message
that is exchanged with the server. This might be caused by random access or
exceptionally long observations and might suggest taking a snapshot of the data
for the user’s analysis.
3 Small ACTIVETIME values and a large BYTECOUNT value suggest that the user
is exchanging data “in bulk” with the server. Usually, that does not indicate a
problem, but if the server is overloaded, you might want to suggest that the user
try another bulk-data transfer technique.
When you invoke SAS on the computer on which the SAS/SHARE server will run,
you can negate the possibility of a stalled server by explicitly setting the maximum wait
time to zero. This value will override the value that the client specifies for the
FILELOCKWAIT= option in the LIBNAME statement.
c:\Program Files\SAS2\SASFoundation\9.2\[Link] -dmr -noterminal
-nosyntaxcheck -sasuser work -icon -nosplash -filelockwaitmax=0
Server Security
You can also specify an administrator password in each PROC OPERATE server
management command. For details, see “Displaying Information about a Server” on
page 140.
reason, you might want to set server security to prevent unauthorized access to data
through the server by using one or more of the following:
3 assigning a single password on the server
3 limiting which libraries the server can access
3 setting passwords for SAS data sets, views, and catalogs
3 placing operating environment or file system protections on libraries and data sets
3 requiring user ID validation
When a user specifies the server for the first time in a LIBNAME statement or in a
PROC SQL CONNECT TO statement, use the SAPW= option to specify the user
password. Here is an example:
libname invoice server=share1 sapw=hotwings;
statement. For more information about setting options in the PROC SERVER
statement, see Chapter 9, “The SERVER Procedure,” on page 107. For more information
about user IDs and passwords, see “LIBNAME Statement” on page 123, “Syntax: RSPT
SQL Procedure” on page 151, or Chapter 11, “The OPERATE Procedure,” on page 133.
In order to validate a user ID, most access methods require using an access
method-specific mechanism to provide the user ID and corresponding password for the
server operating environment. The access method encrypts the user ID and password
and transmits them to the server session to be validated. For information about the
mechanisms that control whether an access method validates connecting users and the
mechanisms by which users can provide their user IDs and passwords, see
Communications Access Methods for SAS/CONNECT and SAS/SHARE.
On most operating environments, to validate a user ID and to verify access
permissions, a SAS/SHARE server calls the operating environment or the file system
directly. Under UNIX, the server performs these functions by calling an external
program (that is, not a SAS application) that you can modify.
LOG
Command ===>
NUMBER OF
USER ID STATUS LIBRARIES
----------------------------------
john(1) ACTIVE 1
maria(2) ACTIVE 2
myid(3) ACTIVE 0
======================================================================
3 stop user maria;
User maria(2) stopped from active state.
User maria is now disallowed from connecting to server SHARE1.
======================================================================
4 display user maria;
NUMBER OF
USER ID STATUS LIBRARIES
----------------------------------
maria(2) STOPPED 0
======================================================================
5 quiesce user 1;
User john(1) quiesced from active state.
======================================================================
6 display user 1;
NUMBER OF
USER ID STATUS LIBRARIES
----------------------------------
john(1) QUIESCED 1
2 The DISPLAY USER command requests general information about all users who
are currently accessing SHARE1. The users are listed by user ID, current status,
and the number of library assignments to the server.
3 The STOP USER command immediately disconnects user MARIA(2) from the
server. If Maria is using the FSEDIT procedure to update an observation when the
STOP command is issued, she loses the updates on her display, but she does not
lose previous updates. The STOP USER command terminates all attachments to
that server, and she is prohibited from accessing that server until the
administrator issues a START USER command.
Managing a SAS/SHARE Server (Server Administrators) 4 Freeing a Library that Contains a Locked Data Set 41
4 The DISPLAY USER command shows Maria’s current status. No libraries are
listed for Maria because the STOP USER command released them.
5 The QUIESCE USER command gradually terminates user JOHN(1), which allows
John to finish work in the data sets that he currently has open.
6 The subsequent DISPLAY USER command reports that John is still accessing
member USAGE in library DATALIB. When John closes USAGE in that library,
the server releases the library and disconnects John. Because John’s session was
quiesced by its connect number, John can reconnect to the server when he wants
to. He receives a new connection number at that time.
7 The START USER command allows Maria to access the server again. Note that
the START USER command does not establish a communication path between the
server and Maria. It only enables Maria to re-establish a path by using a
LIBNAME statement or an SQL CONNECT TO statement. She must explicitly
re-access the server.
8 The QUIT statement terminates PROC OPERATE.
CHAPTER
4
Writing End-User Applications to
Access Shared Data
Introduction
The information in this section is primarily directed to applications developers.
However, server administrators and end users might also find it of interest. For more
information about programming techniques and adjusting SAS system option values to
improve the performance of your client/server applications, see Appendix 3, “Tuning
Tips for Applications That Use SAS/SHARE Software,” on page 211.
44 Using the LIBNAME Statement 4 Chapter 4
If the library is predefined to the server by a server administrator, you can omit the
pathname and use only the libref, which is defined for the library in the server SAS
session, to identify the library. Omitting the pathname protects your application if the
pathname for the library has changed.
In the following example, the REMOTE engine and the server assume that the libref
(invdata), which you defined for your SAS session, is the same libref that is defined by
the server administrator in the server SAS session.
libname invdata server=share1;
If the library is predefined to the server but you want to define a libref that is
different from the one that is defined in the server SAS session, use the SLIBREF=
option in the LIBNAME statement to specify a newly defined server libref, as shown in
the following example. However, if a server runs with the option NOALLOC in effect,
all libraries that are accessed through that server must be predefined by the server
administrator.
libname invoice server=share1 slibref=invdata;
For details about the LIBNAME statement syntax, see Chapter 10, “Remote Library
Services,” on page 123.
The SHRMACS macro generates and compiles other SAS/SHARE macros and builds
the SAS server-alias and library-alias tables in which server libraries are registered.
Writing End-User Applications to Access Shared Data 4 DATA Step Processing 45
To invoke the LIBDEF macro, specify the libref and the optional server library. Here
is an example:
%libdef(datalib<,SAS-data-library>);
For more information about using the LIBDEF macro, see “Generating a LIBNAME
Statement By Using the LIBDEF Macro” on page 86. For complete details about macro
syntax, see Chapter 14, “SAS/SHARE Macros,” on page 163. Contact your server
administrator for information about how the macros and tables are implemented and
how they are used at your site.
data composit;
merge [Link] fuel96;
run;
46 DATA Step Processing 4 Chapter 4
If John uses a SET statement to read [Link], he cannot specify the KEY=
or POINT= option unless he overrides the member-level control. By default,
member-level control is required when either of these options are included in a SET
statement. Here’s an example.
data pressure;
set fuel (keep=fuel maxpress);
set [Link] (cntllev=rec) key=fuel;
...
run;
John cannot create a new version of [Link], but he can use a MODIFY
statement in a DATA step to update the shared data set. Here’s an example.
data [Link];
modify [Link];
if (grade=’03N’) then
do;
grade=’3Np’;
revised=today();
replace [Link];
end;
run;
When John uses the preceding DATA step to update an observation that Maria is
editing in her FSEDIT window, the replace operation for that observation fails because
Maria has the observation locked. This failure causes the DATA step to terminate as
soon as the locked observation is encountered. However, any observations that are
updated before the termination retain their updated values.
For applications that update shared data by using a MODIFY statement, it is very
important to include error-checking statements to prevent failure in the updating
process and premature termination. The automatic variable _IORC_ includes the
return codes from the read operation (performed by the MODIFY statement) and the
update operations (performed by the REPLACE, OUTPUT, and REMOVE statements).
The preceding DATA step would be more effective if it was written as follows:
data [Link];
modify [Link];
if (grade=’03N’) then
if (_iorc_ = 0) then
/* read with lock for successful update */
do;
grade=’3Np’;
revised=today();
replace [Link];
end;
else
put ’Observation’ _n_
Writing End-User Applications to Access Shared Data 4 Using Ordered Data in a Shared Environment 47
The preceding DATA step checks the value of _IORC_ to determine whether a
warning or an error condition occurred while reading an observation in
[Link]. If the observation was read successfully, it can be replaced. If the
observation could not be read, a message is written to the SAS log to record the failure
and to identify the observation that was not updated.
To check for specific values of _IORC_, use the SYSRC macro. For example:
data [Link];
modify [Link];
if (grade=’03N’) then
if (_iorc_ = 0) then
/* read with lock for successful update */
do;
grade=’3Np’;
revised=today();
replace [Link];
end;
else if (_iorc_ = %sysrc(_SWNOUPD)) then
put ’Observation’ _n_
’(fuel’ fuel ’) was not replaced.’;
else
put ’Observation’ _n_
’(fuel’ fuel ’) read with rc’ _iorc_;
run;
For complete information about the MODIFY statement, see SAS Language
Reference: Dictionary. For information about the SYSRC macro and _IORC_ return
code checking, see SAS Macro Language: Reference.
usually increase the amount of physical I/O that is performed by the server for each
user.
Reporting applications frequently read the data of one or more shared data sets,
capturing the data as it is at that moment, and develop a report from that data. If the
application uses a BY statement to return the data in sorted order, the server’s
performance can vary greatly while the data is being read. The server’s performance is
based on multiple factors, such as whether the BY variable is indexed, and whether
options are added to the BY statement that result in the index not being used.
To optimize the server’s performance, the server needs to read the data in its
physical, unsorted order, and then sort the data in the SAS process that is used to
produce the report. You can do this by using the SORT procedure to read the data in
physical order through the server, and produce a sorted data file in your library WORK.
Here’s an example.
proc sort data=[Link] out=fuel;
by area;
run;
Alternatively, you can use the SQL procedure to create a temporary SAS data file
and sort it by using an ORDER BY clause. Here’s an example.
proc sql;
create table fuel as
select * from [Link]
order by area;
Defining more indexes than are necessary on shared SAS data sets can increase the
amount of memory that a server needs. Avoid defining indexes that will not be used by
your applications when they access shared data sets through a server.
put "SYSLCKRC=&SYSLCKRC";
if "&SYSLCKRC" ^= ’0’ then
abort return;
run;
data permlib.a;
drop now;
retain now;
if (_N_=1) then now=today();
set [Link];
if (accdate<(now− 30)) then output permlib.a;
run;
proc sql;
delete from [Link] where (accdate<(today()− 30));
quit;
client in order for the summary functions AVG() and FREQ() to be applied to them.
However, you might specify the statement as follows:
select * from connection to remote
(select emptitle as title,
avg(empyears), freq(empnum)
from [Link]
group by title
order by title);
In this case, the query is passed through the SAS/SHARE server to the SAS SQL
processor, which processes each row in the table EMPLOYEE and returns only the
summary rows to your client.
You can also use RSPT to join server data with client data. For example, you might
specify the statement as follows:
libname mylib ’c:\sales’;
proc sql;
connect to remote (server=mvs.shr1 dbms=db2
dbmsarg=(ssid=db2p));
In this case, the subquery against the DB2 data is sent through the SAS/SHARE server
to the DB2 server. The rows for the divisions in the Southeast region are returned to
your SAS/SHARE client, where they are joined with the corresponding rows from the
client data set MYLIB.SALES97.
If your server is a SAS/CONNECT server, you can also use RSPT to send non-query
SQL statements to a DBMS. For example, the following statements send the DELETE
statement in PROC SQL through the SAS/SHARE server to the Oracle server.
proc sql;
connect to remote (server=sunserv dbms=oracle);
update. You can open other data tables for update by using other invocations of the first
SCL application, using a different SAS application or SCL application, or using the
FSEDIT or FSVIEW procedure on the table.
Consider the following issues when writing an SCL application that updates data
concurrently:
3 locking rows in SAS tables
3 implications of locking rows in SCL
3 programming in PROC FSEDIT and PROC FSBROWSE
3 locating and fetching control rows
3 unlocking a row
For an application that uses SAS tables that contain inventory and ordering
information for each product in a store, see Appendix 4, “SAS Component Language
(SCL) Application,” on page 233. The purpose of the application is to automate a system
that develops orders and maintains the inventory list while sales representatives
simultaneously write orders for products.
update was successful. The return value, which is generated by the macro invocation
%SYSRC(_SWNOUPD), is generated when a fetch or update function fails to lock or
update the row because it is locked by another application.
The FETCHOBS table function is useful when the row number can serve as the row
identifier. Remember that the FETCHOBS function accepts a relative row number by
default. That number might or might not equate to the physical row number. If you can
delete rows in the auxiliary table, you probably want to use the ABS option in the
FETCHOBS function for absolute row numbering.
The LOCATEC and LOCATEN table functions can be useful for finding rows in small
tables when the data can remain sorted by a unique identifier (column) and a binary
search is specified. However, due to the overhead of searching with these SCL functions,
it is better to use the WHERE and FETCH functions to find the rows. In a shared-data
environment, when you use the LOCATEC and LOCATEN functions to find rows, each
row must be requested from the server and transmitted to the client’s SAS session.
The SYSRC function must be queried for warnings when the LOCATEC and
LOCATEN functions find a row because these functions only return a return code of 0
for either condition: row found or row not found. For more information about the
LOCATEC and LOCATEN functions, see SAS Component Language: Reference. The
following SCL program example checks whether the located row is locked by another
task:
gotrec=locatec(data-set-id,var-num,search-string,
sort-order);
if (gotrec<=0) then do;
/* Handle row not found */
end;
else if (sysrc()=%sysrc(_swnoupd)) then do;
/* Handle row locked */
end;
Note: The LOCATEC and LOCATEN functions cannot perform binary searches on
compressed tables, SAS data views, or SAS data files that have deleted rows. 4
The more general and, usually, more efficient way to find a row is to use the
WHERE function followed by a FETCH function call. The WHERE clause is evaluated
in the server’s SAS session, and only the row that needs the specifications in the
WHERE clause is transmitted to the client’s SAS session.
If the WHERE clause does not find the specified row, the FETCH function returns a
−1 return code, which indicates that the end of the table has been reached. If the
WHERE clause is cleared by issuing a null WHERE function call, the next FETCH call
that the application issues fetches the first row in the table. The FETCH call, not the
WHERE clause, locks the row (if possible). Notice that the WHERE function returns a
harmless warning, %SYSRC(_SWWREP), when the WHERE clause is replaced.
The DATALISTC and DATALISTN selection-list functions help a client to select a
valid row. These functions actually fetch the entire selected row into the Table Data
Vector (DDV) and lock the row (if possible). Because these functions do not return a
system return code, the SYSRC function must be queried for warnings. The
DATALISTC and DATALISTN functions might cause the entire SAS table to be read,
which means that each row that is read is transferred individually from the server to
the client SAS session.
54 Unlocking Rows 4 Chapter 4
Unlocking Rows
In addition to releasing a lock on the current row by reading another row, an SCL
application can use the SCL function UNLOCK. The UNLOCK function leaves the
read-pointer at its current position in the table and does not update the DDV.
The OBSINFO function in SCL returns information about the primary table’s current
row in an FSEDIT application. You can query whether the row has been deleted, locked,
or newly created. A row does not attain deleted status until the DELETE command is
run on the client. For example, if you specified the CONTROL ENTER statement to
force your MAIN section to run, the OBSINFO function will not return a deleted status
when issued from the MAIN section (because the DELETE command that was executed
on the client has caused MAIN to be run.) However, the OBSINFO function will return
a deleted status when the MAIN statement or TERM section is run again.
For DATA step views, “accessible” means that any external file (or files) must be
available and that any filerefs and librefs that are stored in the view must be defined in
the SAS session in which the view is interpreted.
For PROC SQL views, “accessible” means that all librefs that are used in the view
must be predefined in the SAS session in which the view is interpreted, or included in
the USING clause of the query that is stored in the view. This libref can be associated
with a SAS library that is accessed through a server or a library that is stored at the
client. You do not have to specify a libref in a PROC SQL view for data sets that are in
the same data library as the view itself.
For PROC ACCESS views, “accessible” means that the interface product and its data,
as well as the SAS/ACCESS interface view engine, must be available to the SAS session
in which the view is interpreted.
Where SAS data views should be interpreted in a shared environment is based on
the following:
3 how the view was created
3 how the view’s data will be used
3 specific site considerations
Is the underlying data accessible? If the data is accessible only from one of the
sessions, the view must be interpreted there.
If the data is accessible from the client session and the server session, then
performance must be a consideration. If interpreting the view requires the SAS session
to read a large number of rows in order to select a small subset, having the
SAS/SHARE server interpret the view greatly reduces the number of records that are
transmitted to the client session. This method reduces network load and might be
faster than having the client session interpret the view. However, putting a heavy
processing load on the server (especially if joins are involved) might adversely affect
server performance for other clients.
If the view selects most of the input rows or if the selection criteria are processed by
a DBMS server, interpreting the view in the client session is probably preferable.
data [Link];
do key = 1 to 100000;
var = ’Original Value’ ;
output;
end;
array othervars {20};
run;
The following program creates a transaction data set, which PROC APPEND adds to
the master data set that is located on the server:
data transactions;
do key = 100001 to 200000 by 10;
var = ’New Value: ’||put(key,z6.);
output;
56 Example: Improving the Performance of PROC APPEND 4 Chapter 4
end;
run;
With the following changes to the preceding code, append processing can be shifted to
a SAS/SHARE server.
Note: When using a SAS/SHARE server, you will see performance gains increase as
the size of the transaction data set increases. 4
The SAS DATA step view can be created and stored on the server before the view is
actually used. In order to create the view, a copy of the transactions data set (in this
example, [Link]) must be available as a “template” for the expected
contents (for example, variables and variable length). The template does not have to
contain any observations.
Writing End-User Applications to Access Shared Data 4 Example: Improving the Performance of PROC APPEND 57
data [Link];
do key = 100001 to 200000 by 10;
var = ’New Value: ’||put(key,z6.);
output;
end;
run;
The following DATA step now references the view that is located on the server and
causes the view to be interpreted and run on the server:
data _null_;
set share.append_view;
run;
After the initial setup of the DATA step view, future production runs that use the
"append" view might appear as follows:
libname share ’’ server=shr1;
libname swork slibref=work server=shr1;
data [Link];
do key = 100001 to 200000 by 10;
var = ’New Value: ’||put(key,z6.);
output;
end;
run;
data _null_;
set share.append_view;
run;
Although there are several ways to create SAS DATA step views in order to improve
the performance of the update process when using a SAS/SHARE server, the preceding
example shows a simple way to create views. The update process can be improved by
using the MODIFY statement in a DATA step view that gets interpreted at the server.
Note: You should consider the advantages and disadvantages of using the MODIFY
statement to create views. A primary advantage is that the MODIFY statement allows
locking at the observation level rather than at the member level. Locking at the
observation level is less restrictive than locking at the member level. However, the
MODIFY statement is not the most efficient query technique. 4
58 Using SAS Catalog Entries in Programs 4 Chapter 4
Table 4.1 Catalog Entry Types That Cannot Be Accessed through a SAS/SHARE
Server
AFCBT MODEL
AFGO MSYMTAB
AFPGM OLDMACRO
ENGINE PROFILE
GEDIT STATGRAP
GLOBAL TITLE
GOPTIONS WSAVE
Full access to all other types of entries is supported through a SAS/SHARE server.
You can obtain exclusive access to a catalog or to individual entries (other than the
types shown in Table 4.1 on page 58) by using the LOCK statement or the LOCK
command to lock the catalog or catalog entries. See Chapter 5, “Locking SAS Data
Objects,” on page 61 and Chapter 13, “The LOCK Statement and the LOCK Command,”
on page 159. You can also lock a catalog or catalog entry by using the SCL function
LOCK. See the LOCK function in SAS Component Language: Reference.
The LIBNAME statement identifies DATALIB as the library to access through the
same server that John and Maria are using. Your SAS/CONNECT server session
connects to the SAS/SHARE server and executes the PRINT procedure to produce the
report. The report is displayed at your client session. Except for some interactive
limitations that are imposed by SAS/CONNECT, you can remotely submit the same
SAS program statements to read from or write to the same data in DATALIB that other
users work on when they log on directly to the server.
CAUTION:
Do not remote submit the SERVER procedure when using SAS/CONNECT. 4
60
61
CHAPTER
5
Locking SAS Data Objects
The SAS/SHARE lock manager facility enables multiple clients to share the same
SAS file concurrently. Using a set of complex locking rules, the lock manager evaluates
each incoming client request for access to SAS data objects while monitoring the status
of all other client activities. The lock manager grants access to a specific data object by
locking the data object, and denies all other requests for the locked data object until an
operation has been executed or the lock has been cleared explicitly.
62 Locking and SAS Data Object Hierarchy 4 Chapter 5
u SAS library is a collection of one or more SAS files that are recognized by SAS.
Each file is a member of the library.
v Member is a file in a SAS library that can be a SAS data file, a SAS data
view, a SAS utility file, or a SAS data catalog.
Locking SAS Data Objects 4 Accessing and Using SAS Data Objects 63
The lowest hierarchical level at which data can be locked varies according to the
engine that is used to access the data.
3 V8 and V9 (the default) engines allow locking at the library, member, and
observation level.
3 The V8TAPE engine, V9TAPE engine, and other sequential engines allow locking
only at and above the member level.
3 If an engine does not allow access to SAS catalogs, that engine does not allow
locking at any level.
3 The view engine default-locking action is based on how the view is created, that is
by using a DATA step, PROC SQL, or PROC ACCESS (available in SAS/ACCESS).
The specific SAS/ACCESS engine that is used is based on the DBMS. See the
SAS/ACCESS documentation for information about view engine default-locking
action.
Table 5.1 on page 64 shows the combinations of objects that are locked, how objects
are locked, and the effects on other client operations.
Member Other operations can read No other operations can No other operations can
the data set but cannot access the data set. access the data set.
open it for update or output.
Observation Other operations can read Other operations can read or No other operations can
or update the data set but update the data set but access the data set.
cannot open it for output. cannot open it for output.
Types of Locks
The following types of locks can be used on a data object:
explicit lock
is set with the LOCK statement or the LOCK command for exclusive access to the
data object type. The action of the LOCK statement or the LOCK command is
restricted by the server engine, the object that is being accessed, and the way that
the object is accessed (for example, a data set is locked for writing). For details,
see Chapter 13, “The LOCK Statement and the LOCK Command,” on page 159.
implicit lock
is automatically set on the data object type as required by the SAS operation that
is being executed. Each SAS operation has default locking requirements that are
affected by two factors: the data object that is being accessed and the way that the
object is accessed. For example, a DATA step that includes a MODIFY statement
accesses an observation for update, by default.
Regardless of the type of lock that is attempted, in order to lock a selected data
object, the server must lock preceding levels of the hierarchy, as needed. This type of
lock is also referred to as an implicit lock.
When you specify a data object in a LOCK statement, you set an explicit lock on that
object. If you lock a lower-level object without explicitly locking the higher level or
levels, SAS locks the higher level (or levels) automatically.
Locking SAS Data Objects 4 Syntax for the LOCK Statement 65
For example, when you explicitly lock a SAS data set (lower-level lock) but not the
SAS library (higher-level lock) that contains it, the data library is locked implicitly. An
implicit lock allows other users to access the locked data library, even though you have
exclusive access to the locked data set.
entry-name
is the name of the catalog entry to be locked.
entry-type
is the type of the catalog entry to be locked.
LIST
writes to the SAS log whether the specified data object is locked and by whom.
This argument is optional.
CLEAR
releases a lock on the specified data object that was acquired in your SAS session
by using the LOCK statement. This argument is optional.
For details about releasing locks, see “Clearing an Explicit Lock” on page 67.
Locking a library prevents other users from reading, updating, or deleting existing
SAS files in the library or from creating new SAS files in the library. The lock also
prevents other users from obtaining a list of files in the library. It does not prevent
users from issuing LIBNAME statements to access the library, but it does prevent them
from accessing SAS files in the library while it is locked.
Locking a SAS data set (that is, a SAS data file or a SAS data view) prevents other
users from creating, reading, updating, deleting, or renaming a SAS data file and from
creating, reading, deleting, renaming, or interpreting a SAS data view.
Beginning with SAS 6.06, a SAS data set can be either a SAS data file (member type
DATA) or a SAS data view (member type VIEW). In most SAS programs, it does not
matter whether the data comes from a SAS data file or a data view.
Because of this transparency in users’ SAS programs, it is important that a SAS data
file and a SAS data view that have the same name be locked at the same time.
Therefore, when you execute the LOCK statement on one of these data sets, both of
them are automatically locked. In the statements given at the beginning of this section,
the server locks the SAS data file [Link] and the SAS data view
[Link] concurrently. For more information about SAS data sets, see SAS
Language Reference: Concepts.
CAUTION:
The LOCK statement does not lock the source data of a data view. The LOCK statement
does not prevent a SAS data view’s underlying SAS file (or files) from being read or
updated by a SAS library engine or by a SAS view engine when a different view is
interpreted in the server session. 4
Locking SAS Data Objects 4 Clearing an Explicit Lock 67
Locking a member of type CATALOG prevents other users from creating, deleting, or
renaming the catalog, or listing the entries in the catalog. It also prevents creating,
reading, updating, deleting, or renaming any of the entries in the catalog by other users.
While your SAS catalog or catalogs are locked, you can update an application that
uses many different catalog entries. For example, you can execute LOCK statements to
ensure exclusive access to the catalogs that contain your application’s entries. This
ensures that no other users are executing your application while you are updating its
entries. After you have updated all the entries and tested your application, you can
clear the lock by using the argument CLEAR in a LOCK statement. This allows other
users to gain access to your catalogs and to execute your application. For more
information, see “Clearing an Explicit Lock” on page 67.
Locking an entry in a catalog prevents other users from creating, reading, updating,
or deleting that entry.
The first LOCK statement in the preceding example sets implicit locks on the SAS
library EDUCLIB and on the SAS catalog [Link]. Then it sets an explicit
lock on the catalog entry [Link]. Because the user
already has implicit locks on the catalog and library, the second LOCK statement does
not set additional implicit locks before it sets an explicit lock on the catalog entry
[Link].
The first LOCK statement that contains the argument CLEAR releases the explicit
lock on the catalog entry [Link], but it does not clear the implicit locks
because an entry in the catalog is still locked. The second LOCK statement that
contains the argument CLEAR releases the explicit lock on the catalog entry
[Link]. Because no catalog entries remain locked, the argument CLEAR
releases the implicit lock on the SAS catalog [Link]. Also, because no
members of the library are locked, this argument clears the implicit lock on the SAS
library EDUCLIB.
The first LOCK statement in the preceding example sets implicit locks on the SAS
library EDUCLIB and on the SAS catalog [Link]. Then it sets an explicit
lock on the catalog entry [Link]. Because the user
already has implicit locks on the catalog and the library, the second LOCK statement
does not set additional implicit locks before it sets an explicit lock on the catalog entry
[Link].
The LOCK statement that contains the argument CLEAR releases the explicit locks
on both catalog entries and clears the implicit lock on the SAS catalog. Because no
members of the library remain locked, this argument also clears the implicit lock on the
SAS library.
If one of your co-workers needs to work on some SAS files in the library EDUCLIB
that you are not updating, you can lock the SAS files in the library EDUCLIB that you
need, by using the following statements:
lock [Link];
lock educlib.mydata1;
lock educlib.mydata2;
Then, use the following statement to clear your explicit lock on the library to allow
your co-worker to use other members of the library:
lock educlib clear;
You retain an implicit lock on the library because you hold explicit locks on three
SAS files in the library.
You continue to update entries in the SAS catalog [Link] and the SAS
data sets EDUCLIB.MYDATA1 and EDUCLIB.MYDATA2 that you have locked. After
you finish your updates, you can issue one LOCK statement to clear your explicit locks
on the three library members and your implicit lock on the library, as follows:
lock educlib clear;
In this example, because two users are already accessing the MYCAT member in the
MYLIB library, you can infer that no locks have been set on the catalog, and that users
are reading catalog entries or adding entries to the catalog. Although you can browse
70 Return Codes for the LOCK Statement 4 Chapter 5
the catalog or add entries to the catalog, you cannot attempt to lock the catalog until
there are no others using it.
NOTE: [Link] is not locked or in use by you,
but is in use by 2 other users of this server.
The catalog entry MYCATENTRY of type CMAP in the catalog [Link] is not
locked by user SASUSER(1). This message results when user SASUSER attempts to
unlock a catalog entry that another client has locked.
NOTE: [Link] is not locked by sasuser(1).
The following LOCK statement lists in the SAS log whether a specified data object is
locked and by whom. The format used in the LOCK statement for listing lock status is
data-object is status by whom
The SAS macro variable SYSLCKRC contains the return code from a LOCK statement.
A non-zero value in SYSLCKRC results when you use a LOCK statement with the
argument LIST to list a lock.
If you omit member-type or if you specify either the value DATA or VIEW, two
locks are obtained automatically: one on [Link] and one on
[Link].
[Link]-type
is the name and type of the SAS catalog entry to be locked.
LIST
writes to the SAS log whether the specified data object is locked and by whom.
This argument is optional.
CLEAR
releases a lock on a specified data object that was acquired in your SAS session by
using the LOCK command. This argument is optional.
For details about releasing locks, see “Clearing an Explicit Lock” on page 67.
LOG
Command ===>
PROGRAM EDITOR
Command ===> LOCK [Link]
00001
00002
00003
00004
00005
00006
Output 5.2 shows a LOCK command that contains the argument CLEAR to release
the lock on the catalog [Link].
72 How Implicit Locking Works in SAS Program Steps 4 Chapter 5
PROGRAM EDITOR
Command ===> LOCK [Link] CLEAR
00001
00002
00003
00004
00005
00006
Output 5.3 SAS Log Message after the Lock Has Been Cleared
LOG
Command ===>
Command ===>
For details about error message formats, see “Listing Lock Status” on page 69 .
Because the OUT= option is not specified in the PROC SORT statement, the process
defaults to the data set named by the DATA= option and the SORT procedure tries to
replace the SAS data set. However, because Maria’s FSEDIT session has the data set
open for update, the SORT procedure cannot open it for output.
The SAS log shows that the PROC PRINT step executes because the PRINT
procedure opens its input data set with observation-level control. However, the PRINT
procedure terminates prematurely because the data set is not sorted correctly. Notice
that even if the data set were in sorted order when John terminated PROC FSEDIT,
Maria could have changed the value of AREA in one or more observations so that the
data set would not be sorted correctly when the PRINT procedure executed.
To avoid the conflict and ensure that John gets the report he wants, John can use the
OUT= option to write a copy of the sorted data set into his WORK library, as shown in
the following example:
proc sort data=[Link] out=fuel;
by area;
run;
The preceding PROC SORT statement opens the data set [Link] only for
input with observation-level control. Then John can use the PRINT procedure to
display the temporary data set [Link].
SAS Operation What the Data Object Is Locked The Data Object
For Locked (Default)
DATA step
DATA statement
SET statement
without POINT= and KEY= options Input Observation
MODIFY statement
without POINT= and KEY= options Update Observation
Procedures
APPEND procedure
BASE= option Update Member* or
observation
COPY procedure
IN= option Input Observation
FSBROWSE procedure
DATA= option Input Observation
FSEDIT procedure
FSVIEW procedure
DATA= option without EDIT option Input Observation
PRINT procedure
SQL procedure
Locking SAS Data Objects 4 Changing the Data Set Option Default Object 75
SAS Operation What the Data Object Is Locked The Data Object
For Locked (Default)
* If no other tasks are currently accessing the BASE= data set, then PROC APPEND opens the data set with a
member lock.
Note: If you make this change, the values in a specific observation might differ each
time that you read the observation. 4
You can also change the data object observation to member. You might do this to
ensure that a data set does not change while you are processing it. For example, if you
use a SET statement with a BY statement and you cannot use an index to retrieve the
observations in sorted order, you can use the CNTLLEV= option to reset the data object
observation to member.
set [Link] (cntllev=mem);
by area;
In some SAS operations, you cannot override the default setting because the
statement or the command requires it. For example, a DATA statement requires a
member setting when the MODIFY statement is omitted from the DATA step. Without
the MODIFY statement, the data set that is specified in the DATA statement must be
opened for output. Therefore, even if you specify CNTLLEV=REC in such a DATA
statement, the DATA step tries to set the data object as member, but this will fail if
other operations are accessing the data set.
Note: Be careful when using the CNTLLEV= option in a procedure. Some
procedures make multiple passes through an input data set and require that the data
remains the same to guarantee the integrity of the output. If a procedure has this
requirement, a warning is issued but the procedure will allow its objects to be reset if
you use the CNTLLEV= option. 4
For details about the syntax of the CNTLLEV= option in the SET statement, see the
CNTLLEV= data set option in SAS Language Reference: Dictionary.
76
77
CHAPTER
6
SAS/SHARE Macros for Server
Access
the servers. They want to be able to switch libraries and users from one server to
another quickly and easily. To balance the needs of both administrators and users,
SAS/SHARE includes macros to be defined through the autocall function of the SAS
macro facility.
These SAS/SHARE macros enable the administrator to define aliases for a server
and to associate an alias with a specific library. Programs issue these macros to
generate the requisite LIBNAME statements for accessing that library through the
server that is associated with the alias. Then, the administrator can add servers,
change server IDs, and switch libraries and users from one server to another with a
process that is totally transparent to the program or the SAS user.
SAS/SHARE macros can be used to do the following:
3 generate and display the tables of macro variables that associate libraries with
server aliases and server aliases with server IDs
3 generate part or all of a LIBNAME statement
3 start and stop servers
3 generate PROC OPERATE and SET SERVER statements
The server ID that is associated with an alias can be changed during any appropriate
server or application outage (for example, down time). You update only the file that
contains the table of macro variables that maps aliases to server IDs. Additionally, a
library can be logically associated with a different server by updating the table that
associates libraries with server aliases.
For example, a site might have four logical servers (that is, four different server
aliases) but only one physical server by having all the aliases map to the same server
ID. Whenever the load on that one server gets too heavy, the site can start an
additional server and shift specific libraries and users to it by simply pointing one of
the aliases to that new server.
Utility Macros
The following utility macros can be used by all SAS/SHARE programs and sessions:
SHRMACS
compiles all the other macros and builds the server-alias and library-alias tables.
SERVERID
takes a server alias and looks up the server ID in the server-alias table and
generates server-ID or SERVER=server-ID, as appropriate.
SERVIIDX
returns the index of the entry in the server information table for the specified
server.
LISTSRV
writes the server-alias table to the log.
LISTLIB
writes the library-alias table to the log.
LISTSRVI
writes the server information table to the log.
SAS/SHARE Macros for Server Access 4 Macros Generated by the SHRMACS Macro 79
SASSAML=
specifies an applications systems library, which is a set of files that specify SAS
libraries and servers. For details, see “The APPLSYS Macro Library” on page 81.
• • • LISTLIB
• • • LISTSRV
• • • LISTSRVI
• OPERATE
• • • SERVERID
• • • SERVIIDX
• SETSRV
• SHUTSRV
• STRTSRV
LOG
Command ===>
1085 %shrmacs (server,msg);
For more information about the macros that are compiled by %SHRMACS, you can
specify the HELP keyword. For example:
%shrmacs(server,help);
HELP lists the syntax, a brief description, and an example for each macro that
SHRMACS defines in the SERVER category.
%shrmacs(user,applsys=_DEFINED_);
3 shift server traffic easily. When you begin using SAS/SHARE, you might create
many aliases for a single server, with each alias used by only one or a small
number of applications. As server use increases, you’ll want to add a second server
and move some of your applications to that server. You can do this by changing
the entry in the SERVERID member to point to the new server for the
applications that you want to move.
To define server aliases, create a member named SERVERID in the APPLSYS macro
library. The member name must be SERVERID because the SHRMACS macro looks for
that specific name.
Define a server alias in the SERVERID member by using the following syntax:
%SERVID(alias,server-ID);
Example Code 6.1 on page 83 shows an example of a SERVERID member.
Example Code 6.1 Server-Alias Table
/***************************************************/
/* */
/* NAME: SERVERID */
/* */
/* SERVER ALIAS TABLE ENTRIES */
/* */
/* This member defines aliases for server names. */
/* The entries in this member are loaded into */
/* the server-alias table by the SHRMACS macro. */
/* This server-alias table is used by the */
/* SERVERID macro to translate an alias to an */
/* actual server ID. */
/* */
/* To add aliases to the table, specify each */
/* alias and its real server ID in a SERVID call */
/* at the end of this member. */
/* */
/***************************************************/
%servid(shr7,shrserv7)
%servid(share1,shrserv3)
%servid(pubserv,shrserv7)
If you do this, you also create a member in the APPLSYS library of the same name (in
this example, PURCH).
In a selected member, use the following syntax to specify the library and server name
pairs.
%SERVLIB(SAS-library, server-name);
SAS-library is specific to the operating environment. server-name can be a server ID or
its alias.
84 Creating the Server Information Table (SERVINFO) 4 Chapter 6
Example Code 6.2 on page 84 contains a member named PURCH, which references
operating environment-specific SAS library names.
Example Code 6.2 Library-Alias Table
/**********************************************************************/
/* */
/* NAME: PURCH */
/* */
/* LIBRARY TABLE ENTRIES - SPECIFIC APPLICATION */
/* */
/* This member associates server names with libraries. The entries */
/* in this member are loaded into the library table if the */
/* SHRMACS macro is called by using the argument APPLSYS=APPLSAMP.*/
/* If APPLSYS=APPLSAMP is specified, the entries can also be */
/* loaded by using a call to the LIBDEF. */
/* */
/* To add libraries to the definition table, add a SERVLIB call */
/* for each library at the end of this member. Specify the */
/* physical name for the library and the name of the server to be */
/* associated with the library. The name can be an alias or an */
/* actual server ID. */
/* */
/**********************************************************************/
%servlib(disk1$:[[Link].lib1), testserv); # OpenVMS
%servlib([Link].lib1, testserv); # z/OS
%servlib(/shrtest/appljan/lib1, testserv); # UNIX
%servlib(d:\shrtest\appljan\lib1, testserv); # Windows
To add aliases to the table, use a SERVLIB call for each library-server pair.
Additionally, create a member in the APPLSYS macro library named DEFAULTS.
This member can be empty but must be created to avoid having error messages
generated from the SHRMACS macro.
The DEFAULTS member is used when the APPLSYS= argument is omitted in a call
to the SHRMACS and LIBDEF macros. The syntax of the PURCH and the DEFAULTS
members is identical.
3 a network node name that is represented in the two-level server name format:
[Link]-id
You can use the server information table to store other attributes of the server, its
users, or its administrators, such as server access passwords, PROC SERVER
statement options, and the SAS release that the server runs under.
To add an entry to the server information table, use the SERVINFO macro as follows:
Usually, the SERVINFO macro is used to cause the SERVERID macro to generate an
alias for a node name that is not a valid SAS name. For example, you can specify the
two-level server name and the netnode in the server information table as follows:
%servinfo ([Link],netnode=[Link]);
3 Because the table is implemented as sets of macro variables, assign the value
&SASREL to the macro variable ISREL&SRVINUM.
%LET isrel&srvinum = &sasrel;
4 In the LISTSRVI macro, modify the line that prints the headers for the table.
%put &pline RMTVIEW %shrrpt(-,3)
NETWORK NODE %shrrpt(-,20) RELEASE %shrrpt(-,3);
5 You might want to change the %PUT statement in the LISTSRVI macro to extend
the dashed line following the table to match the length of the modified header line.
%put %shrrpt(-,78);
6 Change the loop that prints the table so that it looks like this:
%do i=1 %to &srvinum;
%let pline=%shrrpt(&blank,3)
%shrfmt(&&isrvr&i,16);
%let pline=&pline
%shrfmt(&&irmtv&i,11)
%shrfmt(&&inode&i,36);
86 Generating a LIBNAME Statement By Using the LIBDEF Macro 4 Chapter 6
7 If you want to be able to access and use the information in the table for a macro or
a program, you would have to use the SERVIIDX macro.
%let i=%serviidx(&new_id);
%if (&&isrel&i^=) %then
%do;
/* some use of &&isrel&i here */
%end;
8 After you have accounted for the new parameter and modified the format of the
server information table, you can add entries to the table for all parameters.
%servinfo(rmthost.share1,netnode=.[Link],
rmtview=no,sasrel=6.12);
%servinfo(rmthost.share2,netnode=[Link],
rmtview=yes,sasrel=7);
When you invoke the LISTSRVI macro, the server information table is displayed in
the SAS log.
%listsrvi;
z/OS
%libdef(mylib,[Link].lib1);
SAS/SHARE Macros for Server Access 4 Using APPLSYS= to Call the SHRMACS and LIBDEF Macros 87
UNIX
%libdef(mylib/shrtest/appljan/lib1);
Windows
%libdef(mylib,d:\shrtest\appljan\lib1);
Each macro invocation defines the library to the libref MYLIB. You can define
additional libraries without invoking the SHRMACS macro again.
If you want to use server aliases but you have not created the library- and
server-name pairs in the APPLSYS macro library yet, you can use a LIBNAME
statement and invoke the SERVERID macro in place of the SERVER= argument. For
more information, see Chapter 14, “SAS/SHARE Macros,” on page 163.
CHAPTER
7
Interpreting SAS/SHARE Server
Log Messages
Message numbering assigns a number to each message that is recorded in the log.
The server log analysis programs parse messages by using the associated numbers.
Here is an example of specifying message numbering when the server is started:
proc server msgnumber id=demoserv;
For more information, see Chapter 9, “The SERVER Procedure,” on page 107.
Command ===>
1? PROC SERVER ID=share2 LOG=(ACTIVETIME BYTECOUNT ELAPSEDTIME MESSAGE) msgnumber;
2? run;
30Apr2008:07:15:36.690 043131 SAS server SHARE2 started.
30Apr2008:07:16:20.048 043021 User john(1) has connected to server SHARE2.
30Apr2008:07:16:20.442 043143 User john(1) has created "Line Mode Process"(1)
under "Kernel"(0).
30Apr2008:07:16:21.206 043069 Server library TESTDATA
(’/local/u/john/server’ V9) accessed as
TESTDATA by user john(1).
30Apr2008:07:16:31.593 043021 User maria(2) has connected to server SHARE2.
30Apr2008:07:16:31.846 043143 User maria(2) has created "Line Mode Process"(1)
under "Kernel"(0).
30Apr2008:07:16:31.923 043069 Server library DEMOTEST
(’/local/u/john/server’ V9) accessed as
DEMOTEST by user maria(2).
30Apr2008:07:17:32.462 043143 User maria(2) has created "PRINT"(2) under
"Line Mode Process"(1).
30Apr2008:07:17:33.537 043100 [Link](1) opened for input/S via
engine V9 by "PRINT"(2) of user maria(2).
30Apr2008:07:17:40.361 043102 [Link](1) closed by "PRINT"(2)
of user maria(2).
30Apr2008:07:17:40.422 043144 User maria(2) has terminated "PRINT"(2)
(under "Line Mode Process"(1)).
30Apr2008:07:18:05.575 043143 User maria(2) has created "DATASTEP"(3)
under "Line Mode Process"(1).
30Apr2008:07:18:05.668 043100 [Link](1) opened for output via
engine V9 by "DATASTEP"(3) of user maria(2).
Interpreting SAS/SHARE Server Log Messages 4 Format for Server Log Messages 91
Output Creates or replaces files. (Do not use a slash when specifying the
Output mode.)
The following table shows the types of access pattern and their functions.
Sequential (S) Processes observations one after the other, starting at the
beginning of the file and continuing to the end of the file.
Two-pass (2) Enables a SAS procedure to pass through the data more than
one time.
Interpreting SAS/SHARE Server Log Messages 4 Server Log Message Components 93
Contents type (C) Reads header data, such as names of variables, but does not
read observation data, such as data that PROC PRINT reads.
The two-pass and BY-group rewind access patterns both enable SAS procedures to
pass through the data more than one time. For example, during the initial pass a sum
or count is computed; during the second pass, the values of the variables in each
observation are compared to, added to, or subtracted from the value that was computed
in the first pass. The distinction between these two access patterns is subtle.
When a SAS data set contains only one BY group, there is no difference. When a SAS
data set contains multiple BY groups, rewinding a BY group after the first BY group is
processed requires the ability to position to a random location in the file, which is not
complicated when using disk devices but is almost impossible when using tape devices.
(The I/O supervisor is able to remember the starting position of the current BY group.)
Only the two-pass access patterns require the ability to rewind the entire SAS data
set.
resource environment (resource environment number)
is a structure that is used within SAS to scope and manage the usage of system
resources. Examples of resource environments include SAS procedures, SAS
windows, DATA steps, or other internal SAS activity.
The resource environment number, in parentheses, is a counter that starts at 1
for each connection. To precisely identify a resource environment in a server’s log,
you need the connection number and the resource environment number.
serverid
specifies a name for the server. The server name must meet the criteria for a valid
SAS name, which can include the following special characters: dollar sign ($), at
sign (@), and pound sign (#). For more information, see the rules for naming SAS
variables in SAS Language Reference: Concepts.
Naming a server must also include criteria that are imposed by the operating
environment and the access method that you specify for communication between a
server and a client session. For example, if you are using the TCP/IP
communications access method, the serverid that is specified must be a valid TCP/
IP service as defined in the TCP/IP SERVICES file.
For information about naming servers by operating environment, see
Communications Access Methods for SAS/CONNECT and SAS/SHARE.
userid(connection number)
specifies a valid user ID for the accessing client on the server. The operating
environment on which the client runs can affect user naming conventions. For
details about specifying valid user IDs, see “User ID and Password Naming
Conventions” on page 129.
The connection number is shown in parentheses after the user ID. This number
begins at 1 and increases by 1 each time a user connects to the server. The server
maintains this counter. The connection number is shown in most of the messages
that are recording activity for each connection. If the same user ID is connected to
a server more than one time, it is possible to track the activity of each connection
separately.
94 Reading the Server Log 4 Chapter 7
A message such as this always appears in the log when the server starts. The
message tells the server administrator that the server initialization completed
successfully. In this example, server SHARE2 identifies which server was started. After
this message is printed, the server waits for clients to connect to it. For information
about starting a server, see “Starting a Server” on page 33. For information about
server IDs, see “Server Log Message Components” on page 92.
A message such as this appears when a client establishes a communication path with
the server. The message contains a user ID, a connection number, and a server ID that
tell which user has connected to which server. In this example, user john(1) has
connected to server SHARE2. For more information about user IDs and server IDs, see
“Server Log Message Components” on page 92. The Connect message is bracketed in
the log by the disconnect message. See “The Disconnect Message” on page 97.
A message such as this shows that the user has created a resource environment.
During a connection, the user, in this example john(1), creates mirror resource
environments, which are used to maintain (track, scope) the resources that the user
consumes in the server’s session (or that the server consumes on the user’s behalf). The
number of each newly created resource environment will appear in later messages
about the resources that were consumed.
The quoted string, "Line Mode Process", is the name of the resource environment
that was created. The number in parenthesis is the resource environment number.
The quoted string "Kernel" is the name of another resource environment, and the
number in parenthesis is the resource environment number. "Kernel" is the parent
resource environment of the created resource environment that this message records.
In this example, the "Kernel" resource environment is the parent of the "Line Mode
Process" resource environment. It is possible to deduce a resource environment tree
that is in effect during a server’s session.
The "Kernel" (0) resource environment is automatically created when a user
connects to a server. The primary purpose for kernel resource environments is to create
child resource environments.
For more information, see “Server Log Message Components” on page 92.
The Create message is bracketed in the log by the Terminate message.
Interpreting SAS/SHARE Server Log Messages 4 The Open Message 95
A message such as this appears when a SAS client executes a LIBNAME statement,
or an external client (that is, a client that is not a SAS client) performs an action that
associates a libref with a SAS library. This message gives you an association between
the libref that you’ll see in subsequent messages and the physical name, engine, and
server’s libref of that library. Under z/OS, accessing a library results in a physical file
being opened; in other operating environments, accessing a library is similar to
changing directories.
The Access message begins with the libref that the server uses to reference the
library. In this example, the libref is TESTDATA. The information in parentheses (’/
local/u/john/server’ V9) is the physical name of the library (the quoted string),
and the name of the engine (V9) that is used in the server’s session to access the library.
The end of the message identifies the user who is accessing the library. In this
example, the user is john, and the number in parenthesis (1) is the connection
number, which is used for tracking a user’s activity on the connection.
For more information about librefs, engine names, and user IDs, see “Server Log
Message Components” on page 92. For information about accessing a SAS library, see
“Defining a SAS Library to a Server (All New Users)” on page 6.
The Access message is bracketed in the log by the Release message. See “The
Release Message” on page 96.
A message such as this appears when a user opens a SAS data file.
Opening a SAS file allows the user to move around within the file, see which
variables are in the file, check the file size and the file formats, and so on.
Opening a SAS data view is more complicated than opening a data file. To open a
data view, the server gets help from the engine supervisor to do the following:
3 load the engine that will interpret the view
3 open the view file
3 have the view engine open the underlying files and prepare to interpret the
instructions in the view file
The Open message begins with the [Link]-type. In this
example, [Link] shows which file or view is being opened, and the number
in parenthesis (1)is the open sequence number. This number is a counter to track how
many times a data set is opened within a resource environment.
Input is the type of Open mode, and S is the access pattern for this open.
engine V9 identifies which engine is being used to interpret the view for the
member type VIEW.
"PRINT" (2) identifies the resource environment that is being used to open the file
or view. Openings are considered resources, so resource environments track them. The
96 The Close Message 4 Chapter 7
same resource environments also track the resources, such as memory, that are
consumed when a file or view is opened.
maria is the user ID, which shows who opened the file or view, and (2) is the
number of times that the file was opened. For more information about librefs, member
names, member types, open modes, access patterns, engine names, resource
environments, and user IDs, see “Server Log Message Components” on page 92.
The Open message is bracketed in the log by the Close message. See “The Close
Message” on page 96.
A message such as this appears when a user closes a file. In this example, user
maria has closed the file [Link] under the resource environment "PRINT".
For more information about librefs, member names, member types, resource
environments, and user IDs, see “Server Log Message Components” on page 92. See
also “The Open Message” on page 95.
A message such as this appears only if the user explicitly executes a LIBNAME
statement that includes the CLEAR option. For example:
libname TESTDATA clear;
In this example, user john has released the library TESTDATA. The Release message is
the opposite of the Access message. See “The Access Message” on page 95.
For more information about user IDs and librefs, see “Server Log Message
Components” on page 92.
A message such as this appears when a user who was connected to the server has
ended that connection. In this example, user john has disconnected from server
SHARE2. For more information about user IDs and server IDs, see “Server Log Message
Components” on page 92.
Usually, the Close message appears before the Disconnect message. However, a
Disconnect message might appear before a Close message appears if the client’s session
with the server was ended abnormally (for example, if the line is disconnected or a
client’s machine crashes).
Accounting Information
By default, accounting data is written to the server’s log when a user disconnects
from the server. (See “The Disconnect Message” on page 97.) This data shows the usage
of server resources—that is, the messages processed, bytes transferred, active time, and
elapsed time—that resulted from a user’s activity while connected to the server. In this
example, the data shown is for user john while connected to server SHARE2.
For explanations of usage statistics for messages processed (MESSAGE), bytes
transferred (BYTECOUNT), active time (ACTIVETIME), and elapsed time
(ELAPSEDTIME), see Chapter 9, “The SERVER Procedure,” on page 107. For more
information about accounting level, see Chapter 9, “The SERVER Procedure,” on page
107. For more information about user IDs, see “Server Log Message Components” on
page 92.
CHAPTER
8
Analyzing the Server Log
To make the log’s raw data meaningful, you can use a set of server log analysis
programs to examine specific data resources and to create usable reports. Analysis of
the logged data resources of several SAS/SHARE servers allows you to compare server
performance and to balance workloads among them.
100 Using the Server Log Analysis Tools 4 Chapter 8
To prepare for server log analysis, set the message numbering feature. Message
numbering assigns a number to each message that is recorded in the log. The server log
analysis programs parse messages by using the associated numbers.
The first line associates the fileref INLOG with an operating environment-specific
name for a file that contains the server log. In this example, ’[Link]’ is the
name of the file in a UNIX operating environment that contains the server log. In the
second line, the LIBNAME statement associates the libref SLOGDATA with the
operating environment-specific SAS library ’SLOGDATA’. The first two lines identify
the external file as input and specify a SAS library to write SAS data files to.
The remaining lines in the driver program are INCLUDE macro statements in SAS,
which read and execute each named program consecutively.
Modify the FILENAME and LIBNAME statements in [Link] to specify your
server’s log and the repository for the SAS data files, respectively.
[Link], [Link], and [Link] do not require modification.
They can be run as provided to produce SAS data files that contain information about
the server’s session. Those data files are the input to the analysis phase, which is
performed by the programs in [Link] and [Link].
Usually, you customize the [Link] and [Link] programs to produce
the analyses of your server that are most relevant to your needs.
sas invokes the SAS System. pathname specifies the location of SLTOOL0 and the
location of the log file.
[Link]
The SERVINFO data set records the server name and the times at which it was
started and stopped. You can use this information to write a descriptive header on a
report that relates to that server.
[Link]
The CONNINFO data set contains one observation for each time a user connects to
the server and one observation for each time a user disconnects from the server.
From this data set, you can obtain a list that shows who connected to a server, how
long each user remained connected, or how many times each user connected to the
server. You can also chart the simultaneous number of connections to a server over a
period of time, which shows peaks and valleys in the number of users who access data
through a specific server.
[Link]
The CONNSUM data set contains only one observation with one variable that stores
the total number of connections to this server.
[Link]
The TASKINFO data set contains one observation for each creation of a mirror
resource environment and one observation for each termination of a mirror resource
environment.
Analyzing the Server Log 4 [Link] 103
The name of a resource environment in this data set corresponds to the name of a
SAS procedure or a window that is used to access data through the server. From this
data set, you can obtain a list of those SAS procedures and windows and the length of
time each procedure or each window remained active.
[Link]
The LIBINFO data set contains one observation for each time a user accesses a SAS
library and one observation for each time a user releases a SAS library.
From this file, you can determine how many times each library was accessed through
the server and the length of time that each library was accessed. You should use the
physical name for the library because each library can be referred to by different librefs
at various times. To obtain a list of the libraries accessed through a server, use
[Link].
[Link]
The PHYSINFO data set contains a list of the physical names that correspond to the
libraries that were accessed through the server.
SLOGDATA.ENGSUM1
The ENGSUM1 data set contains a list of the engines that were used to access SAS
libraries through the server.
[Link]
The MEMINFO data set contains an observation for each time a SAS library
member is opened, reopened, closed, renamed, repaired, or deleted.
From this data set, which usually is very large, you can derive a list of members for
each library that has been accessed through the server; the length of time and how
many times each member was accessed; whether each member was created, read, or
updated; and the number of simultaneous users of each member over a period of time.
You should use the physical name for the library because each library can be referred
to by different librefs at various times.
[Link]
The OBJINFO data set contains an observation for each time a SAS catalog entry is
opened, closed, renamed, deleted, aliased, or has its directory information or options
changed.
This data set is similar to [Link], but it contains information for
catalog entries instead of members of SAS libraries.
[Link]
The IDXINFO data set creates an observation for each time a user creates or deletes
an index through the server.
Because creating an index tends to be expensive, this data set is probably most
useful as a warning signal. Also, because indexes can be very helpful for SAS data sets
104 [Link] 4 Chapter 8
that are accessed concurrently, having a list of indexes that were deleted during a
server’s session can also be a warning signal.
[Link]
The DIRINFO data set contains an observation for each time the directory of a SAS
library or the directory of a SAS catalog is opened or closed through the server.
[Link]
The IDXSUM data set contains only one observation with two variables. One
variable counts how many indexes were created through the server; the other variable
counts how many indexes were deleted through the server.
[Link]
The ACCTINFO data set contains one observation for each accounting message that
is written to the server’s log after a user disconnects. You must specify the LOG= option
in the PROC SERVER statement to collect this data.
2
P A R T
Reference
Chapter 9. . . . . . . . . . The SERVER Procedure 107
Chapter 13. . . . . . . . .The LOCK Statement and the LOCK Command 159
CHAPTER
9
The SERVER Procedure
Task Command
Specify data sets for the SAS/SHARE server to open and hold in memory. See “Syntax for the
ALLOCATE SASFILE
Command” on page 119.
Defines a SAS library to a SAS/SHARE server that is already running. See “Syntax for the
ALLOCATE LIBRARY
Command” on page 121.
Syntax
Options
ALLOC | NOALLOC
determines whether clients can define additional SAS libraries to a server after a
server has started. The ALLOC option enables clients to define libraries to a server.
The NOALLOC option prevents clients from defining additional libraries to the server
and restricts clients to accessing libraries that are defined by a server administrator.
Default: ALLOC
ACCTLVL=value | (value 1 < ... value n >)
specifies the level of accounting. Use this option to specify the aggregation (or detail)
used in reporting server usage statistics. This option is useful for tuning an
application because it enables you to examine, in more detail, how various parts of
The SERVER Procedure 4 PROC SERVER Statement 109
the application use the server resources. The usage statistics also enable you to
charge users for the amount of server resources they consume.
The ACCTLVL= and LOG= options are closely related. The LOG= option specifies
which usage statistic is written to the log; the ACCTLVL= option specifies the level of
aggregation for that statistic (user, file, and resource environment). See the LOG=
option for more information.
You can specify multiple values for the ACCTLVL= option by enclosing the values
in parentheses and separating them with a space or a comma—for example,
ACCTLVL=(USER DATA). Here are the valid values for ACCTLVL=:
DATA
causes the server to log statistics every time a SAS file is closed by a user. These
statistics show the usage of server resources for each file by that user.
USER
causes the server to log statistics every time a user disconnects from the server.
These statistics show the usage of server resources for that client session.
RESOURCE_ENVIRONMENT
causes the server to log statistics every time a user terminates a resource
environment. Examples of resource environments include a SAS procedure, a SAS
window, a DATA step, a SAS process, or other internal SAS activity. These
statistics show the usage of server resources by requests that are made in the
context of that resource environment by that user.
ALL
causes the server to log statistics for all accounting levels (DATA, USER, and
RESOURCE_ENVIRONMENT).
Default: USER
ADMINLIBREF=value | _NONE_
specifies the libref associated with the library of administrative data for the server.
This option enables a client to handle a server’s administrative data in the same way
it handles any other SAS file, which enables the client to process that data
programmatically. To turn off this type of access to a server’s administrative data,
specify ADMINLIBREF=_NONE_.
/* This program segment creates the SAS data file WORK.A,
which is a list of all the libraries that clients of the
server are accessing. */
libname sasadmin server=shr1;
data a;
set [Link];
where users > ’0’;
run;
Default: SASADMIN
110 PROC SERVER Statement 4 Chapter 9
AUTHENTICATE=REQUIRED | OPTIONAL
controls whether a server requires connecting users to provide a valid user ID and
password when they connect to the server. You can use this option with a
communications access method security option (for example, use the TCPSEC option
for TCP/IP).
AUTHENTICATE=REQUIRED means that the security options of all the access
methods that are used by the server must be set to _SECURE_. Also, PROC
SERVER will not start unless all of the access methods guarantee that they require a
valid user ID and password combination before establishing a connection between a
client and the server.
AUTHENTICATE=OPTIONAL means that the communications access method
security options might be set to _SECURE_. Each access method can have a different
security option. This can be useful for a site that trusts the IDs of users that connect
through one access method but does not trust the IDs of users that connect through
another access method. In this instance, only the access method used by the
non-trusted clients would have its security option set to _SECURE_. Using the
parameter OPTIONAL allows trusted users to connect without requiring validation.
When an access method supplies a validated user ID (usually, by requiring a
connecting client to specify a valid user ID and password combination), the server
uses that validated ID to verify the user’s authorization to access SAS files. When
AUTHENTICATE=OPTIONAL and some access methods do not supply validated
user IDs, those clients are allowed to access only those SAS files that the server is
allowed to access. In this instance, you should run the server under a user ID that
does not have open access to the files on its computer.
Default: REQUIRED
Aliases: REQ, OPT
CLIENTID = SESSION | SECURITY
specifies the source of the client user ID to use in log messages that are written to the
server log. Your choice determines the search order that is used to locate the client
user ID. Choose the source of the client’s name to be used in the server log, as follows:
SESSION
specifies that the source of the client user ID is either the logon name or the batch
account name of the client session. The server uses the following search order:
3 If a session name is located, the session name is used.
3 If a session name is not located, but a secured name is located, the secured
name is used. (For details, see the SECURITY value.)
3 If neither a session name nor a secured name is located, the string _U_ is
used as a generic identifier in the log messages.
The SERVER Procedure 4 PROC SERVER Statement 111
SECURITY
specifies that the source of the user ID is the secured name that the client used to
connect to the server. The server uses the following search order:
3 If a client’s secured name is located, the secured name is used.
Note: A secured name is the user ID that is specified using the
USERNAME= and PASSWORD= options in the LIBNAME statement.
Example:
libname test userid=tbass password=_PROMPT_;
option specifies the level of aggregation for that statistic (user, file, and resource
environment). See the ACCTLVL= option for more information.
The LOG=QUERY option allows you to track SQL queries that are submitted
through the Remote SQL Pass-Through facility. This is useful to applications
programmers for debugging and to server administrators to learn how the server is
being accessed.
You can specify multiple values for the LOG= option by enclosing the values in
parentheses and using a space or a comma to separate them—for example,
LOG=(MESSAGE BYTECOUNT).
Note: The log values IO and CPU are no longer valid. The data that was reported
by these options in SAS 6 offered limited accuracy, and the changes in resource
tracking in SAS 8 reduced the potential accuracy even further. If you previously set
the SAS options STIMER or FULLSTIMER because you had specified LOG=IO or
LOG=CPU, you can reset or delete these SAS options in order to improve your server
performance. 4
Here are the valid values for LOG=:
ACTIVETIME
causes the server to log the cumulative elapsed time of server processing for the
specified event in the ACCTLVL= option. For example, if ACCTLVL=USER and
LOG=ACTIVE, the server logs the cumulative elapsed time of processing for that
client session when that client session ends. This value is printed using the SAS
format TIME15.3. Here is an example of a log message that is recorded for this
statistic:
30Apr2008:10:42:44.060 Usage statistics for user TIM(1):
Active time: 0:00:01.0394
Alias: ACTIVE
BYTECOUNT
causes the server to log the cumulative number of bytes that are transferred
between the client and the server for the event that is being logged. For example,
if ACCTLVL=USER and LOG=BYTE, the server logs the cumulative number of
bytes transferred between the client and the server for that client session when
that client session ends. The value for BYTE is automatically scaled to make it
easier to read and the appropriate character is appended to the data. K=Kilobytes
(1,024 bytes), M=Megabytes (1,048,576 bytes) and G=Gigabytes (1,073,741,824
bytes). The values are printed using the SAS format COMMA10.0. Here is an
example of a log message that is recorded for this statistic:
30Apr2008:10:52:31.040 Usage statistics for user MIKE(2):
Bytes transferred: 40,052 K
Alias: BYTE
The SERVER Procedure 4 PROC SERVER Statement 113
ELAPSEDTIME
causes the server to log the elapsed time of the recorded event. For example, if
ACCTLVL=DATA and LOG=ELAPSED, the server logs the length of time that a
file was open. If ACCTLVL=USER and LOG=ELAPSED, the server logs the length
of time that the user was connected to the server. This value is printed using the
SAS format TIME15.3. Here is an example of a log message that is recorded for
this statistic:
30Apr2008:11:15:44.020 Usage statistics for user JOE(3):
Elapsed time: 0:22:57.6912
Alias: ELAPSED
MESSAGE
causes the server to log the number of client requests that are processed by the
server for the recorded event. For example, if ACCTLVL=USER and
LOG=MESSAGE, the server logs the number of requests processed for the client
when that client session ends. This value is printed using the SAS format
COMMA15.0. Here is an example of a log message that is recorded for this
statistic:
30Apr2008:13:22:04.060 Usage statistics for user STEPHEN(4):
Messages processed: 15
QUERY
causes the server to log each SQL query that it receives through the Remote SQL
Pass-Through facility from a SAS session or other client. By default, the server
logs only update and output SQL statements, not queries. If LOG= QUERY, you
will see messages similar to the following in your server log:
30Apr2008:15:14:12.898 GISELLE(14) in "SQL"(13) has issued select
flight, date, depart from [Link] where
flight=’202’ to SQLVIEW.
ALL
causes the server to log all the usage statistics (ACTIVETIME, BYTECOUNT,
ELAPSEDTIME, and MESSAGE) for the corresponding accounting level. For
example, if ACCTLVL=USER and LOG=ALL, the server logs statistics for
ACTIVETIME, BYTECOUNT, ELAPSEDTIME, and MESSAGE for the client
session when that client session ends.
If you specify LOG=ALL, the server will also log SQL queries that it receives
through the Remote SQL Pass-Through facility. See the QUERY option for an
example of the SQL messages that are logged.
Here is an example of a log message that is recorded when ALL is specified:
30Apr2008:16:02:44.060 Usage statistics for user BILL(1):
Messages processed: 47
Bytes transferred: 104 K
Active time: 0:00:05.0394
Elapsed time: 0:22:57.6912
REM
is an acronym for REMOTE engine emulation; when the server terminates, this
value causes the server to log the total number of connections and maximum
concurrent number of connections from thin clients that access the SAS/SHARE
server. These clients include Share JDBC, ODBC, OLE DB, and SAS SQL.
114 PROC SERVER Statement 4 Chapter 9
MSGNUMBER
associates a unique message number (represented in hexadecimal notation) with
each type of operation for which a message is recorded in a server log.
CAUTION:
Avoid hardcoding message numbers in your applications. Use macros instead.
Message numbers can change from one software release to another. 4
Message numbers are useful for server log analysis applications, which can count
the number of instances of an operation that occur in a specific client/server session.
Collection and analysis of these statistics might help with server load balancing. SAS
provides a set of server log analysis program prototypes that you can customize for
your needs. Among these prototypes is a file that maps message numbers to
operations. See “Starting the Server Log” on page 99 for information about the
server log analysis tools.
In the following example of a typical message written to a server log, the message
number 043131 identifies a PROC SERVER start-up operation.
30Apr2008:08:28:20.911 043131 SAS server SHR1 started
_ _port-number
If you are using the TCP/IP access method, you can specify the server’s port
number that corresponds to the server ID in the TCP/IP SERVICES file. Precede
the port number with two consecutive underscores. For details, see the topic on
the SERVICES file in Communications Access Methods for SAS/CONNECT and
SAS/SHARE.
Note: Do not space after the first underscore or the second underscore. 4
Example:
_ _1025
Note: Specifying a server by using a port number is not supported for ODBC
clients. 4
Aliases: SERVER, ID
THREADEDTCP | NOTHREADEDTCP
specifies whether the threaded version of the TCP access method and associated
threaded infrastructure should be used when TCP/IP communication is specified.
The default is NOTHREADEDTCP.
When THREADEDTCP is specified, communication activity to and from the server
is processed primarily in a threaded context. Communication activity refers to the
work the server does to receive a request and to reply to the request, including any
necessary data representation conversion. Threading enables multiple, concurrent
reception and transmission activity when the server runs on SMP hardware.
Also, a portion of the main request processing, which occurs between the time the
request is received and the reply time, is performed in the threaded context for a
SAS 9, 9.1, or 9.2 client or a SAS 9, 9.1, or 9.2 OLE DB provider for SAS/SHARE.
Note: New in SAS 9.2, threaded TCP is now compatible with the collection of
active-time usage statistics. You specify the collection of statistics by setting either
the LOG=ALL or LOG=ACTIVETIME option in the PROC SERVER statement.
When THREADEDTCP is specified, active time can still be collected. 4
Aliases: TTCP, NOTTCP
Default: NOTHREADEDTCP
Restriction: THREADEDTCP is an experimental option that was introduced in
SAS 9.1. Do not use this option in production jobs.
Restriction: THREADEDTCP is incompatible with network data encryption, which
is specified by using the NETENCRYPT and NETENCRYPTALGORITHM system
options. If network data encryption and THREADEDTCP are specified, an error
message is issued and server initialization fails. For details about the encryption
system options, see Data Security Technologies in SAS.
TBUFSIZE=value
specifies the suggested size of a buffer that the server uses to transmit information to
a client or receive information from a client. When this option is not specified in the
PROC SERVER statement, the value of the TBUFSIZE= SAS system option, if
specified, is used.
The use of these transmission buffers is for transmitting observations. The server
uses the value of the TBUFSIZE= option when computing the number of
observations to transmit in each multi-observation transfer between the server and
the client sessions. If the observation size, plus overhead, exceeds the value of the
TBUFSIZE= option, only single-observation transfers are executed. Specifying an
excessive value for the TBUFSIZE= option might cause your server or clients to run
out of memory and to terminate abnormally.
The SERVER Procedure 4 PROC SERVER Statement 117
You cannot calculate the number of observations per transfer by dividing the
observation length into the value that you specify for the TBUFSIZE= option. To
determine the effect of this option on your data sets, use the PROC SERVER options
LOG=MESSAGE and ACCTLVL=DATA and compare the number of messages
exchanged between the server and the client sessions as a function of the value of the
TBUFSIZE= option and the number of observations in the data set.
Default: 32k
UAPW=password | “encoded-password”
specifies a password that a client must supply in the LIBNAME statement to
establish communication with the server.
password
must be a valid SAS name that is 1 to 8 characters in length. The value for this
option is replaced by Xs in the log. To protect this password, you should use the
security software at your site to limit access to the SAS program statements that
create the server.
“encoded-password”
is an encoded version of a password. Using encoded passwords promotes security
and enables you to store SAS programs that do not contain clear-text passwords.
To obtain an encoded password, specify the clear-text password as input to the
PROC PWENCODE statement. For details, see the Base SAS Procedures Guide.
Here is an example of code for obtaining an encoded password:
proc PWENCODE in="srvmach";
run;
{sas001}c2Vydm1hY2g=
The following statements start the server SHARE1 and prevent clients from defining
SAS libraries to the server:
proc server id=share1 noalloc;
run;
The following statements start the server SHARE1 and report all message counts to the
server log:
proc server id=share1 log=msg;
run;
The SERVER Procedure 4 Syntax for the ALLOCATE SASFILE Command 119
Syntax
Arguments
SAS-data-set
contains descriptor information and its related data values organized as a table of
observations and variables that can be processed by SAS.
data-set-options
specify actions that apply only to the SAS data set with which they appear. For
complete details about data set options, see SAS Language Reference: Dictionary.
Note: You must define all librefs before using them in an ALLOCATE SASFILE
command. 4
3 After the ALLOCATE SASFILE command executes, the file is closed and the
buffers are freed only after the SAS/SHARE server is terminated.
3 Do not specify the same data set in both a SASFILE statement and an
ALLOCATE SASFILE command.
3 You must execute the SASFILE statement before you execute the PROC SERVER
statement.
Neither the ALLOCATE The least amount of memory is File access is limited and
SASFILE command nor the consumed. Each client that memory is constrained.
SASFILE statement is used. accesses a file duplicates the
same overhead that is required
for a file open.
Use the ALLOCATE SASFILE The SAS/SHARE server opens File access is frequent and
command, and accept the the file and keeps it open for all memory is constrained.
default number of buffers that client access, which eliminates
are pre-allocated. the duplicate overhead that is
required for a file open.
Use the ALLOCATE SASFILE Specify buffers according to The file being accessed is large,
command, and use the available memory and the but only certain pages of the
BUFNO= data set option to usage pattern of the file. data are accessed frequently.
specify the number of buffers
to pre-allocate.
Use the SASFILE statement to The entire file resides in File access is frequent and
read the entire data set into memory. there is sufficient memory for
memory. reading in the entire file.
For details about the SASFILE statement in Base SAS, see the following topics in
SAS Language Reference: Dictionary: the BUFNO= system option, the BUFNO= data
set option, and the SASFILE statement.
Example
In the following example, server SHARE1 is started and eight data sets are specified
to be stored in memory for client access. The number of buffers that are used is
determined by the default value of the BUFNO= system option.
The SERVER Procedure 4 Syntax for the ALLOCATE LIBRARY Command 121
Syntax
Required Arguments
libref
is a valid SAS name that is temporarily associated with a SAS library.
’SAS-data-library’
is the physical name of the SAS library that is being defined to the server. The name
is specific to your operating environment and must be enclosed in either single or
double quotation marks.
Options
engine
specifies the engine to be used to process the SAS library when the server executes
SAS.
Note: Usually, you do not have to specify this option because the server
automatically determines which engine to use for processing a data library. However,
you can specify this option to reduce the time that is used by the server when
determining which engine to use to access a specific SAS library. 4
LIBTYPE=library-type
specifies the type of library to be allocated. The following library types are supported:
CATCACHE
specifies that this library will be used to cache catalogs that have been accessed by
means of the cross-architecture catalog access feature. This option gives you the
flexibility to specify a libref and a location for these files. Only one catalog cache
might be allocated per SAS/SHARE server invocation.
122 Syntax for the ALLOCATE LIBRARY Command 4 Chapter 9
By default, the SAS/SHARE server uses its WORK library as the location for
the catalog cache and assigns the libref SASCATCA to it. In most instances, the
default is suitable.
STANDARD
specifies a standard SAS data file library. This is the default.
CATCACHELIMIT=n
is a numeric value that specifies the maximum number of catalog files that are held
in the cache. The files are accessed by means of the cross-architecture catalog access
feature. The following values can be used:
0 specifies that the catalog files are not cached.
1 specifies that all catalog files are saved in the catalog cache.
n specifies that the cache is limited in size to n files. The cache is
maintained, and the files are discarded by using a
least-recently-used algorithm. The n argument is valid only when
specifying a library type of CATCACHE. By default, the server
limits the number of catalogs cached to 3.
engine/system-options
are options that apply to the SAS library. This argument is not required. You can
specify any option that is valid in the LIBNAME statement for a specific operating
environment and engine. Using the form keyword=value, you can specify as many
options as you need. Use a blank space to separate options. See the SAS
documentation for your operating environment for a complete list of the options that
are available for your operating environment and engine.
Examples
3 The following example allocates the UNIX server library /data/sales that has the
libref SALES. It specifies that the server use the V9 engine to process this library.
ALLOC LIBRARY SALES V9 ’/data/sales’;
3 The following example allocates the z/OS server library [Link] (as a
catalog cache) that has the libref SRVCATS.
AL LIB SRVCATS ’[Link]’ LIBTYPE=CATCACHE;
123
CHAPTER
10
Remote Library Services
LIBNAME Statement
In a client session, associates a libref (a shortcut name) with a SAS library that is located on the
server for client access. In a server session, predefines a server library that clients are permitted
to access.
Valid in: client and server sessions
Category: Data Access
See: LIBNAME statement in the documentation for your operating environment
See Also: LIBNAME Statement in Base SAS documentation
Syntax
LIBNAME libref <engine> <’SAS-data-library’> SERVER=server-spec < options>;
Arguments
libref
For a server, specifies the name of a library reference (predefines a library) for client
access. One or more LIBNAME statements must be issued before the server is
started. If you predefine server libraries and want to limit client access to only the
124 LIBNAME Statement 4 Chapter 10
predefined server libraries, use the NOALLOC option in the PROC SERVER
statement. Specifying the ALLOC option in the PROC SERVER statement permits
clients to assign server libraries for use after a server is started.
For a client, specifies the name of a server library for client access.
CAUTION:
A client’s ability to access a SAS/SHARE server library depends on the permissions
granted at server start-up. If PROC SERVER ALLOC is specified, clients can access
both predefined libraries and libraries that have not already been allocated at
server start-up. If PROC SERVER NOALLOC is specified, client access is limited
to predefined server libraries. For details about the PROC SERVER statement, see
Chapter 9, “The SERVER Procedure,” on page 107. 4
The libref that you specify is presumed to be the server libref for an existing
server library unless you specify the SLIBREF= option or the physical name of the
data library.
The libref that you specify must be a valid SAS name, and it must be the first
argument in the LIBNAME statement.
engine
specifies the name of a valid SAS engine for a client to use to access the server
library. Usually, you should not use this option because the client automatically
determines which engine to use for accessing a SAS/SHARE server. Specify this
option only to override the SAS default for a specific server, or to reduce the time
that is needed to determine which engine to use to access a specific server.
For example, if the server library is located on a SAS/SHARE server that is
running SAS 9.2, you could specify REMOTE9. Specifying an explicit engine might
improve performance slightly.
Examples of engines include REMOTE, REMOTE8, and REMOTE9. For a list of
valid engines, see the SAS documentation for your operating environment. For
background information about engines, see SAS Language Reference: Concepts.
The engine parameter is positional. If you use it, it must follow the libref.
Note: Do not confuse the engine positional parameter with the RENGINE=
option. An engine is used by a client to access a server. An RENGINE is used by the
server to access its SAS library 4
’SAS-library’
specifies the physical name for the SAS library (on the server) that the client will
access. If you specify a server library either as the libref or as the value for the
SLIBREF= option, you must omit the physical name.
If you specify ’SAS-library’, the name must be a valid SAS name, and it must be
enclosed in single or double quotation marks. For details about specifying a SAS
library, see the documentation that is appropriate to your operating environment.
SERVER=server-ID | _ _port-number
specifies the identifier for the SAS/SHARE server session that runs on the computer
where the SAS library is located.
server-ID
must be a valid SAS name that is 1 to 8 characters in length. For the value of
server-ID, consult your server administrator.
Server naming is also affected by the operating environment and the access
method that you specify for communication between a server and a client session.
For example, if you use the TCP/IP communications access method, the server-ID
must be a valid TCP/IP service as defined in the TCP/IP SERVICES file.
For complete information about how to name servers by operating environment,
see Communications Access Methods for SAS/CONNECT and SAS/SHARE. For
Remote Library Services 4 LIBNAME Statement 125
details about the SERVICES file, see the topic on the SERVICES file in
Communications Access Methods for SAS/CONNECT and SAS/SHARE.
_ _port-number
If you are using the TCP/IP access method, you can specify the server’s port
number that corresponds to the server ID in the TCP/IP SERVICES file. Precede
the port number with two consecutive underscores. (For details about the
SERVICES file, see the topic on the SERVICES file in Communications Access
Methods for SAS/CONNECT and SAS/SHARE.)
Note: Do not space after the first underscore or the second underscore. 4
Example:
_ _1025
Options
ACCESS=READONLY
restricts a client’s access to a SAS library via a multi-user SAS/SHARE server. If
ACCESS=READONLY is specified in the client session, the client can read but not
update data in the library. However, other clients might have read/write access to
the library via the server.
If ACCESS=READONLY is specified in the server session, all clients are limited to
read-only access to the library via the server. No clients will have update access.
AUTHDOMAIN=auth-domain | “auth-domain”
specifies the name of an authentication domain, which is a metadata object that
manages the credentials (user ID and password) that are associated with the
specified domain. Specifying the authentication domain is a convenient way to obtain
the metadata-based user credentials rather than having to explicitly supply them
during server sign-on.
An administrator can define an authentication domain using the User Manager in
SAS Management Console.
Examples:
authdomain=DefaultAuth
authdomain="SAS/SHARE Auth Domain"
u A server library is defined in the server session SHR1 that runs on the node
SIRLANCELOT. The node name is specified as an unquoted SAS name that has a
valid length.
v A server library is defined in the server session SHR1 that runs on the node
[Link]. The node name is specified as a quoted string that has a
valid length.
w A server library is defined in the server session SHR1 that runs on the node
DEFIANT. The node name is specified as an unquoted string that has a valid length.
If both the SERVER= option and the HOSTNAME= option specify the node name,
the option that is specified last takes precedence. In this example, the value
DEFIANT, which is assigned to the option HOSTNAME=, takes precedence over the
value d8433 in the two-level name that is assigned to the option SERVER=.
x A server library is defined in the server session SHR1 that runs on the node
d8433. The node name is specified as an unquoted string that has a valid length.
If both the SERVER= option and the HOSTNAME= option specify the node name,
the option that is specified last takes precedence. In this example, the value d8433,
in the two-level name that is assigned to the option SERVER=, takes precedence over
the value NOTUSED, which is assigned to the option HOSTNAME=.
password
must be a valid SAS name that is 1 to 8 characters in length. The value for this
option is replaced by Xs in the log. To protect this password, you should use the
security software at your site to limit access to the SAS program statements that
create the server.
“encoded-password”
is an encoded version of a password. Using encoded passwords promotes security
and enables you to store SAS programs that do not contain clear-text passwords.
To obtain an encoded password, specify the clear-text password as input to the
PROC PWENCODE statement. For details, see the Base SAS Procedures Guide.
Here is an example of code for obtaining an encoded password:
proc PWENCODE in="srvmach";
run;
{sas001}c2Vydm1hY2g=
Note: The encoded password is case-sensitive. Use the entire generated output
string, including the key. 4
Use the output from the PROC PWENCODE statement as the value for
encoded-password in the appropriate statement.
Here is an example of using an encoded password in a LIBNAME statement:
libname mylib server=shr1 user=jward password="{sas001}c2Vydm1hY2g=";
about options that are specific to an operating environment, see the documentation
that is appropriate for the operating environment that you use.
Restriction: If one or more client sessions that run under UNIX or Windows use
the FILELOCKWAIT= option in the ROPTIONS= statement to set the maximum
time limit that SAS will wait for a file to be unlocked (available for use), the effect
could cause the server session to stall. The SAS/SHARE server memory can
become inadvertently consumed by multiple tasks that are waiting for the release
of one or more locked files.
To prevent the server session from stalling, the SAS/SHARE server
administrator, when invoking the SAS session from which the server session will
run, can use the FILELOCKWAITMAX= system option to explicitly set the client
wait time to zero. Negating the client’s specified wait time prevents the server
from stalling.
See Also: For the client session FILELOCKWAIT= option in the LIBNAME
statement, see SAS Companion for UNIX Environments and SAS Companion for
the Microsoft Windows Environment.
See Also: For the server session FILELOCKWAITMAX= system option, see SAS
Companion for UNIX Environments and SAS Companion for the Microsoft
Windows Environment.
See Also: “Interaction between PROC SERVER and other File-Locking Processes”
on page 118
SAPW=server-access-password | “encoded-password”
executed in the client session, specifies a server access password. This option is
needed to access a SAS/SHARE server that is executing with the UAPW= option in
PROC SERVER in effect. SAPW= establishes communication with the server that is
used to access the library. Although this option is specified in the LIBNAME
statement, it does not control access to the server library itself. For details about
valid passwords, see “User ID and Password Naming Conventions” on page 129.
password
must be a valid SAS name that is 1 to 8 characters in length. The value for this
option is replaced by Xs in the log. To protect this password, you should use the
security software at your site to limit access to the SAS program statements that
create the server.
“encoded-password”
is an encoded version of a password. Using encoded passwords promotes security
and enables you to store SAS programs that do not contain clear-text passwords.
To obtain an encoded password, specify the clear-text password as input to the
PROC PWENCODE statement. For details, see the Base SAS Procedures Guide.
Here is an example of code for obtaining an encoded password:
proc PWENCODE in="srvmach";
run;
{sas001}c2Vydm1hY2g=
SLIBREF=server-libref
executed in the client session, specifies an existing libref that was defined in the
server session that you want to reference (or copy) in the client session. Use this
option when you want to reference an existing server libref, but you want to use a
different name for that libref in the client session.
Restriction: Do not assign the physical name for the SAS library on the server to
SLIBREF=. SLIBREF=server-libref and ’SAS-data-library’ are mutually exclusive.
Interaction: In a client session, if you define a user library whose libref duplicates
a libref that has been predefined in the server session, the user libref overrides the
server’s predefined libref for the duration of the client session only. The server
inherits the client’s user libref.
CAUTION:
Avoid using duplicated librefs. Even though duplicated librefs are valid and the
resolution of duplicated librefs is logical, the practice can be confusing. 4
Featured In: Example 6 on page 130
Featured In: Example 7 on page 131
Featured In: Example 8 on page 131
See Also: “Methods for Predefining a Server Library” on page 32
USERNAME=user-ID | _PROMPT_
executed in the client session, specifies a user ID that is valid on the server. This
parameter is used in two ways. The server uses it to validate the client on the server
operating environment (if authentication is enabled). The server also uses it to verify
access permission when the client accesses files on the server. For details about valid
user IDs, see “User ID and Password Naming Conventions” on page 129.
If USERNAME=_PROMPT_, a dialog box appears that contains a message that
prompts the user to enter a valid user ID. This enables you to specify the value at
program execution instead of coding it into the program. Using _PROMPT_ is a way
to enforce security.
Aliases: USERID, USER, UID
Interaction: If you specify USERNAME=, do not also specify AUTHDOMAIN=.
See Also: AUTHDOMAIN= option on page 125
See Also: PASSWORD= on page 126
Examples
Example 1: Client Using the Server’s Libref The client uses the existing server libref
SALES to point to a server library that is located on SERVER1.
libname sales server=server1;
Example 2: Client Assigning a Libref to a Physical Path The client assigns the libref
SQLDSLIB to the SAS library [Link] that is located in the
SAS/SHARE session SERVER7. In this example, the client is permitted to access a
server library that has not been predefined at the server.
libname sqldslib ’[Link]’ server=server7;
Example 3: Using a Server Password to Access a Server Library The client associates
the libref EDUCLIB with the SAS library [Link] that is
located on the server ABCSERV. Users must specify the password DEMOPW in order to
access this server.
libname educlib ’[Link]’ server=abcserv sapw=demopw;
Example 6: Associating a User Libref with a Server Libref The client associates the
new user libref MKTDATA with an existing server libref MARKETD in the
SAS/SHARE session SERVER1. The user libref MKDATA is a copy of the server libref
MARKETD. For this client, the server inherits the client’s user libref MKTDATA.
libname MKTDATA slibref=MARKETD server=server1;
Remote Library Services 4 LIBNAME Statement 131
In the client session, the user defines a new libref BLUE, which is a copy of the
server libref SHOE, which points to C:\MYSHOE. The client’s user libref BLUE
overrides the server libref BLUE in this client session only. For this client , the server
has the server-defined libref SHOE, and the server has inherited the client’s user libref
BLUE. The user libref BLUE will override the server libref BLUE for this client only.
libname blue slibref=shoe server=shr1;
As another example, if the user defined a new user libref GLUE that referred to the
server libref BLUE, would libref BLUE refer to the client’s user libref BLUE or to the
original server libref BLUE? In this example, because the server has already inherited
the client’s user libref BLUE, GLUE will refer to the client’s user libref BLUE in this
client session only.
libname glue slibref=blue server=shr1;
The order in which the library assignments occurs is important. If libref GLUE were
assigned before libref BLUE, then libref GLUE would be assigned to C:\MYBLUE
rather than to C:\MYSHOE.
Example 8: Server Inheritance of User Librefs That Are Associated with Server
Librefs Here are two predefined libraries that are created in a server session:
In this example, the user libref MYLIB is assigned to the server libref ZOO.
libname mylib slibref=zoo server=hrhost.shr1;
Because the server performs work on behalf of the client, the server inherits the user
libref MYLIB. The SAS logs, which can be viewed in the client and server sessions,
indicate that the librefs of the client and the server are identical. Libref MYLIB points
to two physical files C:\blue and C:\glue, which are concatenated.
34 libname mylib slibref=zoo server=hrhost.shr1;
NOTE: Libref MYLIB was successfully assigned as follows:
Engine: REMOTE
Physical Name: ( ’C:\blue’ ’C:\glue’ )
35 proc datasets lib=mylib;
Directory
Libref MYLIB
Engine REMOTE
Physical Name ( ’C:\blue’ ’C:\glue’ )
Accessed through server HRHOST.SHR1
132 LIBNAME Statement 4 Chapter 10
CHAPTER
11
The OPERATE Procedure
Options
SERVER=server-ID | _ _port-number
identifies the default server session to be managed. If this option is not specified,
you must identify the server in the SET SERVER command or in those PROC
OPERATE commands that allow you to identify the server to be managed. For
details, see “Specifying a Server” on page 148.
If you are using the TCP/IP access method, you can specify the server’s port
number that corresponds to the server ID in the TCP/IP SERVICES file. Precede
the port number with two consecutive underscores. (For details about the
SERVICES file, see the topic on the SERVICES file in Communications Access
Methods for SAS/CONNECT and SAS/SHARE.)
Note: Do not space after the first underscore or the second underscore. 4
Example:
_ _1025
SAPW=password | “encoded-password”
specifies a server-access password. This password is required to access a
SAS/SHARE server that is executing with the OAPW= option in PROC SERVER
in effect.
password
must be a valid SAS name that is 1 to 8 characters in length. The value for
this option is replaced by Xs in the log. To protect this password, you should
use the security software at your site to limit access to the SAS program
statements that create the server.
“encoded-password”
is an encoded version of a password. Using encoded passwords promotes
security and enables you to store SAS programs that do not contain clear-text
passwords.
To obtain an encoded password, specify the clear-text password as input to
the PROC PWENCODE statement. For details, see the Base SAS Procedures
Guide.
Here is an example of code for obtaining an encoded password:
proc PWENCODE in="srvmach";
run;
{sas001}c2Vydm1hY2g=
use the security software at your site to limit access to the SAS program
statements that create the server.
“encoded-password”
is an encoded version of a password. Using encoded passwords promotes
security and enables you to store SAS programs that do not contain clear-text
passwords.
To obtain an encoded password, specify the clear-text password as input to
the PROC PWENCODE statement. For details, see the Base SAS Procedures
Guide.
Here is an example of code for obtaining an encoded password:
proc PWENCODE in="srvmach";
run;
{sas001}c2Vydm1hY2g=
libref
identifies the SAS library that is specified in the ’SAS-lib’ argument.
’SAS-lib’
specifies the physical name of the SAS library that is being defined to the server.
This name is specific to the operating environment and must be enclosed in single
or double quotation marks. See “Specifying a SAS Library” on page 140 for
examples by operating environment.
RENGINE=engine-name
specifies the engine to be used to process the SAS library in the server’s SAS
execution. Usually, this option is not used because the server determines which
engine to use to process the data library. Specify this option only if you want to
override the SAS default or to reduce the search time that is required by the
server to determine which engine to use to access a specific SAS library.
engine/environment options
are options that apply to the SAS library. You can specify any option that is valid
in the LIBNAME statement for a specific operating environment and engine. You
can specify one or as many options as you need by using the form keyword=value.
Use a blank space to separate options. This argument is not required.
These options are effective in the server SAS session, not in the user SAS
session. For a complete list of options that are available for your operating
environment and engine, see the SAS documentation for your operating
environment.
Aliases: ALLOC, AL
The column USER LIBREF contains the libref that is specified by the user in
the LIBNAME statement. The user’s libref is provided only to help communicate
with the user, if necessary.
138 Freeing a Library 4 Chapter 11
The column STATUS is always ACTIVE. The column OPEN MODE indicates
whether the user is currently executing a SAS program step to read, update, or
create the member.
_ALL_
provides summary information about each server library that is currently defined
to the server. For example, this command produces this summary table, as follows:
proc operate serverid=share1;
display library _all_;
NUMBER
LIBREF STATUS OF USERS LIBRARY NAME
------------------------------------------------------
DATALIB QUIESCED 1 SAS-lib
POINT ACTIVE 6 SAS-lib
POINTS ACTIVE 4 SAS-lib
MAIN STOPPED 0 SAS-lib
MAPS INACTIVE 0 SAS-lib
The column LIBREF in the preceding example contains the server libref for a
SAS server. The server libref is the name that a server administrator assigns to
the library by using one of the following:
3 a LIBNAME statement specified before the PROC SERVER statement
3 an ALLOCATE LIBRARY command in a PROC OPERATE statement
3 an operating environment-dependent external allocation
A library that is not defined by using one of the preceding methods does not have
a server libref. Therefore, administrative commands that subsequently refer to
that library must use a library name that is specific to the operating environment,
such as a UNIX pathname.
Aliases: DISP LIBRARY, D LIBRARY
Freeing a Library
You use the FREE LIBRARY command to free (or release) one or more server-defined
libraries. When you issue the FREE LIBRARY command, a library that is not in use is
freed immediately; a library that is in use is freed after it is no longer in use. Here is
the syntax for this command:
FREE LIBRARY libid-1 <. . . libid-n>;
FREE LIBRARY _ALL_;
libid
specifies a libref for a predefined server library or a physical name for a server
library.
The OPERATE Procedure 4 Restarting a Library 139
_ALL_
frees all SAS libraries that were defined to the SAS/SHARE server by using an
ALLOCATE LIBRARY command or the LIBNAME statement.
Note: To bring a library to a stopped status gradually, issue the QUIESCE
LIBRARY command. To bring the library to a stopped status immediately, issue
the STOP LIBRARY command. Descriptions of these commands are given later in
this section. 4
Aliases: FR LIBRARY
Quiescing a Library
You use the QUIESCE LIBRARY command to move a library that is defined to the
current server from an active status to a stopped status. This command gradually
terminates access to a library by denying new requests to use the library. It
immediately stops libraries that do not currently have members open. If the library is
user-defined, after all users are released, the library is stopped and is no longer defined
to the server. Here is the syntax for the QUIESCE LIBRARY command:
QUIESCE LIBRARY libid-1 < . . . libid-n>;
QUIESCE LIBRARY _ALL_;
libid
specifies a libref for a predefined server library or a physical name for a server
library.
_ALL_
quiesces all the libraries that are defined to the server.
Alias: QUI LIBRARY, Q LIBRARY
Restarting a Library
You use the START LIBRARY command to restart one or more server libraries that
have been stopped or quiesced. Because server libraries are available by default, this
command is necessary to undo the effect of a STOP LIBRARY or a QUIESCE LIBRARY
command. Here is the syntax for this command:
START LIBRARY libid-1 < . . . libid-n>;
START LIBRARY _ALL_;
libid
specifies a libref for a predefined server library or a physical name for a server
library.
_ALL_
restarts all server libraries that are quiesced or stopped.
Alias: ST LIBRARY
If a library that was user-defined is stopped and then restarted with the START
LIBRARY command, the library is no longer defined to the server.
140 Stopping a Library 4 Chapter 11
Stopping a Library
You use the STOP LIBRARY command to immediately terminate user access to one
or more server libraries and bring the libraries to a stopped status. Here is the syntax
for this command:
STOP LIBRARY libid-1 < . . . libid-n>;
STOP LIBRARY _ALL_;
libid
specifies a libref for a predefined server library or a physical name for a server
library.
_ALL_
stops all libraries that are defined to the server.
If users are in the process of updating a data set, updates might be lost. Subsequent
attempts to access a stopped library are denied.
password
must be a valid SAS name that is 1 to 8 characters in length. The value for
this option is replaced by Xs in the log. To protect this password, you should
use the security software at your site to limit access to the SAS program
statements that create the server.
“encoded-password”
is an encoded version of a password. Using encoded passwords promotes
security and enables you to store SAS programs that do not contain clear-text
passwords.
To obtain an encoded password, specify the clear-text password as input to
the PROC PWENCODE statement. For details, see the Base SAS Procedures
Guide.
Here is an example of code for obtaining an encoded password:
proc PWENCODE in="srvmach";
run;
{sas001}c2Vydm1hY2g=
Use the output from the PROC PWENCODE statement as the value for
encoded-password in the appropriate statement.
In the following example, the DISPLAY SERVER command displays information
about the server SHARE1.
proc operate;
display server share1;
Alternatively, you can use the SERVERID= option in the PROC OPERATE
statement to identify the default server. The default server is also the current
server unless you use the SET SERVER command and specify a different current
server. In the following example, the statements display information about the
default server SHARE1, which is also the current server.
proc operate serverid=share1;
display server;
Quiescing a Server
You use the QUIESCE SERVER command to move a server from an active status to
a stopped status by gradually releasing libraries and users, and denying new requests
to access libraries through the server. Here is the syntax for this command:
QUIESCE SERVER;
server-ID
specifies the server to be terminated. If you do not specify a server ID, this
command gradually terminates the current server. For information about
specifying a server ID, see “Specifying a Server” on page 148.
SAPW= password | “encoded-password”
password
must be a valid SAS name that is 1 to 8 characters in length. The value for
this option is replaced by Xs in the log. To protect this password, you should
use the security software at your site to limit access to the SAS program
statements that create the server.
“encoded-password”
is an encoded version of a password. Using encoded passwords promotes
security and enables you to store SAS programs that do not contain clear-text
passwords.
To obtain an encoded password, specify the clear-text password as input to
the PROC PWENCODE statement. For details, see the Base SAS Procedures
Guide.
Here is an example of code for obtaining an encoded password:
proc PWENCODE in="srvmach";
run;
{sas001}c2Vydm1hY2g=
SET SERVER;
SET SERVER server-ID <(SAPW=password)>;
SET SERVER server-ID </ SAPW=password>;
server-ID
specifies the current server. For information, see “Specifying a Server” on page 148.
SAPW= password | “encoded-password”
password
must be a valid SAS name that is 1 to 8 characters in length. The value for
this option is replaced by Xs in the log. To protect this password, you should
use the security software at your site to limit access to the SAS program
statements that create the server.
“encoded-password”
is an encoded version of a password. Using encoded passwords promotes
security and enables you to store SAS programs that do not contain clear-text
passwords.
To obtain an encoded password, specify the clear-text password as input to
the PROC PWENCODE statement. For details, see the Base SAS Procedures
Guide.
Here is an example of code for obtaining an encoded password:
proc PWENCODE in="srvmach";
run;
{sas001}c2Vydm1hY2g=
In the following example, PROC OPERATE displays information about the server
libraries that are identified by LIB1 and LIB2 in the DISPLAY LIBRARY command.
These libraries are defined to the current server MYSHR. Next, the current server is
reset to SHARE, and information is displayed about the library LIBALPHA, which is
defined to the server SHARE.
proc operate serverid=share;
set server myshr;
display library lib1 lib2;
set server;
144 Restarting a Quiesced Server 4 Chapter 11
If you do not identify a server before you issue a command that acts on the current
server, PROC OPERATE issues the following message:
ERROR: PROC OPERATE is not currently set to any
server, so this command will be ignored. Use
the ’SET SERVER serverid;’ command to establish
communication with a server.
Stopping a Server
You use the STOP SERVER command to terminate a server immediately. If users
are currently reading from or writing to members in the server library, the server closes
the members and updates might be lost. The server releases the libraries held by each
user and disconnects each user. Here is the syntax for this command:
STOP SERVER;
STOP SERVER server-ID <(SAPW=password)>;
STOP SERVER server-ID </ SAPW=password>;
server-ID
specifies the name of the server to be terminated. If server-ID is not specified, this
command terminates the current server. For more information, see “Specifying a
Server” on page 148.
SAPW= password | “encoded-password”
password
must be a valid SAS name that is 1 to 8 characters in length. The value for
this option is replaced by Xs in the log. To protect this password, you should
use the security software at your site to limit access to the SAS program
statements that create the server.
“encoded-password”
is an encoded version of a password. Using encoded passwords promotes
security and enables you to store SAS programs that do not contain clear-text
passwords.
To obtain an encoded password, specify the clear-text password as input to
the PROC PWENCODE statement. For details, see the Base SAS Procedures
Guide.
Here is an example of code for obtaining an encoded password:
proc PWENCODE in="srvmach";
run;
{sas001}c2Vydm1hY2g=
---------------------------------------------------
USAGE USAGE USAGE CATALOG UPDATE
USAGE USAGE MODULE DATA INPUT
MEM MEMOBY DATA INPUT
In this example, MIKE(15) currently has files open in both of the libraries to
which he currently has access. If user MIKE(15) had no files opened when the
DISPLAY USER command was issued, only the first two parts of the output would
be displayed.
The SERVER LIBREF that is missing in the preceding output indicates that the
USER LIBREF MEM is not server-defined.
Aliases: DISP USER, D USER
_ALL_
restarts all users who are quiesced or stopped.
Alias: ST USER
Specifying a Server
A server-ID specifies a one- or two-level name for the server that you want to
manage. If you started the server, you should already know its name.
The server name must meet the criteria for a valid SAS name, but it can also include
the following special characters: dollar sign ($), at sign (@) and pound sign (#).
The operating environment and the access method that you specify for
communication between a server session and a user session might also impose
server-naming criteria. For complete server-naming details by operating environment,
see Communications Access Methods for SAS/CONNECT and SAS/SHARE.
Specifying a User
A user ID identifies a specific user or a specific connection to a server. A user ID can
be specified as a number, an identifying connection, or a case-sensitive name. A user ID
The OPERATE Procedure 4 Specifying a User 149
name must meet the criteria for a valid SAS name, but the ID can also include the
following special characters: dollar sign ($), at sign (@), and pound sign (#). The
operating environment on which the client runs can also impose user-naming criteria.
For details, see Communications Access Methods for SAS/CONNECT and
SAS/SHARE. The following are examples of user IDs:
maria
3
Each time a user accesses a SAS/SHARE server, the new connection is assigned a
number. A user is identified in the server SAS log and in PROC OPERATE output by a
combination of that number and the applicable user ID in the form user-ID(nnnn).
A USER command in which you specify a user connection number is restricted to
that user’s specific connection. For example, if Maria accesses the same server three
times, she is identified by the server as MARIA(3). To display information about that
connection only, you issue the following command:
display user 3;
A USER command in which you specify a user ID operates on all current connections
for that user. In addition, the QUIESCE, STOP, and START commands act on that
user’s future connections. For example, if Maria connects to the same server three
times and accesses the server a fifth time, the following command provides information
about both MARIA(3) and MARIA(5):
display user MARIA;
The following command terminates the maria(3) and maria(5) connections to the
server and prevents Maria from reconnecting to the server.
stop user maria;
150
151
CHAPTER
12
Remote SQL Pass-Through
(RSPT) Facility
PROC SQL;
CONNECT TO REMOTE <AS alias> (<options>);
SELECT object-item FROM CONNECTION TO server (dbms-select-expression);
EXECUTE (SQL-statement) BY server ;
DISCONNECT FROM server ;
152 PROC SQL Statement 4 Chapter 12
PROC SQL;
Syntax Description
AS alias
specifies an alias for the server.
Options
SERVER=server-ID | _ _port-number
specifies the name of the server. If the server is a multi-user server, server-ID is the
name specified in the ID= option in the PROC SERVER statement. If the server is a
single-user server that runs on a SAS/CONNECT server, server-ID is the name of the
SAS/CONNECT server. In either case, server-ID is the same server name that is
specified in the SERVER= option in a LIBNAME statement.
The TCP/IP access method enables you to specify syntax that uses two consecutive
underscores with a port number, in place of a server ID that has been defined in the
client TCP/IP SERVICES file.
Note: Do not space after the first underscore or the second underscore. 4
For port-number, specify a number that is greater than 1024 and that is not already
used in the TCP/IP SERVICES file.
SAPW=password | “encoded-password” | _PROMPT_
specifies the password for controlling user access to a multi-user server. The
password must be a valid SAS name and must be 8 characters or less in length. This
password is in the UAPW= option in the PROC SERVER statement. If the UAPW=
option is specified when the server is started, you must specify the SAPW= option in
a CONNECT TO REMOTE statement that specifies the same server.
password
must be a valid SAS name that is 1 to 8 characters in length. The value for this
option is replaced by Xs in the log. To protect this password, you should use the
Remote SQL Pass-Through (RSPT) Facility 4 CONNECT TO REMOTE Statement 153
security software at your site to limit access to the SAS program statements that
create the server.
“encoded-password”
is an encoded version of a password. Using encoded passwords promotes security
and enables you to store SAS programs that do not contain clear-text passwords.
To obtain an encoded password, specify the clear-text password as input to the
PROC PWENCODE statement. For details, see the Base SAS Procedures Guide.
Here is an example of code for obtaining an encoded password:
proc PWENCODE in="srvmach";
run;
{sas001}c2Vydm1hY2g=
“encoded-password”
is an encoded version of a password. Using encoded passwords promotes security
and enables you to store SAS programs that do not contain clear-text passwords.
To obtain an encoded password, specify the clear-text password as input to the
PROC PWENCODE statement. For details, see the Base SAS Procedures Guide.
Here is an example of code for obtaining an encoded password:
proc PWENCODE in="srvmach";
run;
{sas001}c2Vydm1hY2g=
is the key, which is used to decode the encoded password to its clear-text form
when the password is needed.
Note: The encoded password is case-sensitive. Use the entire generated output
string, including the key. 4
Use the output from the PROC PWENCODE statement as the value for
encoded-password in the appropriate statement.
DBMSARG=(dbms-argument-1=value ... <dbms-argument-n=value>)
specifies the arguments that are required by the server DBMS to establish the
connection. These are the same arguments that you would specify in a CONNECT
TO statement if you were connecting directly to the DBMS.
Syntax Description
object-item
specifies one or more columns or expressions. For more information, see the
documentation for the SELECT statement in the Base SAS Procedures Guide.
server
specifies the SAS SQL server or server DBMS where the data is stored. Here are the
valid values for server:
REMOTE
the server that is specified in the most recent CONNECT TO REMOTE statement
will be used.
alias
the server that you assigned the alias to (in the AS=alias option in the CONNECT
TO REMOTE statement) will be used. Specifying alias is useful if you are
connected to several SQL servers at the same time.
dbms-select-expression
specifies a SELECT expression that will be processed before the data is transmitted.
For server data that is accessed through the PROC SQL view engine,
dbms-select-expression is any valid PROC SQL SELECT statement. For a server
DBMS, dbms-select-expression is the same SQL query that you would specify if you
were connected directly to the DBMS. For more information about the PROC SQL
SELECT statement, see the documentation for the SELECT statement in the Base
SAS Procedures Guide.
156 EXECUTE... BY Statement 4 Chapter 12
EXECUTE... BY Statement
Submits SQL statements for server processing.
Syntax Description
SQL-statement
specifies an SQL statement for server processing. SQL-statement can be any valid
SAS SQL statement except SELECT. For a server DBMS that is accessed through a
single-user server in a SAS/CONNECT session, SQL-statement is the same SQL
statement that you would specify if you were connected directly to the DBMS.
server
specifies the server where the SQL statement will be processed. Here are the valid
values for server:
REMOTE
the server that is specified in the most recent CONNECT TO REMOTE statement
will be used.
alias
the server that you assigned the alias to (in the AS=alias option in the CONNECT
TO REMOTE statement) will be used. Specifying alias is useful if you are
connected to several SQL servers at the same time.
Syntax Description
server
specifies which server to disconnect from. Here are the valid values for server:
REMOTE
the server that is specified in the most recent CONNECT TO REMOTE statement
will be used.
Remote SQL Pass-Through (RSPT) Facility 4 Examples 157
alias
the server that you assigned the alias to (in the AS=alias option in the CONNECT
TO REMOTE statement) will be used. Specifying alias is useful if you are
connected to several SQL servers at the same time.
Examples
Here are examples of processing data by using RSPT.
The following program joins two server data sets (RSPT through a server).
proc sql;
connect to remote(server=sdcmvs.prx6xhsrv);
select *
from connection to remote
(select [Link] label=’ID Number’
[Link] label=’Job Code’
[Link] label=’City’
from [Link] s,
[Link] p
where [Link]=[Link]
orderby jobcode);
The following program uses RSPT to connect to a remote server to read data from a
DB2 table (accessing a server DBMS with RSPT).
proc sql;
connect to remote(server=[Link]
dbms=db2 dbmsarg=(ssid=db2));
select *
from connection to remote
(select flight#, orig, destination, delay
from educ.db2delay
where delay > 11);
158
159
CHAPTER
13
The LOCK Statement and the
LOCK Command
LOCK Statement
Places an exclusive lock on a specified data object.
See also: Chapter 5, “Locking SAS Data Objects,” on page 61
Syntax
LOCK
libref<.member-name<.member-type > | <.[Link]-type>
<LIST | CLEAR>>;
160 LOCK Statement 4 Chapter 13
Syntax Description
libref
specifies the name of a SAS library that is currently accessed through a SAS/SHARE
server.
member-name
specifies the name of a member in the library libref that is to be locked.
member-type
specifies the type of SAS file to be locked. Valid values are DATA, VIEW, and
CATALOG. The default is DATA.
If member-type is omitted or is specified as the value DATA or VIEW, two locks are
obtained: one lock on [Link] and the other lock on
[Link].
entry-name
specifies the name of the catalog entry to be locked.
entry-type
specifies the type of the catalog entry to be locked.
LIST
writes to the SAS log whether the specified data object is locked and by whom. This
argument is optional.
Aliases: QUERY, SHOW
CLEAR
releases a lock on the specified data object that was acquired by using the LOCK
statement in your SAS session. This argument is optional.
For more information about how and when a lock is released, see Chapter 5,
“Locking SAS Data Objects,” on page 61.
Examples
In the following example, the first LOCK statement acquires implicit locks on the SAS
library EDUCLIB and on the SAS catalog [Link]. It then acquires an
explicit lock on the catalog entry [Link]. The second
LOCK statement acquires an explicit lock on the catalog entry
[Link].
lock [Link];
lock [Link];
In the following example, the first LOCK statement that contains the argument
CLEAR releases the explicit lock on the catalog entry [Link], but it does not
release the implicit locks because an entry in the catalog is still locked. The second
LOCK statement that contains the argument CLEAR releases the explicit lock on the
catalog entry [Link]. Because no catalog entries remain locked, the second
statement that contains the argument CLEAR also releases the implicit lock on the
SAS catalog [Link]. Because no other members of the library are locked, it
also releases the implicit lock on the SAS library EDUCLIB.
/* Update the two catalog entries as needed. */
lock [Link] clear;
lock [Link] clear;
The LOCK Statement and Command 4 LOCK Command 161
LOCK Command
Places an exclusive lock on a specified data object.
See also: Chapter 5, “Locking SAS Data Objects,” on page 61
Syntax
LOCK
libref<.member-name<.member-type > | <.[Link]-type>
<LIST | CLEAR>>;
Syntax Description
libref
specifies the name of a SAS library that is currently accessed through a SAS/SHARE
server.
member-name
specifies the name of a member of the library libref that is to be locked.
member-type
specifies the type of the SAS file to be locked. Valid values are DATA, VIEW, and
CATALOG. The default is DATA.
If member-type is omitted or is specified as the value DATA or VIEW, two locks are
obtained: one lock on [Link] and the other lock on
[Link].
entry-name
specifies the name of the catalog entry to be locked.
entry-type
specifies the type of the catalog entry to be locked.
LIST
writes to the SAS log whether the specified data object is locked and by whom. This
argument is optional.
Aliases: QUERY, SHOW
CLEAR
releases a lock on the specified data object that was acquired by using the LOCK
statement in your SAS session. This argument is optional.
For more information about how and when a lock is released, see Chapter 5,
“Locking SAS Data Objects,” on page 61.
Examples
The following LOCK command locks SAS catalog entries of type CMAP. The SAS log
will show that one catalog entry has already been locked.
lock [Link]
162 LOCK Command 4 Chapter 13
The following LOCK command releases the lock on the catalog entry [Link].
The SAS log will show that the lock on this catalog entry has been released and by
whom.
lock [Link] clear
163
CHAPTER
14
SAS/SHARE Macros
SHRMACS Macro
Compiles other SAS/SHARE macros.
Note: The SHRMACS macro must be invoked before invoking any other
SAS/SHARE macro. 4
Category: None
Syntax
%SHRMACS (category,< log-info>,<APPLSYS=app-sys-lib-tab...>,<SASSAML=app-sys-
lib-tab...>);
Syntax Description
category
specifies the category of macros to be compiled. For details, see “Macros Generated
by the SHRMACS Macro” on page 79.
Valid Values: USER, SERVER, OPER, ALL
log-info
specifies whether descriptive information about each macro is written to the SAS log.
MSG displays the SAS/SHARE macros that are generated and the function of each
164 SHRMACS Macro 4 Chapter 14
Details
The SHRMACS macro also loads the applications systems tables that associate aliases
with server names and associate libraries with aliases. These tables are used to
generate the server name for the PROC SERVER, PROC OPERATE, and LIBNAME
statements. Based on what is specified in the first argument, the server-alias and
library-alias tables can be written to the SAS log if you specify the MSG or the HELP
argument in the SHRMACS macro. For example,
%shrmacs(user);
%shrmacs(user,help);
%shrmacs(oper,help);
%shrmacs(server,msg);
%shrmacs(all,msg);
Early in its execution, the SHRMACS macro invokes PROC SQL to obtain the
current settings of the SAS options NOTE, SOURCE2, and LINESIZE= and saves them
in macro variables that are named _NOTES_, _SRC2_, and _LS_, respectively. The
original values of these options are restored after the settings have been changed by
SHRMACS or other SAS/SHARE macros. You can avoid the overhead of this PROC SQL
step by explicitly setting the macro variables to the values that you want. For example:
%let _notes_=notes;
%let _src2_=nosource2;
%let _ls_=70;
SAS/SHARE Macros 4 LIBDEF Macro 165
LIBDEF Macro
Generates a LIBNAME statement.
Category: User
Syntax
%LIBDEF (libref,< SAS-library>,<READONLY>,<RETRY>,< ENGINE=local-
engine>,<RENGINE=remote-engine>,<RMTVIEW=remote-engine-RMTVIEW=-
option>>,<SLIBREF=server-library>, <uapw>, < APPLSYS=appl-sys-lib-table>);
Syntax Description
READONLY
specifies that the server library can be accessed in read-only mode.
RETRY
If a LIBNAME statement that specifies the SERVER= option fails, %LIBDEF
generates a LIBNAME statement without the SERVER= option.
ENGINE=local-engine
specifies the local engine to be used in the user’s session to access the server library.
Omit this parameter unless you need to override the default engine.
Default: REMOTE
RENGINE=remote-engine
specifies the remote engine to be used in the server session to access the library. SAS
chooses an appropriate engine. Omit this parameter unless you need to override the
engine that is chosen by SAS.
Default: No default
RMTVIEW=remote-engine-RMTVIEW=-option
specifies the value of the REMOTE engine’s RMTVIEW= option in the LIBNAME
statement that is generated by the LIBDEF macro. You can use the RMTVIEW
parameter to override the default value of the RMTVIEW option for a specific library.
This parameter overrides the RMTVIEW= parameter in the SERVINFO and
SERVLIB macros.
SLIBREF=server-library
specifies the libref that references the specified library in the server session. If this
parameter is specified, the generated LIBNAME statement will include the
SLIBREF= option. This parameter overrides any value that is specified for the
SAS-data-library argument in the LIBDEF macro statement.
uapw
specifies that a user can access the server only by supplying a password.
APPLSYS=appl-sys-lib-table
specifies a new application system library table to be loaded. This argument is
ignored if the table has already been specified in the SHRMACS call or in a previous
LIBDEF call.
166 LISTLIB Macro 4 Chapter 14
Details
The LIBDEF macro generates a LIBNAME statement to define a SAS library that
will be accessed locally or through a server. The server administrator can specify a
physical name or a reserved libref in the APPLSYS macro library. If a physical name is
specified, the server administrator must specify that name as the second argument in
this macro; the physical name should not be enclosed in quotation marks. If a libref is
specified, the second argument (the physical name) is omitted.
If you specify a physical name that is not specified in the APPLSYS macro library, a
LIBNAME statement is generated without the SERVER= option.
After executing the LIBDEF macro, the automatic macro variable SYSLIBRC
contains the return code from the LIBNAME statement. For more information, see the
section about automatic macro variables in SAS Macro Language: Reference.
Examples
Here are three examples using the LIBDEF macro:
%libdef(mylib,SAS-data-library,applsys=qa);
%libdef(perm,SAS-data-library,readonly,retry,myuserpw);
%libdef(datalib);
LISTLIB Macro
Lists the current library-alias table.
Category: Operator, Server, User
Syntax
%LISTLIB <FULL>;
Syntax Description
FULL
an optional argument that writes the values that are specified for the SERVLIB
macro parameters to the SAS log. For more information about using the SERVLIB
macro parameters, see “Associating SAS Libraries with Server Aliases (SERVLIB)”
on page 83.
Details
The LISTLIB macro writes the library-alias table that is currently in use to the SAS
log. It shows the server alias that is associated with each SAS library.
SAS/SHARE Macros 4 OPERATE Macro 167
LISTSRV Macro
Lists the server-alias table.
Syntax
%LISTSRV;
Details
The LISTSRV macro writes the server-alias table to the SAS log. It shows the server
ID that is associated with each defined alias.
LISTSRVI Macro
Lists the server information table.
Syntax
%LISTSRVI;
Details
The LISTSRVI macro writes the server information table to the SAS log. It shows
the REMOTE engine’s LIBNAME statement option RMTVIEW= and the network node
name, by default.
OPERATE Macro
Generates a PROC OPERATE statement.
Category: Operator
Syntax
%OPERATE(server-name,< oapw>);
168 SERVERID Macro 4 Chapter 14
Syntax Description
server-name
specifies the server name, which can be an alias or an actual server ID. This value
identifies the server to be controlled.
oapw
specifies the administrator password if one is required by the server. This value is
mapped to the SAPW= option in the PROC OPERATE statement.
Details
The OPERATE macro invokes the OPERATE procedure for a server that is identified
by the server-name argument.
SERVERID Macro
Converts a server alias to a server ID.
Category: Operator, Server, User
Syntax
%SERVERID(server-alias, <NEQ>);
Syntax Description
server-alias
The SERVERID macro converts the server-alias to an actual server ID in the
SERVER= option in the SERVER and OPERATE procedures and LIBNAME
statements.
NEQ
supplies only the server ID value (without the SERVER= option).
Details
Additionally, the SERVERID macro generates a %LET statement for a macro variable
whose name is the high-level qualifier in a two-level server name in the following form:
%LET high-level-qualifier=network-node;
SAS/SHARE Macros 4 SERVINFO Macro 169
Examples
The server name must be listed in the server information table and have a network
node name associated with it, as shown in the following examples:
libname mylib ’SAS-data-library’ %serverid(devserv);
The first example generates the LIBNAME statement, which supplies the
SERVER=server-ID parameter. The second example generates a SET SERVER
statement, which supplies only the server-ID without the SERVER= parameter keyword.
SERVIIDX Macro
Returns the index of the entry for the specified server in the server identification table.
Category: Operator, Server, User
Syntax
%SERVIIDX(server-name);
Details
The SERVIIDX macro requires a server name and returns the index for that server
entry in the server information table. You can use this index to access the fields in the
table entry.
Note: server-name cannot be specified as an alias. 4
SERVINFO Macro
Adds server attributes to the server information table.
Category: None
Syntax
%SERVINFO(two-level-server-name,< RMTVIEW=REMOTE-engine-RMTVIEW=-option>,
<NETNODE=network-node-name)>;
Syntax Description
Usually, the SERVINFO macro is used in the member SERVERID in the APPLSYS
macro library.
170 SERVLIB Macro 4 Chapter 14
A server information table is created to contain information about the servers at your
site. You can use this information in a program, or you can display it. By default, the
table contains the following type of information:
3 a default value for the REMOTE engine’s RMTVIEW= option in the LIBNAME
statement
3 a network node name that is represented by a fully-qualified node name (for
example, [Link]).
You can also use the server information table to specify other characteristics of a
server, its users, or its administrators, such as server access passwords, PROC SERVER
statement options, and which release of SAS the server is running under. Here are the
optional arguments to %SERVINFO:
RMTVIEW=
specifies a default value for the REMOTE engine’s RMTVIEW= option in the
LIBNAME statement. If you specify this parameter, the LIBDEF macro, by default,
generates the RMTVIEW=value for any LIBNAME statement that specifies this
server. This parameter is overridden by the RMTVIEW= parameter in the SERVLIB
and LIBDEF macros.
NETNODE=
specifies a network node name that is represented by the high-level qualifier in a
two-level server name. When a two-level server name is specified in a PROC
OPERATE or a LIBNAME statement and the high-level qualifier cannot be found as
a network node, the server name is treated as the name of a macro variable whose
value is the node name. This substitution is useful when the node name is not a
valid SAS name. If you specify NETNODE= in the server information table, the first
time that it translates an alias for that server ID %SERVERID generates the
following code in an application:
%LEThigh-level-qualifier=network-node;
high-level-qualifier is the high-level qualifier in the server ID that is specified in
the positional parameter and network-node is the value of NETNODE=.
If the high-level qualifier in the server ID is also the high-level qualifier in the full
network node name, you can omit it from the value of NETNODE= by using a period
(.) at the beginning of the NETNODE= value. For example, if the server SHRSERV
runs on [Link], you would specify the following:
%servinfo ([Link],netnode=[Link]);
SERVLIB Macro
Adds server-library pairs to the library table.
Category: None
Syntax
%SERVLIB(SAS-library-name,
server-name< RMTVIEW=REMOTE-engine-RMTVIEW=-option>,
SAS/SHARE Macros 4 SERVLIB Macro 171
<PHYSNAME=physical-name-of-library>,<SLIBREF=server-libref>,
<ENGINE=engine-in-user-session>, <RENGINE=engine-in-server-session>);
Syntax Description
The SERVLIB macro adds new libraries to the library table in the APPLSYS macro
library in the form SAS-library-name, server-name. How you specify the SAS library
name is based on your operating environment. Here are the optional arguments to
%SERVLIB:
RMTVIEW=
specifies the value of the REMOTE engine’s RMTVIEW= option in the LIBNAME
statement that is generated by the LIBDEF macro. You can use the RMTVIEW=
parameter in the SERVLIB macro to specify the default value of the RMTVIEW=
option for a specific library. This parameter overrides the RMTVIEW= parameter in
the SERVINFO macro; but, is overridden by the RMTVIEW= parameter in the
LIBDEF macro.
PHYSNAME=
specifies the physical name of a library. This parameter is used by the STRTSRV
macro to generate a LIBNAME statement in the server session. If this parameter is
used and the SLIBREF= parameter is not used, the first positional parameter in
%SERVLIB is assumed to be the server libref. If both PHYSNAME= and SLIBREF=
are specified, the first positional parameter is not used for generating the LIBNAME
statement. Instead, the first positional parameter can be used as a description of the
library that is specified in place of the physical name when the LIBDEF macro is
invoked in the application.
SLIBREF=
specifies the library’s libref in the server session. This parameter is used by the
STRTSRV macro to generate a LIBNAME statement in the server session. If this
parameter is used and the PHYSNAME= parameter is not used, the first positional
parameter in %SERVLIB is assumed to be the physical name of the library. If both
PHYSNAME= and SLIBREF= are specified, the first positional parameter is not used
for generating the LIBNAME statement. Instead, the first positional parameter can
be used as a description of the library that is specified in place of the physical name
when the LIBDEF macro is invoked in the application.
ENGINE=
specifies the engine to be used in the user session to access the library. The default is
ENGINE=REMOTE. Omit this parameter unless you need to override the engine
that is chosen by SAS.
RENGINE=
specifies the engine to be used in the server session to access the library. There is no
default for this option. SAS chooses an appropriate engine. Omit this parameter
unless you need to override the engine that is chosen by SAS.
For more information about the SERVLIB macro, see “Associating SAS Libraries with
Server Aliases (SERVLIB)” on page 83 and comments in the APPLSYS macro library.
172 SETSRV Macro 4 Chapter 14
SETSRV Macro
Generates a SET SERVER statement.
Category: Operator
Syntax
%SETSRV (server-name, <oapw>);
Syntax Description
server-name
specifies the name of a server. The server name can be an alias or an actual server ID.
oapw
specifies the operator-access password to be specified in the SAPW= option in the
SET statement.
Details
The SETSRV macro generates a SET SERVER statement in an OPERATE procedure
for a SAS server that is specified by using the server-name argument.
SHUTSRV Macro
Stops a server.
Category: Operator
Syntax
%SHUTSRV(server-name, < oapw>);
Syntax Description
server-name
specifies the server name. The name can be an alias or an actual server ID.
oapw
specifies the operator-access password to be mapped to the SAPW= option in the
PROC OPERATE statement.
Details
The SHUTSRV macro invokes the OPERATE procedure to terminate the server that
is specified in the server-name argument.
SAS/SHARE Macros 4 STRTSRV Macro 173
STRTSRV Macro
Starts a server.
Category: Server
Syntax
%STRTSRV(server-name, < options>, <uapw>, <oapw>);
Syntax Description
server-name
specifies the server name. The name can be an alias or an actual server ID.
options
specifies any PROC SERVER statement options. Use blank spaces to separate
options. For information about the PROC SERVER options, see Chapter 9, “The
SERVER Procedure,” on page 107.
uapw
specifies the user-access password.
oapw
specifies the operator-access password to be mapped to the UAPW= and OAPW=
options, respectively, in the PROC SERVER statement.
Details
The STRTSRV macro invokes the SERVER procedure. %STRTSRV generates a
LIBNAME statement for each library in the current library table for the server that is
being started (either directly or through an alias) for which either the SLIBREF= or the
PHYSNAME= parameters in %SERVLIB have been specified. For information about
%SERVLIB, see “SERVLIB Macro” on page 170. Using %STRTSRV to define a library
to the server at start-up automates the change to server start-up when the library is
moved to another server.
The STRTSRV macro also generates a LIBNAME statement for each library that is
listed in the current library-alias table for the server that is being started.
174
175
CHAPTER
15
SAS/SHARE General SAS System
Options
Syntax
COMAMID=access-method-ID
Syntax Description
access-method-ID
specifies the name of the communications access method that is used by a client to
access a server.
Details
The COMAMID= system option specifies a communications access method that is used
by a SAS/SHARE client to connect to a SAS/SHARE server.
For find out about the supported access methods by operating environment (for
example, to connect a Windows client to a UNIX server, use the TCP/IP access method),
see Communications Access Methods for SAS/CONNECT and SAS/SHARE.
176 COMAUX1= System Option 4 Chapter 15
Client: Optional
Server: Optional
Client: Valid in: configuration file, SAS invocation
Server: Valid in: configuration file, SAS invocation
Category: Communications : Networking and Encryption
PROC OPTIONS Group: Communications
Syntax
COMAUX1=name
Details
The COMAUX1= option specifies the first auxiliary communication access method. For
example, you can specify COMAMID=XMS and COMAUX1=TCP. These specifications
indicate that the primary method of communication is cross-memory services. If this
access method is unable to establish a connection, TCP/IP communication is attempted.
If the COMAUX1= option is specified in a destination (server) session, it defines
additional communication support to be initialized. In an originating (user) session, it
specifies that the communication access method should try to connect to the destination
session if the initial COMAMID-based attempt is unsuccessful.
Client: Optional
Server: Optional
Default: 32K
Client: Valid in: configuration file, OPTIONS statement, SAS invocation
Server: Valid in: OPTIONS statement
Category: Communications : Networking and Encryption
PROC OPTIONS Group: Communications
Syntax
TBUFSIZE=value
SAS/SHARE General SAS System Options 4 SHARESESSIONCNTL= System Option 177
Syntax Description
value
specifies the suggested size of a buffer that the server uses for transmitting
information to or receiving information from a client.
Details
The TBUFSIZE= option specifies the suggested size of a buffer that the server uses for
transmitting information to or receiving information from a client. When this option is
not specified in the PROC SERVER statement, the value of the TBUFSIZE= SAS
system option, if specified, will be used.
Syntax
SHARESESSIONCNTL= SERVER | ENV
Syntax Description
SERVER
creates a single connection between the SAS/SHARE client and the SAS/SHARE
server. A typical connection occurs when a client uses a LIBNAME statement to
access data from a library on the computer that the SAS/SHARE server runs on.
This is the default.
ENV
in a SAS Intelligence Platform environment, creates a connection between each SAS
client that accesses data from SAS/SHARE server library via another SAS server. An
example of a SAS/SHARE server connection in the SAS Intelligence Platform
environment might involve several SAS Enterprise Guide clients that request data
sources from a SAS/SHARE server via a SAS Workspace Server. Each SAS
Enterprise Guide client (and other SAS clients) will establish a separate connection
to the SAS/SHARE server via the workspace server. Maintaining separate client
connections to a SAS/SHARE server ensures security and simplifies client
administration.
178 SHARESESSIONCNTL= System Option 4 Chapter 15
Details
This option is useful in a SAS Intelligence Platform environment in which the
administrator wants to maintain a separate security context for each SAS client (such
as a SAS Enterprise Guide client) that connects to the SAS/SHARE server.
The SHARESESSIONCNTL= option should be specified only in the SAS session of
the SAS server that will connect to the SAS/SHARE server. The option is effective
when it is specified in the SAS configuration file or in an OPTIONS statement in the
SAS server session and when it is executed before the SAS server completes its
initialization and connection to the SAS/SHARE server. The SHARESESSIONCNTL=
option should not be specified while the SAS server is already connected to a
SAS/SHARE server. Otherwise, this note is written to the SAS log:
The Remote engine is active.
The SHARESESSIONCNTL setting is referenced only if the engine is reloaded.
The REMOTE engine is active for the duration of the SAS client connections to the
SAS/SHARE server. The REMOTE engine is unloaded after all client connections to a
SAS/SHARE server are terminated. The REMOTE engine is reloaded when subsequent
SAS clients connect to the SAS/SHARE server.
179
3
P A R T
Appendix
APPENDIX
1
Cross-Architecture Access
Cross-Architectural Differences
3 The internal data representations are different.
Cross-architecture access is used when the client session and the server session are
running on machines that internally represent data differently due to hardware
differences between two machines. For example, IBM mainframe machines represent
floating-point numbers differently than computers that use Intel CPUs. The code pages
that are used to represent character data also vary. For example, EBCDIC and ASCII
are two major character-encoding methods.
3 The C-language compilers that are used are different.
Different operating environments and C-language compilers also cause differences in
data representation due to the varied alignment requirements of aggregate data types,
such as the inter-element padding in a specific C structure. Also, two compilers for the
same type of CPU might implement simple data types that have different lengths.
3 Operating environments are the same, but the machine architectures are different.
It might not always be obvious when the cross-architecture feature of SAS/SHARE is
required. z/OS to CMS access is not cross-architecture because the underlying
representation of data in the two operating environments is the same. However,
sharing data between OpenVMS for VAX and OpenVMS for AXP uses cross-architecture
access because data is represented differently on the Digital VAX and Alpha AXP
architectures, even when the same operating environment is used. For complete details
about architectural compatibility, see “Identical Architectural Groups” on page 190.
Note: Although neither CMS nor OpenVMS VAX are supported in later versions of
SAS, they are included in the preceding example for backward compatibility. 4
on whether the catalog on the server has been modified since the last read by the
cross-architecture client. If more than three cross-architecture catalogs are imported,
the least recently used catalog is deleted to make room for the most recently used
catalog.
The CONTENTS and the CATALOG procedures can be used to examine the imported
catalogs in the WORK library. The DATASETS procedure can be used to delete these
catalogs.
You might want to assign the cache to a different SAS library in order to accomplish
the following:
3 minimize activity in the library WORK on the server so that other scratch uses of
that library (such as temporary sort files) are not competing for space.
3 dedicate a specific amount of space to the cache. The allotted space might be
especially large or limited to a modest size by site considerations.
3 save the SAS catalog files in transport format when the SAS/SHARE server is
stopped, so that you can avoid having the server repeatedly translate catalogs into
transport format.
Although the server caches a maximum of three transport files, an administrator can
change the default. The ALLOCATE LIBRARY command, issued in the SERVER
procedure, has a CATCACHELIMIT option in which you can specify the number of
catalogs that are stored in the library SASCATCA. For details, see “Syntax for the
ALLOCATE LIBRARY Command” on page 121.
Catalog concatenation on the server can be an advantage if you have many small
catalogs that will be accessed simultaneously. Having all of the catalogs concatenated
under one name enables the client to keep that catalog in the library WORK. Having a
single concatenated catalog reduces the possibility of thrashing, which can result if the
client needs more than three catalogs in the library WORK. Thrashing occurs when
catalogs are deleted and then retrieved.
variables, translation occurs when their character representations differ. Values are
dynamically translated directly from the source representation to the target
representation; they do not pass through transport format. Translation occurs both
when data flows from the server to the client and when it flows from the client to the
server. Therefore, data that flows across architectures from a server to a client and is
then sent back to the server is translated twice.
For all operating environments that SAS/SHARE runs on, the REMOTE engine
performs all data translations that are necessary in order to converse with the server.
The REMOTE engine translates outgoing data to the server format, and translates
incoming data from the server to its own format. The administrative procedure, PROC
OPERATE, works in the same way.
Note: For all SAS/SHARE clients other than SAS sessions, such as the SAS ODBC
driver, data translation occurs on the server, not on the client. 4
A loss of magnitude is unlikely in many applications, but if you have data with
extremely large values or extremely small fractions, you might experience a loss of
magnitude during cross-architecture access. When you lose magnitude, SAS changes
the values that are out of range to the maximum or minimum value that the operating
environment can represent.
Example
You create a data set under UNIX that contains the value 8.93323E+105. If you copy
the file to a z/OS operating environment, magnitude is lost and the value changes to
7.23701E+75, which is the maximum value that z/OS can represent.
Character-Translation Tables
Note: The use of translation tables is relevant only when you use the following:
3 SAS 8 and SAS 9.2 cross-release access
3 thin client and SAS 9.2 server access
4
The tables that are used for character translation in SAS/SHARE are stored in SAS
catalog entries of type TRANTAB. Each of these catalog entries contains two
translation tables. The first table is for import translation, and the second table is for
export conversion. For example, the EBCDIC/ASCII-OEM translation entry under z/OS
contains an import table for ASCII-OEM to EBCDIC translation and an export table for
EBCDIC to ASCII-OEM translation.
EBCDIC/ASCII-ISO _0000030
EBCDIC/ASCII-ANSI _0000060
EBCDIC/ASCII-OEM _00000A0
EBCDIC/ASCII-MAC _0000120
ASCII-ISO/ASCII-ANSI _0000050
ASCII-ISO/ASCII-OEM _0000090
ASCII-ISO/ASCII-MAC _0000110
ASCII-ANSI/ASCII-OEM _00000C0
ASCII-ANSI/ASCII-MAC _0000140
ASCII-OEM/ASCII-MAC _0000180
server. However, the SAS/SHARE server is responsible for the data translations that
occur between that server and all SAS/SHARE clients other than SAS sessions.
SAS site administrators can use the TRANTAB procedure to replace or update the
translation tables. For details, see the TRANTAB procedure and the TRANTAB=
system option in the SAS National Language Support (NLS): User’s Guide.
CAUTION:
Do not attempt to update a translation table in a client session while accessing the
SAS/SHARE server that the translation table will be applied against. You cannot ensure
that the new version of the table will be used for subsequent translations. 4
The contents of the copied data sets in ZOO are not guaranteed to be identical to the
contents of the original data sets in ROO because the data sets in ZOO have been
translated twice. First, the data is translated from server representation to client
representation, then from client representation back to server representation.
As another example, suppose you are using the FSEDIT procedure to edit a data set
across architectures. You enter a DUP command and then modify the variable X before
saving the new record. You might find that, other than the value of the variable X, the
new record is not identical to the old record. The original values of the duplicated
record have been translated twice, from server-machine format to client-machine format
and back to server-machine format. The new value that was entered for the variable X
has been translated only one time, from user-machine format to server-machine format.
Note: When editing or updating a data set across architectures by using the
FSEDIT procedure, the FSVIEW procedure, or the MODIFY statement in the DATA
step, any variables that are not updated in an updated observation are exempt from
translation and will be unaltered. 4
u Parsing the string "-6.14" on z/OS produces a binary IBM representation of -6.14.
v Parsing the string "-6.14" on Windows produces a binary IEEE representation of
-6.14.
w The WHERE clause, which contains the Windows binary IEEE value, is sent to z/
OS via RLS, the IEEE representation of -6.14 is converted to its closest binary IBM
equivalent. However, when an IEEE binary representation of -6.14 is converted into
IBM format, the result is different from the IBM binary value that was obtained by
parsing and converting the string on z/OS.
The clause where RUE_H < -6.14 finds four observations because the binary IBM
value that is obtained by converting the binary IEEE value is slightly smaller than the
binary IBM value that was stored in the data set when "-6.14" was originally parsed.
Although you might expect the WHERE clause to return no observations, it returns
four observations because of the lack of precision that occurs when converting data
across operating environments.
To avoid cross-architecture problems, you could change the code so that PROC SQL is
remotely submitted to execute in the server session on z/OS. The text value, "-6.14", in
the WHERE clause would be parsed and converted on z/OS and would result in the
same binary representation that was used in the original data set, which was also
parsed and converted in the server session on z/OS. Therefore, the WHERE clause
would return no observations, as expected.
190 Identical Architectural Groups 4 Appendix 1
rsubmit;
proc sql;
create table xx2 as
select RUH_H
from test1.test_4
where RUE_H < -6.14 ;
quit;
endrsubmit;
3 CMS
3 z/OS
3 AIX
3 HP-UX
3 Solaris 2
3 SGI
Cross-Architecture Access 4 Incompatible Operating Environments 191
3 AIX 64
3 HP 64
3 HP-UX/Itanium
3 Solaris 64
3 Windows Vista
3 Windows XP
3 Windows NT
3 Windows 2000
3 Windows 98
3 Windows 95
3 RedHat Linux/Intel
3 IABI+ hosts
3 CMS
3 z/OS
3 AIX
3 AIX 64
3 Compaq Tru64 UNIX (formerly Compaq’s DIGITAL UNIX)
3 HP-UX
3 HP 64
3 HP-UX/Itanium
3 Intel ABI+ hosts
3 OpenVMS Alpha
3 OpenVMS Alpha 64
3 OS/2
3 RedHat Linux/Intel
3 SGI
3 Solaris 2
3 Solaris 64
3 Windows XP
Cross-Architecture Access 4 SAS 9.2 Numeric Architecture Groups 193
3 Windows NT
3 Windows 2000
3 Windows 98
3 Windows 95
3 Windows/Itanium
Translation of numeric data is necessary between some of these operating
environments because byte-ordering or alignment requirements are different. However,
because they all use the same number of exponent and mantissa bits, loss of precision
or range does not occur.
3 z/OS
194 Character Architectural Groups 4 Appendix 1
3 AIX 64
3 Compaq Tru64 UNIX (formerly Compaq’s DIGITAL UNIX)
3 HP 64
3 HP-UX/Itanium
3 OpenVMS Alpha 64
3 OpenVMS Intel 64
3 OSF Alpha
3 RedHat Linux/Intel
3 RedHat Linux/Itanium
3 RedHat Linux/Intel 64
3 Solaris 64
3 Solaris 64/Intel 64
3 Windows XP
3 Windows NT
3 Windows 2000
3 Windows/Itanium
Translation of numeric data is necessary between some of these operating
environments because byte-ordering or alignment requirements are different. However,
because they all use the same number of exponent and mantissa bits, loss of precision
or range does not occur.
3 CMS
3 z/OS
Cross-Architecture Access 4 ASCII-OEM Format Operating Environment 195
3 AIX
3 AIX 64
3 Compaq Tru64 UNIX (formerly Compaq’s DIGITAL UNIX)
3 HP-UX
3 HP-UX 64
3 HP-UX/Itanium
3 Intel ABI+ hosts
3 OpenVMS Alpha
3 OpenVMS Alpha 64
3 OpenVMS VAX
3 RedHat Linux/Intel
3 SGI
3 Solaris 2
3 Solaris 64
3 Windows XP
3 Windows NT
3 Windows 2000
3 Windows 98
3 Windows 95
3 Windows/Itanium
3 OS/2
Note: Because SAS 9.2 uses execution-time session encoding, operating
environments cannot be meaningfully grouped according to character representation for
SAS 9.2. 4
196
197
APPENDIX
2
Creating the SAS/SHARE Server
Environment
LOG=
specifies a destination to which the SAS log is written in batch mode. The default
is SYS$PRINT (the default printer queue) or SYS$OUTPUT (the default output
stream).
LOGPARM=
controls when SAS log files are opened and closed.
For details, see system options in the SAS Companion for OpenVMS.
Use the SUBMIT command to start the server during start-up of your OpenVMS
operating environment or start a server by executing a command.
Because of its nature, a server usually runs in a detached process. Instead of
executing the RUN command directly during system start-up or at other times, you
should execute the RUN command in a batch command file that you submit with the
SUBMIT/USER= command. This ensures that the server is created with appropriate
privileges and file access authority. The SUBMIT/USER= command requires the
CMKRNL privilege.
Here is the syntax of the SUBMIT command:
$ SUBMIT/USER=user-name batch-filename
user-name
specifies the name of the user that executes the batch job that creates the process
in which the server runs.
batch-filename
specifies the batch job to be executed. The purpose of the batch job is to create a
detached process in which the server executes. Therefore, this batch job usually
consists of one RUN command. For example:
$ RUN /DETACHED -
/AUTHORIZE -
/INPUT=command-input-file -
/OUTPUT=command-output-file -
/ERROR=error-file -
/PROCESS_NAME=process-name -
/SYS$SYSTEM:[Link]
command-input-file
specifies the name of the file that contains the commands that are executed in the
detached process. For details about the contents of this file, see “Creating a
Command File for the Server” on page 199.
Note: This file must also contain device or directory specifications. If the file
does not contain these specifications, then the detached process might fail. 4
output-file
specifies the name of the file to which the record of the execution of the detached
process is written. This file should be accessible to any administrator of the server
and to developers of applications that use the server. This file contains any
information that is written to SYS$OUTPUT.
Note: This file must also contain device or directory specifications. If the file
does not contain these specifications, then the detached process might fail. 4
error-file
specifies the file to which OpenVMS errors are written. This should be accessible
to any administrator of the server and to developers of applications that use the
server. This file contains information that is written to SYS$ERROR.
Note: This file must also contain device or directory specifications. If the file
does not contain these specifications, then the detached process might fail. 4
Creating the SAS/SHARE Server Environment 4 Starting a Server Using a Started Task 201
process-name
specifies a descriptive name of the detached process in which the server executes.
This value can be the same as the server name that you specify for the
SERVERID= option in the PROC SERVER statement.
entry
is the value that is specified for the ENTRY= parameter in the cataloged
procedure that is used to invoke SAS from a batch job. This procedure was
created when Base SAS was installed.
ID=id
is the server name (default or otherwise) that is passed to the PROC
statement in the STRTSRV macro.
SERVOPT=’ ’
can be any valid option in the PROC SERVER statement. For information
about PROC SERVER options, see Chapter 9, “The SERVER Procedure,” on
page 107.
UAPW=uapw
is the user-access password for the server.
202 Starting a Server Automatically 4 Appendix 2
OAPW=oapw
is the operator (or server administrator) password for the server.
2 Notice that the PARM= parameter uses the macro STRTSRV to start a server.
%STRTSRV is a standard SAS/SHARE autocall macro. For more information, see
“Using Macros for Server Library Access” on page 77 and “STRTSRV Macro” on
page 173. Alternatively, you can use the SERVER macro to start a server.
%SERVER executes faster than %STRTSRV. For more information, see Chapter 9,
“The SERVER Procedure,” on page 107.
To use %SERVER instead of %STRTSRV in the PARM= parameter, change the
EXEC statement as follows:
// PARM=’IS=’’%SERVER(&ID,&SERVOPT,&UAPW,&OAPW)’’’
3 After the member SERVER that contains this JCL has been created, the console
operator issues the following command to create the server as a started task:
START SHRSTART
6 To enter the default PROC SERVER options that are indicated in the SERVOPT=
parameter in the JCL, enter the following:
START SHRSTART,SERVOPT=’options’
7 To override the user- and operator-access passwords in the START command and
to override those that are specified in the UAPW= and OAPW= parameters in the
JCL, enter the following:
START SHRSTART,UAPW=uapw,OAPW=oapw
8 To enter all of these specifications in one START command and to override those in
the JCL, enter the following:
START SHRSTART,ID=server-ID,SERVOPT=’options’
UAPW=uapw,OAPW=oapw
This method creates a server in the same way each time the program runs.
SVC0SVC=
SVC0R15=
The SAS SVC Routine 0 is required for SAS/SHARE. You must specify the SAS
system options SVC0SVC= and SVC0R15= to accurately reflect the way the SVC
was installed. Get this information from the person who installed Base SAS.
SYNCHIO
specifies whether synchronous IO is enabled.
CAUTION:
Do not specify the SYNCHIO option. The SYNCHIO option prevents SAS/SHARE
servers from working properly. NOSYNCHIO is the default. 4
VMCTLISA
specifies the size of the initial storage allocation (ISA) for SAS memory
management and control blocks.
VMPAISA
specifies the size of the ISA for permanent memory above the 16-Mb line.
VMPAOSA
specifies the size of the overflow storage allocation (OSA) for permanent memory
above the 16-Mb line.
VMTAISA
specifies the size of the ISA for temporary memory above the 16-Mb line.
VMTAOSA
specifies the size of the OSA for temporary memory above the 16-Mb line.
VMPBISA
specifies the size of the ISA for permanent memory below the 16-Mb line.
VMPBOSA
specifies the size of the OSA for permanent memory below the 16-Mb line.
VMTBISA
specifies the size of the ISA for temporary memory below the 16-Mb line.
VMTBOSA
specifies the size of the OSA for temporary memory below the 16-Mb line.
For details, see information about system options in the SAS Companion for z/OS.
nohup
causes the associated SAS process to ignore HUP or HangUp signals that are sent
from the operating system.
sas
specifies a site-specific path to the SAS executable that initiates the process.
-sysin sas-input-file
specifies the file that contains the SAS statements to start a server. For
information about the content of this file, see Chapter 3, “Managing a SAS/SHARE
Server (Server Administrators),” on page 29.
-noterminal
specifies that no physical terminal is associated with this process.
-logparm "write=immediate"
writes server log messages to the server log immediately (without buffering).
-log "/u/system/server%[Link]"
directs all log messages to the log file that is named by replacing %W with the
current numeric week of the year.
For example, [Link] identifies a log that was generated during the
second week of the year.
-logparm "rollover=auto"
if the pathname of the log file changes (for example, when %W is used to name
weekly logs), the log is automatically saved in the current file, and a new file is
opened to store the new content. For details, see “LOG system option” and “SYSIN
system option” in the SAS Companion for UNIX Environments, and “LOGPARM
system option” and “TERMINAL system option” in SAS Language Reference:
Dictionary.
& (ampersand symbol)
allows the SAS process to run in background mode in the UNIX operating
environment.
The following is an example of a SAS command that invokes SAS and starts a server:
nohup /u/system/sas -sysin /u/system/[Link] -noterminal -logparm
"write=immediate" -log "/u/system/server%[Link]" -logparm "rollover=auto" &
Note: The nohup parameter should be omitted from the server’s UNIX script
command when it is part of the /etc/inittab or /etc/rc system file. 4
BUFNO=
specifies the number of buffers to use for SAS data sets. The default is 1.
BUFSIZE=
specifies the permanent buffer size for an output SAS data set. The default is 0.
LOG=
specifies a destination to which the SAS log is written in batch mode.
MEMSIZE=
specifies a limit on the total amount of memory that SAS uses at any one time.
The default is 32M.
For more information, see the chapter about system options in the SAS Companion
for UNIX Environments.
For best performance, run the server on the machine where the shared SAS data
resides. Do not run production servers in SAS foreground mode using the SAS
windowing environment.
Note: The windowing environment supports a maximum of 32,767 lines that can be
written to the SAS log. 4
Note: The complete instructions for installing and using the SAS SCU are provided
in the document "Installation Instructions for 9.2 of the SAS System for Microsoft
Windows," which is included with the software. 4
Service Name
is used to create the service name as recorded in the Windows registry.
Display Name
is used to create the service name that is displayed in the Windows Service
Control Manager. In the example, the server ID SHR1 is included to make it
easier to identify among the multiple SAS/SHARE servers that might be
configured.
Start Type
is used to specify whether the server is started automatically or manually.
Automatic causes the SAS/SHARE server to start automatically when the
Windows operating environment is started. Select Manual to enable the
service to be started and stopped by an administrator using the Windows
Service Control Manager.
Service Path
identifies the SAS invocation command line to be executed with
corresponding system options for server-specific behavior. The following is an
example of a service path specification:
C:\Program Files\SAS\SAS System\9.1\[Link]
-noterminal -logparm "write=immediate" -sysin "C:\[Link]"
-log "C:\shr1%[Link]" -logparm "rollover=auto"
208 Using SAS SCU to Install a SAS/SHARE Server as a SAS Service 4 Appendix 2
This Account
specifies a valid Windows user account that the service will run under. The
value for this field should be in the format Domain\Account. For example,
CORPSALES\ServAcct.
Password
specifies a valid password for the user account that is specified in the This
Account field.
Confirm Password
confirms the value that you entered in the Password field.
4 In the SAS SCU window, click the Install tab again and select Install.
A message window appears and confirms that the service was installed
successfully.
Click OK to close the message window.
5 Click OK in the SAS Service Configuration Utility window to complete the
configuration and installation of the service.
Note: To start the SAS/SHARE server service either manually or automatically, the
account that you specified in the This Account field on the Account tab must be
assigned the Log on as a service and Act as part of the operating system rights.
The administrative interface that is used to assign user rights is dependent on the
version of Windows that you are using. See the documentation for your Windows
operating environment for instructions about assigning user rights. 4
210 Starting and Stopping a Service 4 Appendix 2
APPENDIX
3
Tuning Tips for Applications
That Use SAS/SHARE Software
Authors 212
Introduction to Tuning Tips for Applications That Use SAS/SHARE Software 212
Overview of Tuning Tips for Applications That Use SAS/SHARE Software 212
The SAS Library Model 213
How Data Flows When You Use SAS Files 213
Introduction 213
SAS Data Files 214
SAS Data Views 215
SAS Catalogs 215
Concurrent Access: Update versus Read-only 215
Computer Resources Used by a Server 216
CPU 217
I/O 218
Overlapping I/O 219
Memory 219
Messages 220
Minimizing and Optimizing Resource Consumption 220
Programming Techniques 221
Clean Up Your Data Files 221
Choose the Appropriate Subsetting Strategy 221
Index Wisely 222
Look at a Clock Before You Create an Index 222
Choose Page Size Wisely 222
Understand and Control Random Access 222
Specify Sequential Access When an SCL Program Doesn’t Need Random Access 223
Limit the Number of Files Open During Execution of an SCL Program 223
Evaluate Each Report’s Timeliness Requirement 224
Be Aware of How Frequently Each File Is Updated 224
Know Your Application’s DATA Step Views 225
Tuning Options in SAS/SHARE Software 225
TBUFSIZE= Option in PROC SERVER 226
TOBSNO= Data Set Option 226
RMTVIEW= and NORMTVIEW Options 227
LRPYIELD= Option in PROC SERVER 228
Multiple Servers 228
SAS System Options 228
BUFSIZE= Option 229
COMPRESS= Option 229
Using Operating Environment Tools 229
Introduction 229
Managing CPU 230
212 Authors 4 Appendix 3
Authors
This appendix is based on a paper by Steve Beatrous, Bill Brideson, Dan Squillace,
and Jan Squillace. The original paper, which was published in the Proceedings of the
Twenty-First Annual SAS Users Group International Conference, Chicago, Illinois, 1996,
has been updated with new information about I/O resources and the TBUFSIZE=
option in PROC SERVER.
One or more servers can execute at the same time on a single computer or in a
network of computers. You can use different servers for different applications, or you
can use a few servers to distribute the load of many applications.
When you use more than one server, each server performs only part of the work load.
This allows each server to respond to requests more quickly. On the other hand, every
process on a computer requires a certain amount of overhead simply to exist, and
servers are no different from other processes in this regard. You must balance the
performance improvement that using multiple servers gives your users against the
increased load on your system as more servers execute. The later parts of this paper
will discuss measuring how much work a server is doing; you can use that information
to determine when to add or delete servers.
Introduction
To tune applications that access data concurrently, it is to your advantage to
understand how data is read and written in the different types of members of SAS
libraries that can be accessed through a server.
It is important to remember that an application cannot run any faster when it
accesses data through a server than it can when it accesses data directly. This might
seem obvious, but it is surprisingly easy to simply blame an application’s sluggish
performance on the server without ever testing the application while accessing the data
without going through a server. For many applications, the difference in performance
between accessing the data directly versus accessing the data through a server will not
be large. Whenever you develop a new application, verify that the application runs
acceptably while accessing its data directly before you add a server to the application’s
data access.
214 SAS Data Files 4 Appendix 3
When a SAS session updates or adds to a SAS data file that is accessed directly:
1 The procedure calls the engine to replace or add the observation.
2 The engine replaces or adds the observation in the page.
3 The engine calls the host interface to write the updated or new page to disk.
When a SAS session reads from a SAS data file that is accessed through a server:
1 The procedure or DATA step requests the observation from the REMOTE engine.
2 The REMOTE engine determines whether the requested observation is already
available in its transmission buffer in the user’s SAS session. If the observation is
available, it is returned to the procedure.
3 If the observation is not already available in the user’s SAS session, the REMOTE
engine sends a message to the server to get a buffer full of observations, including
the observation requested by the procedure.
4 The server fills the transmission buffer by requesting one or more observations
from the engine that accesses the data file in the server’s SAS session.
5 For each observation, the engine in the server’s session requests the SAS host
interface to read the page of the data file that contains the observation.
6 The engine in the server’s SAS session extracts each observation from its page and
returns it to the server.
7 After filling the transmission buffer, the server sends the buffer to the REMOTE
engine.
8 The REMOTE engine extracts the selected observation from the transmission
buffer and returns it to the procedure or DATA step.
When a SAS session updates or adds to a SAS data file that is accessed through a
server:
1 The procedure calls the REMOTE engine to replace or add the observation.
2 The REMOTE engine replaces the observation in its transmission buffer or adds
the observation to its transmission buffer.
3 If the data file is open for update access, the REMOTE engine sends a message to
the server that carries the new or updated observation and requests that it be
updated in or added to the data file.
4 If the data file is open for output access, the REMOTE engine adds observations to
its transmission buffer until the buffer is full. After the transmission buffer is full,
the REMOTE engine sends it to the server.
5 The server requests the engine that accesses the library in the server’s SAS session
to replace the observation in the data file or add the observation(s) to the data file.
6 The engine in the server’s SAS session replaces or adds each observation by
updating and creating pages in the data file.
7 The engine requests the SAS host interface to write each updated and new page to
the data file.
Tuning Tips for Applications That Use SAS/SHARE Software 4 Concurrent Access: Update versus Read-only 215
A view created by the SQL procedure can read SAS data sets (SAS data files and any
kind of SAS data view).
When a SAS/ACCESS view engine is used in a multi-user server’s session, the view
engine can read only from the database; it cannot update the database. The flow of data
is one-way: from the database to the interface engine to the server to the user.
A DATA step view can, like a PROC SQL view, combine data from SAS data files and
SAS data views. In addition, DATA step views can include sophisticated calculations
and read data from external files. A DATA step view can produce data exclusively by
calculation, without reading any data.
SAS Catalogs
SAS catalogs are containers for many different types of entries, and the data in each
type of entry is accessed in a pattern unique to the entry type. Like the observations in
SAS data sets, the REMOTE engine will combine records in a catalog entry into groups.
The combination of records for catalog entries is done only for INPUT opens (OUTPUT
and UPDATE opens transmit one record at a time).
The files in the first group are excellent candidates for access through a server. The
files in the second group are often good candidates for access through a server, but for
some applications the performance improvement from not accessing the files through a
server might make it worthwhile to use a more complicated procedure to update those
files while the users are not around. The files in the third group are almost always poor
candidates for access through a server because all of the operating environments that
SAS runs under provide shared read-only access to files, and that direct access is
almost always faster than access through a server.
Here is a summary of the advantages and disadvantages of dividing files into read
only and concurrently updated libraries:
3 A SAS file that is accessed through a server usually costs more, in terms of
computing resources, for users of the application to use than a SAS file that is
stored in a library that is accessed directly by the users.
3 Reduced traffic through a server optimizes response time for the users of the
concurrently updated files.
3 Simpler, more direct access to read-only copies of files reduces the cost of an
application’s query and reporting functions. Note that such a copy might be a
subset instead of the entire file.
3 A SAS file that is accessed through a server can be updated while it is being
queried or reported on.
3 Copies of files require disk space.
3 A file in a SAS library that is accessed directly by users cannot be updated while a
user executes the part of the application that uses that file.
CPU, I/O, and memory resources are consumed by every SAS session. Messages is a
name for one measurable aspect of the complex area of communications resources;
communications resources are consumed by SAS/SHARE software and SAS/CONNECT
software because these two products enable SAS sessions to communicate with one
another.
Any work done by a server consumes more than one kind of resource (if you are
looking for simple uncomplicated truths, you might want to skip this section). A server
can do several types of work and, as you might expect, not all types of work consume
resources in the same relative amounts. For example, some work a server can do
consumes much of the CPU resource but little of the other resources, while other work
Tuning Tips for Applications That Use SAS/SHARE Software 4 CPU 217
consumes much of the memory resource, less of the CPU resource, and very little of the
other resources.
CPU
A server creates processes as users connect to it and execute DATA steps,
procedures, and windows. These processes (created on users’ behalf) are assigned the
work that is actually performed in the server’s SAS session. This allows a process in a
server’s session to do work requested by one user and then yield control so that another
process can do work for another user.
Most requests handled by the processes in a server require small bursts of CPU time.
But there are several requests that can consume especially large amounts of CPU time:
3 processing a WHERE clause
3 interpreting a SAS DATA step view
3 processing a compressed SAS data file
When a SAS data set is accessed through a server, every WHERE clause used to
select observations from that data set is evaluated by a process in the server’s SAS
session. This increases the server’s overall use of the CPU resource to reduce its use of
the messages resource. Often, evaluation of a WHERE clause can be optimized by using
an index to locate the selected observations. But when an index is not used, or selects
more observations than satisfy the WHERE clause, the process in the server’s session
must search for observations that completely satisfy the WHERE clause. Searching can
consume a significant amount of the CPU resource. While a process conducts a search,
it yields periodically to allow other processes in the server’s session to do work for other
users.
A PROC SQL view can consume quite a bit of the CPU resource. The SQL view
engine can join tables, it might need to sort intermediate files, and there might be
several WHERE clauses in the view that require evaluation. The process in which the
SQL view engine executes yields periodically while a view is interpreted.
DATA step views and SAS/ACCESS views also consume the CPU resource. The
process in which either of these engines executes does not yield to allow other processes
to run, although the server itself allows other processes to run when a group of
observations has been prepared for transmission to a user’s SAS session. A DATA step
view that does a great deal of calculation while preparing each observation can have a
visibly harmful impact on a server’s response time to other users’ requests.
When a compressed SAS data file is read, processes in the server’s session
decompress each observation; when a compressed SAS data file is created or replaced, a
process in the server’s session compresses each observation. In many cases the time
required to decompress (or compress) is shorter than the time required to read the
additional pages of an uncompressed file. In other words, trading increased use of the
CPU resource for decreased use of the I/O resource can, on balance, reduce the length of
time users wait for a server to respond. While a user processes a compressed data file
through a server, other processes in the server’s session can execute between groups of
observations requested by that user; a SAS data file is not compressed or decompressed
in its entirety in a single operation.
The "Programming Techniques" section of this paper offers ideas for reducing the
CPU consumption of processes in a server’s session under the following topics:
3 “Choose the Appropriate Subsetting Strategy”
3 “Index Wisely”
3 “Know Your Application’s DATA Step Views”
218 I/O 4 Appendix 3
I/O
Because most work done by the processes in a server’s SAS session involves I/O
activity, those processes can spend a significant amount of time waiting for I/O activity
to complete. (This time includes moving the head of a disk drive to the correct position,
waiting for the disk to spin around to the position of the requested data, and
transferring the data from the disk to the computer’s working storage.) In the current
release of SAS/SHARE software, while a process in a server’s session waits for I/O
activity to complete, other processes in the server’s session do not perform other work
that uses a different (CPU, memory, or messages) resource.
That waiting could, it would seem, become a bottleneck for a server, and in a few
situations this problem is realized. But in practice most of a server’s memory is used
for I/O buffers and processes in a server’s session usually satisfy most requests for data
from I/O buffers that are already in memory.
A server usually allocates memory for one page of a file each time the file is opened,
up to the number of pages in the file. For example, if the application being executed by
a user opens a file twice, enough of the server’s memory to contain two pages of the file
is allocated; if ten users run the application, space for 20 pages of the file is allocated in
the server’s memory. The number of buffers allocated for a file will not exceed the
number of pages in the file.
Of course, the pages of the file maintained in memory are not the same set of pages
all the time: as users request pages of the file that are not in memory, pages that are in
memory are written back to the file on disk if they have been modified, or if an
in-memory page has not been modified its buffer is simply used to read the new page.
A larger page size can reduce the number of I/O operations required to process a SAS
data file. But it takes longer to read a large page than it takes to read a small one, so
unless most of the observations in a large page are likely to be accessed by users, large
page sizes can increase the amount of time required to perform I/O activity in the
server’s SAS session.
There are two patterns in which data is read from or written to SAS files:
3 sequential
3 random
When an application processes a SAS file in sequential order, no page of the file is
read into or written from the server’s memory more than once each time the file is read
or written. Also, observations are transmitted to and from users’ sessions in groups,
which conserves the messages resource.
In many applications that are used with concurrently accessed files, data is accessed
in random order, that is, a user reads the 250th observation, then the 10,000th
observation, then the 5th observation, and so forth. When a file is processed in random
order, it is much more difficult to predict how many times each page of the file will be
read into or written from the memory of a server’s SAS session. In addition, only one
observation is transmitted on each message between server and user, which does not
conserve the messages resource.
The "Programming Techniques" section of this paper offers ideas for reducing the I/O
load of a server under the following topics:
3 “Clean Up Your Data Files”
3 “Choose the Appropriate Subsetting Strategy”
3 “Choose Page Size Wisely”
3 “Specify Sequential Access When an SCL Program Doesn’t Need Random Access”
Tuning Tips for Applications That Use SAS/SHARE Software 4 Memory 219
Overlapping I/O
Overlapping I/O for sequential read operations is a performance enhancement for
applications that use the remote engine. This enhancement was made for SAS 8.1 by
improving the internal functions of the remote engine to support the use of multiple
data buffers for sequential I/O operations.
When the remote engine is reading sequential data from the SAS/SHARE server, it
requests a buffer of data from the server and while it is waiting, it starts the I/O for a
second buffer of data. When the server returns the first buffer of data, the remote
engine passes it to the requesting application.
While the application is reading observations from the first buffer, the server is
returning the observations in the second buffer. When the application has read all of
the observations in the first buffer and has started reading observations from the
second buffer, the REMOTE engine sends a message to the server to retrieve a third
buffer of observations. The REMOTE engine reuses the memory that was allocated for
the first buffer to store the third buffer of observations.
This sequence continues until all of the requested data has been read. This reduces
the elapsed time for applications that read data sequentially by overlapping reading
and processing.
Memory
A computer’s working storage is used by a server to load programs, hold I/O buffers,
and maintain control information. When a server’s working set becomes large compared
to the amount of memory installed on a computer, a significant amount of the server’s
working storage can be stored on disk by the operating environment’s virtual memory
manager.
Large amounts of a server’s memory are consumed by the following:
3 a SAS data view that contains an ORDER BY clause
3 many indexes on data files accessed through a server
3 a large number of files open at the same time
3 data files that have large page sizes
Because the ORDER BY clause causes the observations produced by a view to be
sorted every time the view is interpreted, it requires memory to be used for a work area
for the sorting step. Your application should use this clause only in its views when it
has a clear benefit for your users.
When a SAS data file is opened, all indexes on the file are opened. Therefore, when a
SAS data file has many indexes, a large amount of memory in the server’s SAS session
can be used to store pages of the index file and related control information. Of course,
when many SAS data files that are accessed through a server each have many indexes,
this effect is multiplied.
At SAS, we have observed that the majority of servers’ memory has been consumed
by I/O buffers. Carefully selecting the number of times each file is opened by your
application and the page size of each file can have considerable impact on the amount of
memory required by a server.
The "Programming Techniques" section of this paper offers ideas for reducing the
memory requirements of a server under the following topics:
3 “Choose Page Size Wisely”
3 “Index Wisely”
3 “Limit the Number of Files Open During Execution of an SCL Program”
220 Messages 4 Appendix 3
Messages
Messages are the communication events between users’ SAS sessions and a server.
Whenever a piece of information (for example, an observation) is moved from a server to
a user, a message is sent from the user to the server and a reply is sent back from the
server to the user.
Messages and replies are transmitted by communications access methods. The cost of
a message varies greatly with access method. Memory-to-memory communication
within a single computer, for example by means of the Cross-Memory Services
(COMAMID=XMS) access method is very rapid, while messages that flow on cables
between computers, for example by means of the TCP/IP (COMAMID=TCP) access
method take much longer to travel between SAS sessions.
At SAS, we have observed that the cost of sending data by means of most
communications access methods is more directly a function of the number of messages
than the amount of data. In other words, to move a million characters of data between
a user and a server, it takes less time to send the data in 100 messages than to send
the data in 10,000 messages.
SAS/SHARE software conserves the messages resource by doing the following:
3 transmitting data between servers and users in groups
3 evaluating WHERE clauses in servers’ sessions
3 interpreting SAS data views in servers’ sessions
The "Programming Techniques" section of this paper offers some ideas for conserving
the messages resource under the following topics:
3 “Choose the Appropriate Subsetting Strategy”
3 “Understand and Control Random Access”
The "Tuning Options" section shows options you can use to control the grouping of
observations in messages between servers and users:
3 TBUFSIZE=
3 TOBSNO=
Programming Techniques
Index Wisely
Indexing is a tool that optimizes WHERE clause selection of observations from SAS
data sets. A WHERE clause without an index requires the process in the server to read
every observation in a SAS data set to find the observations that match the WHERE
selection criteria. An index often enables the server to locate the records that satisfy a
WHERE clause without having to read the records that do not match.
Adding indexes might be a good idea if your application seems to be taking too long
to execute WHERE clauses. However, indexes require extra memory and might present
a problem for a server that is memory constrained.
A complete description of index usage can be found in the paper "Effective Use of
Indexes in the SAS System," in the Proceedings of the SAS User’s Group International
Sixteenth Annual Conference.
The server will by default transmit multiple observations per read for either ’IS’ or
’IN’ open modes.
If the application’s use of data is predominantly sequential, but you occasionally need
to reread a previously read observation, then use a mode of ’IN’ or ’UN’ in your SCL
OPEN() function. If the application’s use of data is strictly sequential (you will never
revisit a previously read observation) then use the open mode ’IS’ or ’US’. The ’IS’ and
’US’ open modes are the most efficient for SCL. An ’IS’ or ’US’ open mode, however, will
restrict an SCL application to those functions that access data sequentially. Here are
the SCL functions that access data in a random pattern:
3 FETCHOBS()
3 DATALISTC()
3 DATALISTN()
3 POINT()
Specifying an access pattern in an SCL OPEN() function is documented in the OPEN
function section in SAS Component Language: Reference. Here is an example of
specifying a sequential access pattern in an SCL OPEN() function:
DSID = OPEN( ’MYLIB.A’, ’IN’ );
The initialization code of an application is the place to open the SAS data sets that
will be used throughout the execution of the application. But if an application’s
initialization code must open a large number of files, the time it takes to get started can
be long. By studying how an application is used, you might discover some SAS data
sets that can be opened as functions are requested while the application executes,
which can reduce the amount of time the application takes to initialize and reduces the
concentration of time required to open files.
Whether they are opened during initialization or later, lookup tables that are small
should usually not be closed until an application terminates because the single I/O
buffer required by such a lookup table does not require a large amount of memory. In
such a case it is frequently economical to use a small amount of the memory resource to
conserve the CPU resource that would be required to open and close the lookup table
over and over.
224 Programming Techniques 4 Appendix 3
Larger SAS data sets, and SAS data sets that are used extremely infrequently (for
example, once during initialization) or during a seldom-used function (for example, a
lookup table on a rarely updated field), should usually be left closed whenever they are
not being used.
efficient access by the users is more important than being able to update the catalog
entries conveniently.
Remember that not all of an application’s catalog entries must be accessed the same
way. Catalog entries that must be frequently updated can continue to be accessed
through a server, while other catalog entries that change very seldom can be stored in
SAS catalogs that are accessed directly by the users of the application.
Here are the factors that control how many observations are transmitted in each
group:
3 the value specified for the TBUFSIZE= option in the PROC SERVER statement
3 the value specified for the TOBSNO= data set option
When a SAS data set is opened for input with a random access pattern, the default
behavior is transmitting observations individually (the group size is one). This ensures
that a user always receives up-to-date data when they position to an observation, and it
reduces wasted communications bandwidth because no observations are transmitted to
a user’s session except the specific observations requested.
At other times, the TOBSNO= data set option can be used to increase the number of
observations transferred in each group. For example, consider an SCL program in
Tuning Tips for Applications That Use SAS/SHARE Software 4 Tuning Options in SAS/SHARE Software 227
which the SAS data set DSID is passed to a DATALISTC() or DATALISTN() function.
The data set is read from beginning-to-end by the function, and then the observation
chosen by the user is reread. Because by default the OPEN() function of SCL specifies a
random access pattern, observations for that DSID are transmitted individually. But
the access pattern of the DATALISTC() and DATALISTN() functions is really skip
sequential, so transmitting observations individually is not optimum. TOBSNO=4 could
be specified in a case like this to reduce the number of messages by three-quarters.
(Note that the user could change the open mode from ’I’ to ’IN’ as an alternative to
specifying the TOBSNO= data set option.)
The number of observations transmitted when a data set is opened for input is
summarized below. Here is an example of using the TOBSNO= data set option:
PROC FSVIEW DATA=MYLIB.A(TOBSNO=10);
Some PROC SQL views are especially good candidates for interpretation in a server’s
SAS session because the number of observations produced by the view is much smaller
than the number of observations read by the view, the data sets read by the view are
available to the server and the amount of processing necessary to build each
observation is not large.
Other PROC SQL views should be interpreted in users’ SAS sessions because the
number of observations produced by the view is not appreciably smaller than the
number of observations read by the view, some of the data sets read by the view can be
directly accessed by the users’ SAS sessions, and the amount of processing done by the
view is considerable.
By default, SAS data views are interpreted in a server’s SAS session, but the
RMTVIEW= option in the LIBNAME statement enables you to have the views in a
library interpreted in users’ SAS sessions instead. The NORMTVIEW option in the
PROC SERVER statement enables you to prevent all SAS data views from being
interpreted in the server’s session.
SAS/ACCESS views do not provide update access to the underlying database when
they are interpreted in a server’s session, so it is often more practical to interpret
SAS/ACCESS views in users’ SAS session.
If it is useful for your application to have a SAS/ACCESS view interpreted in a
server’s session, ensure that all of the necessary database interface components are
available to the server’s session.
If a user’s SAS session is capable of using a SAS/ACCESS interface engine to access
the underlying database, it is more efficient to execute the SAS/ACCESS interface
engine in the user’s SAS session. Note that in this case it might be convenient to store
the view file in a SAS library that is accessed through a server if the view will be
updated frequently and used by more than one user.
Like SAS/ACCESS views, DATA step views are very often most useful when
interpreted in users’ SAS sessions. For more information about interpreting DATA step
views in a server’s session, see “Know Your Application’s DATA Step Views” on page 225.
228 SAS System Options 4 Appendix 3
Multiple Servers
This is not an option you specify in a SAS program statement; instead it is a method
of managing the workload of concurrent access to SAS data sets.
If you determine that a server is consuming too much of a resource and you can not
reduce the server’s consumption of that resource any further, creating an additional
server allows you to divide your applications’ workload among several servers.
SAS/SHARE software includes a family of SAS macros that help you manage SAS
file access through multiple servers. Those macros are documented in Chapter 6, “SAS/
SHARE Macros for Server Access,” on page 77.
BUFSIZE= Option
When a file is created, use the BUFSIZE= data set option to specify the size of the
pages of the file. The SAS default page size is optimum for files that are processed
sequentially, but it might not be optimum when the observations of a file are accessed
in random order. PROC CONTENTS shows the page size of a SAS data file.
You might find it useful to balance the pattern in which a file is randomly accessed
against the number of observations stored on each page of the file. If most random
access sequences access observations in very different locations in the file, then a small
page size will improve performance because most of the observations on each page are
not used. On the other hand, if most random access sequences are likely to be to
observations that are physically near each other in the file, you might be able to take
advantage of a large page size to have many of the observations read from the file into
the server’s memory at once.
If you want to keep all or most of a SAS data file in memory, you can choose a very
large page size. Of course, this can consume a lot of the server’s memory so you should
use such a page size only when you really want to. If you expect that not much data
from a large file will need to be in memory at one time, choose a small page size to
make reading and writing each page as fast as possible.
If you find that your server is spending a significant amount of time waiting for I/O
operations to complete, consider recreating the files that are not used for sequential
access with a smaller page size.
Here is an example of using the BUFSIZE= data set option:
DATA MYLIB.A(BUFSIZE=6K);
SET MYLIB.A;
RUN;
COMPRESS= Option
This option is used to cause a SAS data file to be stored in compressed format.
Compressing files usually makes them smaller, so a server is able to read more
observations per I/O request when a file is compressed. The reduction in file size for a
compressed file (which conserves the I/O resource) is paid for, though, by an increase in
the consumption of the CPU resource (which is used to decompress the observations as
the file is read). If your server is CPU-bound, compression could do more harm than
good, but if your server is I/O-bound, compression could reduce its consumption of the I/
O resource.
Introduction
Up to this point, we have been looking at SAS application and server performance
from an internal point of view. Now we turn to an external point of view. By
performance externals, we mean several things. First, at what rate is a server
consuming resources such as CPU, memory, and DASD I/O? Second, with what other
workloads is a server competing for these resource? And third, what policy is being
used to manage a server’s access to resources with respect to other work in the system?
There are several monitors available for MVS and VM to help you analyze a server’s
resource utilization and contention with other workloads. On MVS, most sites license
the IBM RMF product. RMF Monitor II and Monitor III support interactive analysis of
SAS/SHARE performance. Also available on MVS are Candle Corporation’s Omegamon
230 Managing CPU 4 Appendix 3
Managing CPU
The most critical factor here is assuring that your servers are getting a reasonable
share of the available CPU time. Servers in general ought to run at a higher (for
example, transaction monitors and database servers). You can tune your SAS/SHARE
application meticulously only to be foiled if a background process (for example) is
preventing your servers from getting CPU time.
If CPU time is a scarce resource on your system, that is your system is usually
running at very high CPU utilizations, then you need to consider SAS/SHARE tuning
actions which can reduce CPU time. Two specific examples are type of server
connection and whether to use data compression.
Managing I/O
The first thing to consider here is the amount of contention with other work on the
system. Are your SAS libraries competing with other work on channels, disk
controllers, or disk drives which are too busy? Too busy on I/O channels and control
units is highly specific to each operating environment and hardware vendor. But in
general it is safe to say that if a disk drive is consistently above twenty percent busy,
then off-loading work from that drive ought to be considered.
If there is no significant contention with other work, then you need to consider
spreading application libraries using SAS/SHARE across multiple disks.
If waiting for I/O is still a problem for your servers, then you need to consider
SAS/SHARE tuning options which can reduce I/O time. These include using smaller
page sizes for randomly accessed data, adding indexes for randomly accessed data, and
possibly using data compression. Data compression is a specific example of the resource
trade-off problem mentioned earlier. Data compression can reduce I/O and disk storage
but will increase CPU time.
Tuning Tips for Applications That Use SAS/SHARE Software 4 Conclusion 231
Managing Memory
Memory is an interesting resource in that it directly affects both CPU and I/O
resource consumption. Too little memory increases both. Additional memory can reduce
both. The most critical factor here is to ensure that your servers have sufficient memory
to prevent excessive wait for paging. Most operating environments have controls to
differentiate the amount of memory given to various workloads on the system.
If real memory is a scarce resource on your system, then you need to consider
SAS/SHARE tuning actions which reduce memory consumption. Chief among these are
reducing data set page sizes to reduce I/O buffer memory requirements and using
shared SAS system images where possible.
Conclusion
The concurrent access capabilities that SAS/SHARE software adds to SAS give
developers opportunities to create applications that allow their users to have up-to-date
data and to be more productive.
Such applications use SAS in new ways. This paper has discussed areas to be aware
of and ways to trade usage of one resource for another. This information enables
developers of applications that take advantage of concurrently accessed data to write
those applications to use the available computer resources in the most efficient ways
possible.
232
233
APPENDIX
4
SAS Component Language (SCL)
Application
Audience
This example is for SAS application programmers who are familiar with SCL and
with the FSEDIT procedure and FSEDIT command.
234 Inventory and Order System 4 Appendix 4
Overview
There are three general types of data that are involved in an order-processing
system:
3 customer information, which includes name, address, and a customer number that
uniquely identifies the customer
3 inventory information, which tracks the amount of each item that is in stock at
any specific time
3 orders information, which identifies items in inventory that a customer has placed
an order for
Customer Information
In order to simplify this example, the application in this section does not include a
customer data set. This SCL program, which is expanded for use in an actual
order-processing system, would open the customer data set during the FSEINIT step
and close it during the FSETERM step.
The customer data set is ideal to access through a SAS/SHARE server to keep
information up-to-date, such as customers’ address changes, and contact information.
For the purpose of entering orders, the customer data set would usually be opened
for read-only access through the server, because customer information is not usually
updated at the time an order is taken.
Updating the customer data would ordinarily be done by using a second FSEDIT
application that would also access the data set through the server. That application
would be available to customer service representatives and administrative personnel.
Inventory Information
In this example, the inventory data is accessed through a SAS/SHARE server. The
data is completely hidden from the user of the order-entry application. The purpose of
this example is to show how to maintain information automatically in a SAS data set.
The inventory file is also ideal for accessing through a SAS/SHARE server to keep
the available quantity of each item current.
In the order-processing example, the inventory data set is opened for update access
through the server. Read-only access to the inventory data set might be given for the
reporting programs that are run either nightly or on-demand, which would also access
the data set through the server. The inventory reporting and analysis programs are not
included in this example.
In a mature inventory-management system, there would be additional access to the
inventory data by employees who receive merchandise. This example shows only the
order-processing side (the “inventory depletion” process), but it is important to
remember that replenishing inventory must also take place. Accessing the inventory
data by using a SAS/SHARE server allows both the ordering and the receiving
operations to maintain current information in the inventory file.
Orders Information
The orders data set is a series of transactions. When a product is ordered, that event
is recorded in the orders data set. This makes the orders data set a time-based record
SAS Component Language (SCL) Application 4 The Inventory/Order System SCL Application 235
of events, which is quite different from the type of information that is maintained in the
customer and the inventory data sets.
Accessing the orders data set through a SAS/SHARE server allows all order
information to be captured in a single file. This enables simplified reporting and
analysis of the orders data, which can be performed on current information at any time.
In this example, the data set ORDERS is updated by the users of the application.
Reporting and analysis of the orders data, which is not shown here, can be
accomplished with read-only access to the data set ORDERS through the server.
/*--------------------------------------------------------------------
* CAUTION:
* error message being written to the SAS log because the inventory
* data set will not have been updated to reflect the returned
* inventory.
* + Do not issue a DELETE command to cancel a new order (not yet added to the
* The SCL program included here is designed to run with the following
*
* o PRODUCT type=character /* Product Code */
*
* o CODE type=character /* Product Code */
*
*
*
* OPTIONS COMAMID=communications access method;
236 The Inventory/Order System SCL Application 4 Appendix 4
* RUN;
* DATA [Link];
* PRODUCT=’ABC’; QUANTITY=20;
* RUN;
* To create a client SAS session that you can use to execute this
*
* OPTIONS COMAMID=communications access method;
* SCREEN=[Link]; RUN;
*------------------------------------------------------------------*/
FSEINIT:
/*----------------------------------------------------------------
/ Open the product control data set and save the needed variable
/---------------------------------------------------------------*/
codeid=open(’[Link]’,’U’);
vdesc=varnum(codeid,’desc’);
vinvent=varnum(codeid,’invent’);
control term;
return;
INIT:
/*----------------------------------------------------------------
/ get the inventory info (item description) for the display, and
/---------------------------------------------------------------*/
_msg_=’ ’;
sav_prod=product; sav_quan=quantity;
if (obsinfo(’new’)) then do;
oldorder=0;
rc=field(’unprotect’,’product’);
return;
SAS Component Language (SCL) Application 4 The Inventory/Order System SCL Application 237
end;
oldorder=1;
link getrec;
rc=unlock(codeid);
rc=field(’protect’,’product’);
return;
MAIN:
/*----------------------------------------------------------------
/ For a change in quantity or for a new order, fetch (and lock) the
/ issue a SAVE command in the primary data set so that the data set
/---------------------------------------------------------------*/
loop_cnt=0;
lokloop: loop_cnt=loop_cnt+1;
link getrec;
return;
end;
invent=invent-quantity;
call putvarn(codeid,vinvent,invent);
rc=update(codeid);
erroron product;
goto unlok;
end;
call execcmd(’save;’);
oldorder=1;
unlok: rc=unlock(codeid);
end;
return;
getrec:
/*----------------------------------------------------------------
/---------------------------------------------------------------*/
gotrec=0;
rc=WHERE(codeid,"code=’"||product||" ’");
if (rc>0) then do;
_msg_=’WHERE: ’||sysmsg();
end;
rc=FETCH(codeid);
if (rc>0) then do; /* Error! */
_msg_=’FETCH: ’||sysmsg();
end;
end;
else gotrec=1;
desc=getvarc(codeid,vdesc);
invent=getvarn(codeid,vinvent);
return;
quanok=1;
cursor quantity;
end;
quanok=0;
end;
return;
needcode:
/*----------------------------------------------------------------
/ the observation.
/---------------------------------------------------------------*/
desc=’ ’;
erroron product;
return;
TERM:
/*----------------------------------------------------------------
return;
FSETERM:
/*----------------------------------------------------------------
/---------------------------------------------------------------*/
return;
240
241
APPENDIX
5
SAS/SHARE Cross-Version
Issues, SAS 9.2
Upgrade: Definition
An upgrade is the process of installing a later version of SAS software over an
existing version of SAS software at the customer site (for example, from SAS 8.2 to SAS
9.2). A system manager at your site is responsible for performing the upgrade.
The result of an upgrade can affect the ability of SAS/SHARE clients and servers to
connect and share data.
242 Data Migration 4 Appendix 5
Data Migration
Accessing your data is a primary concern after upgrading to a new version of SAS. If
the server (and clients) have been upgraded to SAS 9.2, and you want to make all new
I/O engine features available, you can migrate the data to the release that the server
runs. For complete details about migration, see [Link]
migration.
1 Yes. After SAS has been upgraded, the client and server can connect and exchange data.
2 No. After SAS has been upgraded, the client and server cannot connect.
3 Required. If SAS is not upgraded, the SAS application cannot run.
However, a SAS/SHARE client cannot access a SAS 9.2 file on a SAS 8 or a SAS 6
server.
A SAS/SHARE 9.2 server can use any SAS library or view engine to search for and
retrieve the SAS files of the specified version. The capabilities of each engine when it is
used by a SAS/SHARE server are the same as the engine’s capabilities when it is used in
a single-user SAS session. For details about the capabilities of each engine in a SAS 9.2
session, see the topic about SAS 9.2 compatibility in SAS Language Reference: Concepts.
3 The SAS 8 client cannot access the SAS 9.2 SAS files on the SAS 9.2 server if the
files contain SAS 9.2 features, such as long format names.
How can the SAS 8 client, which has not yet upgraded to SAS 9.2, but must continue
client/server processing, be accommodated?
As a temporary measure, SAS files on the SAS 9.2 server can be created in SAS 8
format to ensure that SAS 8 clients can access them.
In the SAS application that creates a SAS file, specify the VALIDFMTNAME= option
to ensure that format names are restricted to the length that is supported in SAS 8.
For more information, see the VALIDFMTNAME= System Option in SAS Language
Reference: Dictionary.
246
247
APPENDIX
6
Recommended Reading
Recommended Reading
Here is the recommended reading list for this title:
3 SAS/CONNECT User’s Guide
3 Moving and Accessing SAS Files
3 SAS Language Reference: Dictionary
3 SAS ODBC Driver: User’s Guide and Programmer’s Reference
3 SAS Companion that is specific to your operating environment
For a complete list of SAS publications, go to [Link]/bookstore. If you
have questions about which titles you need, please contact a SAS Publishing Sales
Representative at:
Customers outside the United States and Canada, please contact your local SAS office
for assistance.
248
249
Glossary
access descriptor
a SAS/ACCESS file that describes data that is managed by SAS, by a database
management system, or by a PC-based software application such as Microsoft Excel,
Lotus 1-2-3, or dBASE. After creating an access descriptor, you can use it as the
basis for creating one or more view descriptors. See also SAS/ACCESS view and view
descriptor.
access method
See communications access method.
architectural compatibility
a characteristic shared by two or more operating environments that use identical
internal representations for storing numeric data, character data, or both.
Compatible operating environments use the same standards or conventions for
storing floating-point numbers (IEEE or IBM 390); for character encoding (ASCII or
EBCDIC); for the ordering of bytes in memory (big Endian or little Endian); for word
alignment (4-byte boundaries or 8-byte boundaries); and for data-type length (16- bit,
32-bit, or 64- bit).
architecture
the manner in which numeric data and character data are represented internally in
a particular operating environment. See also architectural compatibility.
authentication
the process of verifying the identity of a person or process within the guidelines of a
specific security policy.
batch mode
a method of executing SAS programs in which a file that contains SAS statements
plus any necessary operating environment commands is submitted to the computer’s
batch queue. After you submit the program, control returns to your computer, and
you can perform other tasks. Batch mode is sometimes referred to as running in the
background. The program output can be written to files or printed on an output
device.
buffer
See transfer buffer.
catalog entry
See SAS catalog entry.
250 Glossary
client
a SAS session that receives services, data, or other resources from a specified server.
The server can run on the same computer as the client or on a different computer
(across a network). See also server, SAS/CONNECT server, SAS/CONNECT client,
SAS/SHARE client, and SAS/SHARE server.
concurrent
pertaining to the simultaneous use of resources by multiple users or applications.
control level
one of the determinants in the kind of lock that a task obtains on a SAS data set or
on an observation in the data set. The control level specifies how other SAS tasks
can access the SAS data set concurrently. Every SAS task has an open mode (input,
output, or update) and a default control level (either member-level control or
observation-level control) for each SAS data set that it accesses, based on how the
task operates on that data set. See also open mode and locking.
Cross-Memory Services
a cross-task communication interface that is part of z/OS. XMS is used by programs
that run within a single z/OS operating environment. XMS is also the name of the
SAS communications access method that uses XMS for client/server communication.
Short form: XMS.
data value
a unit of character or numeric information in a SAS data set. A data value
represents one variable in an observation. For example, the variable LASTNAME
might contain the data value Smith.
DBMS
See database management system.
encryption
the act of transforming intelligible data (plaintext) into an unintelligible form
(ciphertext) by means of a mathematical process.
Glossary 251
engine
a component of SAS software that reads from or writes to a file. Each engine enables
SAS to access files that are in a particular file format. There are several types of
engines. See also interface view engine, library engine, and REMOTE engine.
entry type
a characteristic of a SAS catalog entry that identifies the catalog entry’s structure
and attributes to SAS. When you create a SAS catalog entry, SAS automatically
assigns the entry type as part of the name. See also SAS catalog entry.
external file
a file that is created and maintained by a host operating system or by another
vendor’s software application. SAS can read data from and route output to external
files. External files can contain raw data, SAS programming statements, procedure
output, or output that was created by the PUT statement. A SAS data set is not an
external file. See also fileref (file reference).
fileref
a name that is temporarily assigned to an external file or to an aggregate storage
location such as a directory or a folder. The fileref identifies the file or the storage
location to SAS. See also libref.
incompatible operating environments
See architectural compatibility.
index
a component of a SAS data set that enables SAS to access observations in the SAS
data set quickly and efficiently. The purpose of SAS indexes is to optimize
WHERE-clause processing and to facilitate BY-group processing.
interactive line mode
a method of running SAS programs in which you enter one line of a SAS program at
a time at the SAS session prompt. SAS processes each line immediately after you
press the ENTER or RETURN key. Procedure output and informative messages are
returned directly to your display device.
interface view engine
a SAS engine that retrieves data directly from files that have been formatted by
another vendor’s software and which presents the data to SAS in the form of a SAS
data set. Interface view engines are transparent to users and are not specified in
LIBNAME statements. See also engine.
Internet Protocol Version 4
a protocol that specifies the format for network addresses for all computers that are
connected to the Internet. This protocol, which is the predecessor of Internet Protocol
Version 6, uses dot-decimal notation to represent 32-bit address spaces. An example
of an Internet Protocol Version 4 address is [Link]. Short form: IPv4. See also IP
address and Internet Protocol Version 6.
Internet Protocol Version 6
a protocol that specifies the format for network addresses for all computers that are
connected to the Internet. This protocol, which is the successor of Internet Protocol
Version 4, uses hexadecimal notation to represent 128-bit address spaces. The format
can consist of up to eight groups of four hexadecimal characters, delimited by colons,
as in FE80:0000:0000:0000:0202:B3FF:FE1E:8329. As an alternative, a group of
consecutive zeros could be replaced with two colons, as in
FE80::0202:B3FF:FE1E:8329. Short form: IPv6. See also IP address and Internet
Protocol Version 4.
252 Glossary
IP address
a unique network address that is assigned to each computer that is connected to the
Internet. The IP address can be specified in either of two formats: Internet Protocol
Version 4 (IPv4) or Internet Protocol Version 6 (IPv6). The IPv4 format consists of
four parts in dot-decimal notation, as in [Link]. The IPv6 format can consist
of up to eight groups of four hexadecimal characters, delimited by colons, as in
FE80:0000:0000:0000:0202:B3FF:FE1E:8329. See also Internet Protocol Version 4
and Internet Protocol Version 6.
IPv4
See Internet Protocol Version 4.
IPv6
See Internet Protocol Version 6.
library engine
an engine that accesses groups of files and puts them in the correct form for
processing by SAS utility windows and procedures. A library engine also determines
the fundamental processing characteristics of the library, presents lists of files for the
library directory, and supports view engines. See also engine, REMOTE engine, and
view engine.
libref
a name that is temporarily associated with a SAS library. The complete name of a
SAS file consists of two words, separated by a period. The libref, which is the first
word, indicates the library. The second word is the name of the specific SAS file. For
example, in [Link], the libref VLIB tells SAS which library contains the
file NEWBDAY. You assign a libref with a LIBNAME statement or with an operating
system command.
locking
a technique for preventing conflicts among requests from different SAS tasks. A task
obtains a lock on a member (for example, a SAS data set) or record (observation)
based on the open mode and control level for that SAS data set. In SAS/SHARE
software, you can lock a SAS library, data set, catalog, or catalog entry by using the
LOCK statement or the LOCK command. See also control level and open mode.
member
a SAS file in a SAS library.
member name
a name that is assigned to a SAS file in a SAS library. See also member type.
member type
a SAS name that identifies the type of information that is stored in a SAS file.
Member types include ACCESS, AUDIT, DMBD, DATA, CATALOG, FDB, INDEX,
ITEMSTOR, MDDB, PROGRAM, UTILITY, and VIEW.
noninteractive mode
a method of running SAS programs in which you prepare a file of SAS statements
and submit the program to the operating system. The program runs immediately
and comprises your current session.
observation
a row in a SAS data set. All of the data values in an observation are associated with
a single entity such as a customer or a state. Each observation contains either one
data value or a missing-value indicator for each variable.
Glossary 253
open mode
the way in which a SAS task accesses and operates on a member in a SAS library.
There are three open modes for SAS files: input, update, and output. See also control
level and locking.
operating environment
a computer, or a logical partition of a computer, and the resources (such as an
operating system and other software and hardware) that are available to the
computer or partition.
port
in a network, a communications endpoint that is specified by a unique number and a
service name. The port number and the associated service name are configured in a
services file (/etc/services on UNIX). A port enables a SAS client to access a
SAS/CONNECT spawner, an MP CONNECT pipe, a SAS/SHARE server, or a firewall
server. See also SASESOCK engine, pipeline parallelism, firewall, SAS/SHARE
server, and services file.
PROC SQL view
a SAS data set that is created by the SQL procedure. A PROC SQL view contains no
data. Instead, it stores information that enables it to read data values from other
files, which can include SAS data files, SAS/ACCESS views, DATA step views, or
other PROC SQL views. The output of a PROC SQL view can be either a subset or a
superset of one or more files. See also SAS data view.
quiesce
(1) to gradually cause an active server or server library to become inactive by
disallowing new requests to use the resource. (2) to move a user from an active
status to a stopped status. When a quiesced user closes all files in a server library,
the server releases that user’s access to the library. If the user has no open files in an
accessed server library, the server terminates that user’s access to the library
immediately.
relational database management system
a database management system that organizes and accesses data according to
relationships between data items. The main characteristic of a relational database
management system is the two-dimensional table. Examples of relational database
management systems are DB2, Oracle, SYBASE, and Microsoft SQL Server.
REMOTE engine
a SAS library engine for SAS/SHARE software. Using the REMOTE engine enables
a client SAS session to access shared data by communicating with a SAS/SHARE
server. See also SAS/SHARE server.
Remote Library Services
a feature of SAS/SHARE and SAS/CONNECT software that enables you to read,
write, and update remote data as if it were stored on the client. RLS can be used to
access SAS data sets on computers that have different architectures. RLS also
provides read-only access to some types of SAS catalog entries on computers that
have different architectures. Short form: RLS. See also architecture.
RLS
See Remote Library Services.
SAS catalog
a SAS file that stores many different kinds of information in smaller units called
catalog entries. A single SAS catalog can contain several different types of catalog
entries. See also SAS catalog entry.
254 Glossary
processing of observations in SAS data sets, features of SAS initialization, and the
way SAS interacts with your host operating environment.
SAS task
a logical process that is executed by a SAS session. A task can be a procedure, a
DATA step, a window, or a supervisor process.
SAS/ACCESS view
a type of file that retrieves data values from files that are stored in other software
vendors’ file formats. You use the ACCESS procedure of SAS/ACCESS software to
create SAS/ACCESS views. See also view descriptor.
SAS/CONNECT client
a SAS/CONNECT session that acts as a client. The user that runs a SAS/CONNECT
client requests services from a SAS/CONNECT server that can run on a remote
single-processor machine or on a local or remote multi-processor machine. The
following services are supported: Remote Library Services, which enables access to
SAS files; Compute Services, which uses fast processing resources; and Data Transfer
Services, which enables the upload or download of selected data for processing. See
also client, server, and SAS/CONNECT server.
SAS/CONNECT server
a SAS/CONNECT session that acts as a server. The SAS/CONNECT server runs a
SAS session on a computer that receives requests for services from a SAS/CONNECT
client. The server can run on a remote, single-processor computer or on a local or
remote SMP computer. SAS/CONNECT servers provide Remote Library Services (for
accessing SAS files), Compute Services (for rapid computational processing), and
Data Transfer Services (for uploading and downloading selected data). See also
client, server, SAS/CONNECT client, and symmetric multiprocessing.
SAS/SECURE
an add-on product that uses the RC2, RC4, DES, and TripleDES encryption
algorithms. SAS/SECURE requires a license, and it must be installed on each
computer that runs a client and a server that will use the encryption algorithms.
SAS/SECURE provides a high level of security.
SAS/SHARE client
a SAS/SHARE session that acts as a client. The user who runs a SAS/SHARE client
accesses data on a SAS/SHARE server through Remote Library Services (RLS). See
also client, server, SAS/SHARE server, and Remote Library Services.
SAS/SHARE server
the result of an execution of the SERVER procedure. The SERVER procedure is part
of SAS/SHARE software. A server runs in a separate SAS session that services users’
SAS sessions by controlling and executing input and output requests to one or more
SAS data libraries. See also client, server, and SAS/SHARE client.
SASProprietary algorithm
a fixed encoding algorithm that is included with Base SAS software. The
SASProprietary algorithm requires no additional SAS product licenses. It provides a
medium level of security.
server
a SAS session that delivers services, data, or other resources to a requesting client.
The server can run on the same computer as the client or on a different computer
(across a network). See also SAS/CONNECT server, SAS/SHARE server,
SAS/CONNECT client, SAS/SHARE client, and server.
server library
See SAS/SHARE server library.
server session
See server, SAS/CONNECT server, SAS/SHARE server.
services file
a file that contains a list of service names and the TCP/IP ports that are mapped to
those services. The services file is stored on both the SAS client and the SAS server.
The UNIX services file is located in /etc/services. A service can be specified for any of
the following: a SAS/CONNECT spawner, a SAS/SHARE server, an MP CONNECT
pipe, and a firewall server. See also port, SASESOCK engine, pipeline parallelism,
firewall, and SAS/SHARE server.
SMP
See symmetric multiprocessing.
Structured Query Language
a standardized, high-level query language that is used in relational database
management systems to create and manipulate objects in a database management
system. SAS implements SQL through the SQL procedure. Short form: SQL.
SQL
See Structured Query Language.
SSL (Secure Sockets Layer)
a protocol that provides network security and privacy. SSL uses encryption
algorithms RC2, RC4, DES, TripleDES, and AES. SSL provides a high level of
security. It was developed by Netscape Communications.
SQL
See Structured Query Language.
symmetric multiprocessing
a hardware and software architecture that can improve the speed of I/O and
processing. An SMP machine has multiple CPUs and a thread-enabled operating
system. An SMP machine is usually configured with multiple controllers and with
multiple disk drives per controller. Short form: SMP.
system option
See SAS system option.
TCP/IP
an abbreviation for a pair of networking protocols. Transmission Control Protocol
(TCP) is a standard protocol for transferring information on local area networks such
as Ethernets. TCP ensures that process-to-process information is delivered in the
appropriate order. Internet Protocol (IP) is a protocol for managing connections
between operating environments. IP routes information through the network to a
particular operating environment and fragments and reassembles information in
transfers.
Glossary 257
thin client
an application that is deployed across a network, thereby reducing the need for disk
space on client machines. Thin-client development tools reduce the cost of deploying
and maintaining applications. Costs are lower because thin-client applications need
to be updated only on the server. Otherwise, multiple user machines that perhaps
run multiple operating systems would have to be updated.
threaded processing
processing that is performed in multiple threads in order to improve the speed of
CPU-bound applications. See also symmetric multiprocessing.
TLS
See Transport Layer Security.
transfer buffer
a temporary holding area in computer memory that is used when data is transferred
between clients and servers across a network.
Transport Layer Security
the successor to Secure Sockets Layer (SSL) V3.0. The Internet Engineering Task
Force (IETF) adopted SSL V3.0 as the de facto standard, made some modifications,
and renamed it TLS. TLS is virtually SSLV3.1. Short form: TLS. See also Secure
Sockets Layer.
view
a generic term (used by many software vendors) for a definition of a virtual data set
(or table). The definition is named and stored for later use. A view contains no data;
it merely describes or defines data that is stored elsewhere. See also SAS data view.
view descriptor
a SAS/ACCESS file that defines part or all of the DBMS data that is described by an
access descriptor. See also access descriptor.
work task
a SAS/SHARE server resource that consists of a pair of lightweight threads that
service requests from SAS/SHARE clients. More work tasks enable the SAS/SHARE
server to service more asynchronous requests. See also threaded processing.
XMS
See Cross-Memory Services.
258
259
Index
view files Y
cross-architecture restrictions 185
yield frequency 111, 228
W
Z
Web servers
htmSQL client 21 z/OS
WHERE function 53 creating server environment 201
Windows starting server 202
creating server environment 206
work tasks 117
WORKTASKS= option
PROC SERVER statement 117
Your Turn
Whether you are new to the workforce or an experienced professional, you need to distinguish yourself in this rapidly
changing and competitive job market. SAS Publishing provides you with a wide range of resources to help you set
®
yourself apart.
SAS Press Series
®
Need to learn the basics? Struggling with a programming problem? You’ll find the expert answers that you
need in example-rich books from the SAS Press Series. Written by experienced SAS professionals from
around the world, these books deliver real-world insights on a broad range of topics for all skill levels.
[Link]/saspress
SAS Documentation
®
To successfully implement applications using SAS software, companies in every industry and on every
continent all turn to the one source for accurate, timely, and reliable information—SAS documentation. We
currently produce the following types of reference documentation: online help that is built into the software,
tutorials that are integrated into the product, reference documentation delivered in HTML and PDF—free on
the Web, and hard-copy books.
[Link]/publishing
SAS Learning Edition 4.1
®
Get a workplace advantage, perform analytics in less time, and prepare for the SAS Base Programming
exam and SAS Advanced Programming exam with SAS Learning Edition 4.1. This inexpensive, intuitive ®
personal learning version of SAS includes Base SAS 9.1.3, SAS/STAT , SAS/GRAPH , SAS/QC , SAS/ETS ,
® ® ® ® ®
and SAS Enterprise Guide 4.1. Whether you are a professor, student, or business professional, this is a
® ®
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 trademarks of their respective companies. © 2008 SAS Institute Inc. All rights reserved. 474059_1US.0108