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.

Similar documents
SAS File Management. Improving Performance CHAPTER 37

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

Data Set Options CHAPTER 2

Creating and Executing Stored Compiled DATA Step Programs

Chapter 3 Managing Results in Projects. Chapter Table of Contents

Optimizing System Performance

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

Chapter 6 Creating Reports. Chapter Table of Contents

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

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

SAS Support for TELNET on Windows

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

External Files. Definition CHAPTER 38

Using Data Transfer Services

SAS Data Libraries. Definition CHAPTER 26

APPENDIX 2 Customizing SAS/ASSIST Software

Using Cross-Environment Data Access (CEDA)

OS/390 Platform Examples

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

UNIX Platform Error Messages

OS/2: SPX Access Method

Windows: SPX Access Method

Chapter 14 Introduction to the FACTEX Procedure

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

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

UNIX Spawner Program. Starting the UNIX Spawner Program CHAPTER 36

Using the SQL Editor. Overview CHAPTER 11

CHAPTER 5 Macintosh: TCP/IP Access Method

Introduction to MDDBs

Locking SAS Data Objects

Storing and Reusing Macros

Using SAS Files. Introduction CHAPTER 5

Graphics. Chapter Overview CHAPTER 4

CHAPTER 7 Examples of Combining Compute Services and Data Transfer Services

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

The SERVER Procedure. Introduction. Syntax CHAPTER 8

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

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

OpenVMS Operating Environment

Chapter 9 Selected Examples. Queues with Reneging

Chapter 28 INSET Statement. Chapter Table of Contents

CHAPTER 13 Importing and Exporting External Data

Examples That Use Remote Objecting

SAS/ASSIST Software Setup

Routing the SAS Log and SAS Procedure Output

QUEST Procedure Reference

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

Building and Updating MDDBs

Chapter 23 Introduction to the OPTEX Procedure

Chapter 13 Multivariate Techniques. Chapter Table of Contents

DBLOAD Procedure Reference

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

Choosing the Right Procedure

SYSTEM 2000 Essentials

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

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

SAS/FSP 9.2. Procedures Guide

Chapter 15 Mixed Models. Chapter Table of Contents. Introduction Split Plot Experiment Clustered Data References...

SCL Arrays. Introduction. Declaring Arrays CHAPTER 4

Alternative ODS HTML Statements for Running Examples in Different Operating Environments

The DATA Statement: Efficiency Techniques

Chapter 2 User Interface Features. networks Window. Drawing Panel

The EXPLODE Procedure

SAS Workflow Manager 2.2: Administrator s Guide

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

The G4GRID Procedure. Introduction APPENDIX 1

Performance Considerations

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

The GTESTIT Procedure

SAS Web Infrastructure Kit 1.0. Overview

Tasks Menu Reference. Introduction. Data Management APPENDIX 1

SAS Clinical Data Integration 2.4

SAS Business Rules Manager 1.2

SAS/ACCESS Interface to R/3

SAS Clinical Data Integration Server 2.1

Changes and Enhancements

CHAPTER 7 Using Other SAS Software Products

SAS. IT Service Level Management 2.1: Migration Documentation

Chapter 27 Saving and Printing Graphics

Chapter 25 Editing Windows. Chapter Table of Contents

The TIMEPLOT Procedure

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

SAS Factory Miner 14.2: User s Guide

Licensing SAS DataFlux Products

The TRANTAB Procedure

The GSLIDE Procedure. Overview. About Text Slides CHAPTER 27

The GREMOVE Procedure

10 The First Steps 4 Chapter 2

Procedures. PROC CATALOG CATALOG=<libref.>catalog <ENTRYTYPE=etype> <KILL>; CONTENTS <OUT=SAS-data-set> <FILE=fileref;>

Handling Exceptions. Introduction. Using the Program Halt Handler CHAPTER 10

SAS Clinical Data Integration 2.6

SAS. Installation Guide Fifth Edition Intelligence Platform

Customizing Your SAS Session

Using Dynamic Data Exchange

Chapter 7 File Access. Chapter Table of Contents

Administering SAS Enterprise Guide 4.2

SAS IT Resource Management 3.3

SAS/ACCESS Data Set Options

Enterprise Miner Software: Changes and Enhancements, Release 4.1

Using CVS Repositories with SAS

Transcription:

23 CHAPTER 4 Data Set Options Definition 23 Syntax 23 Using Data Set Options 24 Using Data Set Options with Input or Output SAS Data Sets 24 How Data Set Options Interact with System Options 24 Data Set Options by Category 25 Definition Data set options specify actions that apply only to the SAS data set with which they appear. They let you perform such operations as 3 renaming variables 3 selecting only the first or last n observations for processing 3 dropping variables from processing or from the output data set 3 specifying a password for a SAS data set. Syntax Specify a data set option in parentheses after a SAS data set name. To specify several data set options, separate them with spaces. (option-1=value-1 < option-n=value-n>) These examples show data set options in SAS statements: 3 data scores(keep=team game1 game2 game3); 3 proc print data=new(drop=year); 3 set old(rename=(date=start_date));

