The DATASETS Procedure |
Procedure features: |
|
This example modifies two SAS data sets using the MODIFY statement and statements subordinate to it. Describing a SAS Data Set shows the modifications to the GROUP data set.
This example includes the following actions:
modifying SAS files
labeling a SAS data set
adding a READ password to a SAS data set
indicating how a SAS data set is currently sorted
creating an index for a SAS data set
assigning informats and formats to variables in a SAS data set
renaming variables in a SAS data set
labeling variables in a SAS data set
Program |
options pagesize=40 linesize=80 nodate pageno=1 source; |
LIBNAME health 'SAS-library';
proc datasets library=health nolist; |
modify group (label='Test Subjects' read=green sortedby=lname); |
index create vital=(birth salary) / nomiss unique; |
informat birth date7.; format birth date7.; |
label salary='current salary excluding bonus'; |
modify oxygen; rename oxygen=intake; label intake='Intake Measurement'; quit; |
SAS Log |
169 options pagesize=40 linesize=80 nodate pageno=1 source; 170 LIBNAME health 'c:\Documents and Settings\mydir\My 170! Documents\procdatasets\health'; NOTE: Libref HEALTH was successfully assigned as follows: Engine: V9 Physical Name: c:\Documents and Settings\mydir\My Documents\procdatasets\health NOTE: PROCEDURE DATASETS used (Total process time): real time 8:06.11 cpu time 0.54 seconds 171 proc datasets library=health nolist; 172 modify group (label='Test Subjects' read=XXXXX sortedby=lname); WARNING: The file HEALTH.GROUP.DATA is not ALTER protected. It could be deleted or replaced without knowing the password. 173 index create vital=(birth salary) / nomiss unique; NOTE: Composite index vital has been defined. NOTE: MODIFY was successful for HEALTH.GROUP.DATA. 174 informat birth date7.; 175 format birth date7.; 176 label salary='current salary excluding bonus'; 177 modify oxygen; 178 rename oxygen=intake; NOTE: Renaming variable oxygen to intake. 179 label intake='Intake Measurement'; 180 quit; NOTE: MODIFY was successful for HEALTH.OXYGEN.DATA. NOTE: PROCEDURE DATASETS used (Total process time): real time 15.09 seconds cpu time 0.06 seconds
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.