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

Similar documents
Locking SAS Data Objects

Using Data Transfer Services

Using Cross-Environment Data Access (CEDA)

APPENDIX 2 Customizing SAS/ASSIST Software

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

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

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

Chapter 3 Managing Results in Projects. Chapter Table of Contents

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

The SERVER Procedure. Introduction. Syntax CHAPTER 8

Using the SQL Editor. Overview CHAPTER 11

CHAPTER 7 Examples of Combining Compute Services and Data Transfer Services

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

SAS Support for TELNET on Windows

Examples That Use Remote Objecting

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

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

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

SAS File Management. Improving Performance CHAPTER 37

Chapter 6 Creating Reports. Chapter Table of Contents

Graphics. Chapter Overview CHAPTER 4

Storing and Reusing Macros

OpenVMS Operating Environment

CHAPTER 13 Importing and Exporting External Data

UNIX Platform Error Messages

Creating and Executing Stored Compiled DATA Step Programs

DBLOAD Procedure Reference

OS/2: SPX Access Method

The EXPLODE Procedure

SAS/ASSIST Software Setup

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

External Files. Definition CHAPTER 38

The GTESTIT Procedure

SAS Data Libraries. Definition CHAPTER 26

Windows: SPX Access Method

UNIX Spawner Program. Starting the UNIX Spawner Program CHAPTER 36

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

OS/390 Platform Examples

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

Optimizing System Performance

CHAPTER 5 Macintosh: TCP/IP Access Method

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

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

Tasks Menu Reference. Introduction. Data Management APPENDIX 1

QUEST Procedure Reference

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

SAS/FSP 9.2. Procedures Guide

SAS Component Language (SCL) Interface to Agent Services

Alternative ODS HTML Statements for Running Examples in Different Operating Environments

Chapter 27 Saving and Printing Graphics

SCL Arrays. Introduction. Declaring Arrays CHAPTER 4

This chapter is recommended primarily for server administrators.

Using SAS Files. Introduction CHAPTER 5

Enterprise Miner Software: Changes and Enhancements, Release 4.1

10 The First Steps 4 Chapter 2

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

CV2ODBC Procedure. Overview. CV2ODBC Procedure Syntax APPENDIX 4

The GSLIDE Procedure. Overview. About Text Slides CHAPTER 27

Chapter 2 User Interface Features. networks Window. Drawing Panel

Customizing Your SAS Session

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

Introduction to MDDBs

The TRANTAB Procedure

Chapter 14 Introduction to the FACTEX Procedure

Choosing the Right Procedure

CHAPTER 7 Using Other SAS Software Products

SAS. IT Service Level Management 2.1: Migration Documentation

Defining Your Data Sources

Executing SAS/AF Applications

SAS Web Infrastructure Kit 1.0. Overview

The GREMOVE Procedure

Licensing SAS DataFlux Products

SAS Workflow Manager 2.2: Administrator s Guide

Routing the SAS Log and SAS Procedure Output

SAS/ACCESS Data Set Options

The TIMEPLOT Procedure

SAS 9.2 Foundation Services. Administrator s Guide

Installation Instructions for SAS/ACCESS Interface to SAP BW

Using CVS Repositories with SAS

Administrator for Enterprise Clients: User s Guide. Second Edition

Changes and Enhancements

Using MDP Extensions. What Is the Multidimensional Data Provider? CHAPTER 3

SAS Drug Development 3.3_03. December 14, 2007

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

SAS/ACCESS Interface to R/3

The G4GRID Procedure. Introduction APPENDIX 1

Chapter 7 File Access. Chapter Table of Contents

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

Chapter 25 Editing Windows. Chapter Table of Contents

The GANNO Procedure. Overview CHAPTER 12

SAS Data Integration Studio 3.3. User s Guide

SAS Marketing Operations Management 6.0 R14 Update 2

Chapter 13 Multivariate Techniques. Chapter Table of Contents

SAS Model Manager 2.2. Tutorials

The GIMPORT Procedure

SAS Drug Development. SAS Macro API 1.3 User s Guide

SAS Clinical Data Integration 2.4

Chapter 23 Introduction to the OPTEX Procedure

Using Dynamic Data Exchange

SYSTEM 2000 Essentials

Transcription:

113 CHAPTER 11 The LOCK Statement and the LOCK Command Introduction 113 LOCK Statement 113 Syntax 114 Examples 114 LOCK Command 115 Syntax 115 Examples 115 Introduction The LOCK statement enables you to acquire, list, or release locks on a SAS data library, a SAS data set, a SAS catalog, or a SAS catalog entry. See Chapter 5, Locking SAS Data Objects, on page 59 for details about locking. The LOCK command provides a convenient way to lock data objects from a SAS window. As with the LOCK statement, the LOCK command enables you to acquire, list, or release locks on a SAS data library, a SAS data set, a SAS catalog, or a SAS catalog entry. Note: In this chapter, SAS libraries, data sets, catalogs, and catalog entries are called data objects. 4 LOCK Statement In Version 7 and Version 8 of SAS/SHARE software, a LOCK statement acquires an exclusive lock on the specified data object (that is a SAS data library, SAS data set, SAS catalog, or SAS catalog entry). No other user can read or write to a data object that you have locked by using the LOCK statement. You cannot lock a data object that another user is working on. You must first access a SAS data library through a SAS server before you can lock that library or any data object in it. When you use a LOCK statement to lock a data object, you can open that data object as often as you want and in any mode that you want (for example, to create, replace, update, or read the object), as long as your PROC or DATA step does not conflict with what is allowed by the engine that is used by the SAS server to access the data object. You release a lock on a data object by using the CLEAR argument in the LOCK statement. To find out if a data object is locked and by whom, use the LIST argument in the LOCK statement.

