Access and Create Data Structures Flashcards
Data types in SAS
Two data types; Numeric and Character
A dot (.) represents
Missing Data value
SAS is case-sensitive. True or False?
False. SAS is case-insensitive.
DATA step
DATA steps are used to Create datasets, data, Read and Modify the data.
PROC step
PROC step is used for processing data created by DATA step. Data is processed by analyzing data, performing utility functions, printing reports.
Statements that indicate the end of step
run; quit; stop; abort; or Encountering a new statement.
SASHELP
It is a library that contains information that controls your SAS session along with sample SAS data sets.
SASUSER
It is a library that stores any information regarding changes to the default settings for the SAS windowing environment. You can also store SAS data sets, SAS programs, and other SAS files in the SASUSER library
WORK library
It is the temporary storage location for datasets. It is the default library that SAS places datasets created without a specified library. These files are temporary and are deleted at the end of the session.
DATALINES
It is a statement used in DATA step to enter rows of raw data. The data is terminated by a semi-colon. The DATALINES statement should be the last statement in the DATA step. CARDS statement can also be used instead of DATALINES
INFILE
It is used to tell SAS the filename and location. The INFILE statement must follow the DATA statement and precede the INPUT statement.
INFILE ‘C:\MyDir\Desktop\Home\users.dat’;
LRECL
LRECL expanded as Longest Record Length, is as the name suggests the longest record length in a data file. It used to specify the length of a record. A record is one row(also referred to as observation) in the data file.
INFILE ‘location\user.txt’ LRECL = 2000;
The Dollar sign ($) besides a variable indicates…
that the variable is of character data type.
INPUT streetName $ streetNumber;
TITLE
The TITLE statement tells SAS to put the text enclosed in quotation marks on the top of each page of output. Without this statement, SAS would put the words “The SAS System” at the top of each page.
LENGTH
It is used to define the length of the values of a variable. The default length of a variable is 8. Using LENGTH, you are able to define any length between 1 and 32,767.