24 Using Data Set Options 4 Chapter 4 Using Data Set Options Using Data Set Options with Input or Output SAS Data Sets Most SAS data set options can apply to either input or output SAS data sets in DATA steps or procedure (PROC) steps. If a data set option is associated with an input data set, the action applies to the data set that is being read. If the option appears in the DATA statement or after an output data set specification in a PROC step, SAS applies the action to the output data set. In the DATA step, data set options for output data sets must appear in the DATA statement, not in any OUTPUT statements that may be present. Some data set options, such as COMPRESS=, are meaningful only when you create a SAS data set because they set attributes that exist for the life of the data set. To change or cancel most data set options, you must re-create the data set. You can change other options (such as PW= and LABEL=) with PROC DATASETS. For more information, see The DATASETS Procedure in the SAS Procedures Guide. When data set options appear on both input and output data sets in the same DATA or PROC step, SAS applies data set options to input data sets before it evaluates programming statements or before it applies data set options to output data sets. In some instances, data set options conflict when they are used in the same statement. For example, you cannot specify both the DROP= and KEEP= options for the same variable in the same statement. How Data Set Options Interact with System Options Many system options and data set options share the same name and have the same function. System options remain in effect for all DATA and PROC steps in a SAS job or session, unless they are respecified. The data set option overrides the system option for the data set in the step in which it appears. In this example, the OBS= system option in the OPTIONS statement specifies that only the first 100 observations will be processed from any data set within the SAS job. The OBS= data set option in the SET statement, however, overrides the system option for data set TWO and specifies that only the first 5 observations will be read from data set TWO. The PROC PRINT step prints the data set FINAL. This data set contains the first 5 observations from data set TWO, followed by the first 100 observations from data set THREE: options obs=100; data final; set two(obs=5) three; run; proc print data=final; run;

Data Set Options 4 Data Set Options by Category 25 Data Set Options by Category Table 4.1 Categories and Descriptions of Data Set Options Category Data Set Option Description Data Set Control ALTER= Assigns an alter password to a SAS file and enables access to a password-protected SAS file BUFNO= BUFSIZE= CNTLLEV= COMPRESS= DLDMGACTION= ENCRYPT= GENMAX= GENNUM= INDEX= LABEL= OUTREP= PW= PWREQ= READ= REPEMPTY= REPLACE= REUSE= SORTEDBY= TOBSNO= TRANTAB= TYPE= WRITE= Specifies the number of buffers for processing a SAS data set Specifies a permanent buffer size for output SAS data sets Specifies the level of shared access to SAS data sets Compresses observations in an output SAS data set Specifies what type of action to take when a SAS data set in a SAS data library is detected as damaged Encrypts SAS data files Requests generations for a data set and specifies the maximum number of versions References a specific generation of a data set Defines indexes when a SAS data set is created Specifies a label for the data set Specifies an operating environment s requirements vector for an output file Assigns a read, write, or alter password to a SAS file and enables access to a password-protected SAS file Controls the pop up of a requestor window for a data set password Assigns a read password to a SAS file and enables access to a read-protected SAS file Controls replacement of like-named temporary or permanent SAS data sets when the new one is empty. Controls replacement of like-named temporary or permanent SAS data sets Specifies whether new observations are written to free space in compressed SAS data sets Specifies how the data set is currently sorted Specifies the number of observations to be transmitted in each multi-observation exchange with a SAS server Specifies a translation table for character conversions Specifies the data set type for a specially structured SAS data set Assigns a write password to a SAS file and enables access to a write-protected SAS file

26 Data Set Options by Category 4 Chapter 4 Category Data Set Option Description Miscellaneous FILECLOSE= Specifies how a tape is positioned when a SAS file on the tape is closed Observation Control FIRSTOBS= Causes processing to begin at a specified observation User Control of SAS Index Usage IN= OBS= POINTOBS= WHERE= WHEREUP= IDXNAME= IDXWHERE= Creates a variable that indicates whether the data set contributed data to the current observation Causes processing to end with the nth observation Controls whether a compressed data set may be processed with random access (by observation number) rather than sequential access only Selects observations that meet the specified condition Specifies whether to evaluate added observations and modified observations against a WHERE expression Directs SAS to use a specific index to satisfy the conditions of a WHERE expression Overrides the SAS System decision about whether to use an index to satisfy the conditions of a WHERE expression Variable Control DROP= Excludes variables from processing or from output SAS data sets KEEP= RENAME= Specifies variables for processing or for writing to output SAS data sets Changes the name of a variable

The correct bibliographic citation for this manual is as follows: SAS Institute Inc., SAS Language Reference: Concepts, Cary, NC: SAS Institute Inc., 1999. 554 pages. SAS Language Reference: Concepts Copyright 1999 SAS Institute Inc., Cary, NC, USA. ISBN 1 58025 441 1 All rights reserved. Printed in the United States of America. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, by any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS Institute, Inc. U.S. Government Restricted Rights Notice. Use, duplication, or disclosure of the software by the government is subject to restrictions as set forth in FAR 52.227 19 Commercial Computer Software-Restricted Rights (June 1987). SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513. 1st printing, November 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, ACF/VTAM, AIX, APPN, MVS/ESA, OS/2, OS/390, VM/ESA, and VTAM are registered trademarks or trademarks of International Business Machines 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.