114 Syntax 4 Chapter 11 Syntax LOCK libref<.member-name<.member-type.entry-name.entry-type>> <LIST QUERY SHOW CLEAR>; libref is a valid SAS name that refers to a SAS data library that is currently accessed through a SAS server, that is, the server library. member-name is a valid SAS name that specifies a member of the SAS data library that is associated with the libref. member-type is the type of the SAS file to be locked. Valid values include DATA, VIEW, and CATALOG. The default is DATA. If member-type is omitted or it is specified as the value DATA or VIEW, two locks are obtained: one on libref.member-name.data and the other on libref.member-name.view. 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 QUERY SHOW 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 by using the LOCK statement in your SAS session. This argument is optional. See Chapter 5, Locking SAS Data Objects, on page 59 for more information about how and when a lock is released. Examples lock educlib.mycat.choice1.menu; lock educlib.mycat.choice2.menu; /* Update the two catalog entries as needed. */ lock educlib.mycat.choice1.menu clear; lock educlib.mycat.choice2.menu clear; The first LOCK statement acquires implicit locks on the SAS data library EDUCLIB and on the SAS catalog EDUCLIB.MYCAT. It then acquires an explicit lock on the catalog entry EDUCLIB.MYCAT.CHOICE1.MENU. The second LOCK statement acquires an explicit lock on the catalog entry EDUCLIB.MYCAT.CHOICE2.MENU. The first LOCK statement that contains the argument CLEAR releases the explicit lock on the catalog entry CHOICE1.MENU, 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 CHOICE2.MENU. Because no catalog entries remain locked, the second statement that contains the argument CLEAR also releases the implicit lock on the SAS catalog EDUCLIB.MYCAT. Because no other members of the library are locked, it also releases the implicit lock on the SAS library EDUCLIB.

4 Examples 115 LOCK Command The LOCK command enables you to specify the name of the data object to be locked on the command line of a window, such as the SAS Display Manager System s Program Editor window. You must first access a SAS data library through a SAS server before you can lock that library or any data object in it. Syntax LOCK < data-object <LIST QUERY SHOW CLEAR>> data-object specifies the data object to be locked. A data object can be a SAS data library, a SAS data file, a SAS data view, a SAS catalog, or a SAS catalog entry. The general form of this argument is libref<.member-name<.member-type.entry-name.entry-type>> libref is a valid SAS name that refers to a SAS data library that is currently accessed through a SAS server. member-name is a valid SAS name that specifies a member of the SAS data library associated with the libref. member-type is the type of the SAS file to be locked. Valid values include 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 on libref.member-name.data and one on libref.member-name.view. entry-name is the name of the SAS catalog entry to be locked. entry-type is the type of the catalog entry to be locked. LIST QUERY SHOW writes to the SAS log whether the specified data object is locked and by whom. These arguments are optional. CLEAR releases a lock on the specified data object that was acquired by using the LOCK command in your SAS session. See Chapter 5, Locking SAS Data Objects, on page 59 for more information about how and when a lock is released. This argument is optional. Examples On the command line of the Program Editor window, enter: lock mapslib.mapscat.euromap.cmap lock mapslib.mapscat.euromap.cmap clear

116 Examples 4 Chapter 11 The first LOCK command locks SAS catalog entries of type CMAP. The SAS log will indicate that one catalog entry has already been locked. The second LOCK command releases the lock on the catalog entry EUROMAP.CMAP. The SAS log will indicate that the lock on this catalog entry has been released and by whom.

The correct bibliographic citation for this manual is as follows: SAS Institute Inc., SAS/ SHARE User s Guide, Version 8, Cary, NC: SAS Institute Inc., 1999. pp. 247. SAS/SHARE User s Guide, Version 8 Copyright 1999 by SAS Institute Inc., Cary, NC, USA. ISBN 1 58025 478 0 All rights reserved. Printed in the United States of America. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS Institute Inc. U.S. Government Restricted Rights Notice. Use, duplication, or disclosure of the software by the government is subject to restrictions as set forth in FAR 52.227 19 Commercial Computer Software-Restricted Rights (June 1987). SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513. 1st printing, September 1999 SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. IBM, AIX, DB2, OS/2, OS/390, RMT TM, RS/6000, System/370 TM, and System/390 are registered trademarks or trademarks of International Business Machines Corporation. ORACLE is a registered trademark or trademark of Oracle Corporation. indicates USA registration. Other brand and product names are registered trademarks or trademarks of their respective companies. The Institute is a private company devoted to the support and further development of its software and related services.