200 likes | 369 Views
SAS Base Cert. Prep. Guide. CHAPTER 2 Referencing Files and Setting Options. LIBNAME .libref. Creates the library specified in the libref portion of the LIBNAME statement.
E N D
SAS Base Cert. Prep. Guide CHAPTER 2 Referencing Files and Setting Options Creator: Nathaniel J. Clay
LIBNAME.libref Creates the library specified in the libref portion of the LIBNAME statement. The libref portion may be 1-8 characters long, begin with an underscore or letter, and may contain only letters, numbers, or underscores. Creator: Nathaniel J. Clay
PROC CONTENTS DATA=<SAS file specification>RUN; Allows you to see the contents of the SAS file specified in the SAS file specification. Variables will be displayed in alphabetical order, NOT the order in which they were created. Creator: Nathaniel J. Clay
PROC CONTENTS DATA=<LIBREF._ALL_>;RUN; Allows you to see detailed contents of all files contained within the library specified by LIBREF. Creator: Nathaniel J. Clay
PROC CONTENTS DATA=<LIBREF._ALL_> NODS;RUN; Allows you to see the contents of all files contained within the library specified by LIBREF; however, the NODS option suppresses detailed information from being displayed. Creator: Nathaniel J. Clay
What is wrong with the following statement below?PROC CONTENTS DATA=<sas file specification> NODS;RUN; You can only use the NODS option when using: <LIBREF._ALL_> Creator: Nathaniel J. Clay
PROC DATASETS <options>;CONTENTS DATA= <sas file specification>;QUIT; Performs the same function as: PROC CONTENTS DATA=<SAS file specification>;RUN; Creator: Nathaniel J. Clay
PROC DATASETS <options>;CONTENTS DATA= <LIBREF._All_>;QUIT; Performs the same function as: PROC CONTENTS DATA=<LIBREF._ALL_>;RUN; Creator: Nathaniel J. Clay
PROC DATASETS <options>;CONTENTS DATA= <LIBREF._All_> NODS;QUIT; Performs the same function as: PROC CONTENTS DATA=<LIBREF._ALL_> NODS;RUN; Creator: Nathaniel J. Clay
PROC DATASETS <options>;CONTENTS DATA= <sas file specification> VARNUM;QUIT; Performs the same function as: PROC CONTENTS DATA=<sas file specification> VARNUM;RUN; Creator: Nathaniel J. Clay
What’s the difference between PROC CONTENTS and PROC DATASETS? They perform essentially the same function, however the options allowed in PROC DATASETS allows you to also modify a data set, whereas PROC CONTENTS only allows you to view information about a dataset. Creator: Nathaniel J. Clay
OPTIONS <options> Goes before DATA/PROC steps, and are used to specify what system options you wish to change. Creator: Nathaniel J. Clay
OPTIONS DATE|NODATE NUMBER|NONUMBER PAGENO= DATE|NODATETellssas to include or not include the current date on output. NUMBER|NONUMBERTellssas to include or not include page numbers on output. PAGENO= Tells sas what value you wish page numbers to begin on. Creator: Nathaniel J. Clay
OPTIONS PAGESIZE= LINESIZE= YEARCUTOFF= PAGESIZE= Specifies the number of lines to include on each page of output. Values for PAGESIZE can be between 15 and 32,767. LINESIZE= Specifies the width of the print line. Values for LINESIZE can be between 64 and 256. YEARCUTOFF= Tells sas how to handel two-digit years. SAS interprets YEARCUTOFF as a 100 year span starting with the year you specify. Creator: Nathaniel J. Clay
OPTIONS FIRSTOBS= OBS= FIRSTOBS= Tells sas the value of the observation to start at. OBS= Tells sas the value of the observation to stop at. Creator: Nathaniel J. Clay
OPTIONS FORMCHAR= ‘formatting characters’ Specifies formatting characters for your outputting device. Common to use in PROC FREQ and PROC TABULATE. Creator: Nathaniel J. Clay
OPTIONS FORMDLIM= ‘delimit-character’ Tells sas the character which should be used in order to delimit page breaks in sas system output. The default value of FORMDLIM is NULL. Creator: Nathaniel J. Clay
OPTIONS LABEL|NOLABEL Allows you to change the way in which variable names are displayed on output. Creator: Nathaniel J. Clay
OPTIONS REPLACE|NOREPLACE Specifies whether permanently stored sas files are replaced or not. This option is good because it prevents a user from inadvertently replacing existing sas data sets. Creator: Nathaniel J. Clay
OPTIONS SOURCE|NOSOURCE Controls whether sas statements are written into the sas log or not. Default is SOURCE. Creator: Nathaniel J. Clay