Base SAS Flashcards
What is the basic structure of the SAS base program?
DATA step, which recovers & manipulates data.
PROC step, which interprets the data.
What is the basic syntax style in SAS?
- There should be a semi-colon at the end of every line
- A data statement that defines your data set
- Input statement
- There should be at least one space between each word or statement
- A run statement
Explain data step in SAS
The Data step creates a SAS dataset which carries the data along with a “data dictionary.” The data dictionary holds information about the variables and their properties.
What are the data types does SAS contain?
The data types in SAS are Numeric and Character.
Which statement does not perform automatic conversions in comparisons?
In SAS, the “where” statement does not perform automatic conversions in comparisons.
What is a method to debug and test your SAS program?
This combination of options tells SAS to execute the step and analyze the syntax of your code without reading any input data.
options OBS=0 NOREPLACE;
What is the difference between nodupkey and nodup options?
The difference between the NODUP and NODUPKEY is that NODUP compares all the variables in our dataset while NODUPKEY compares just the BY variables
What does PROC print, and PROC contents do?
To display the contents of the SAS dataset PROC print is used and also to assure that the data were read into SAS correctly. While PROC CONTENTS display information about a SAS dataset.
What is the use of function Proc summary?
The syntax of proc summary is the same as that of proc means. It computes descriptive statistics on numeric variables in the SAS dataset.
What Proc glm does?
Proc glm performs simple and multiple regression, analysis of variance (ANOVAL), analysis of covariance, multivariate analysis of variance and repeated measure analysis of variance.
What is SAS informats?
SAS INFORMATS are used to read, or input data from external files known as Flat Files ASCII files, text files or sequential files). The informat will tell SAS on how to read data into SAS variables.
Name types of category in which SAS Informats are placed
Character Informats : $INFORMATw
Numeric Informats : INFORMAT w.d
Date/Time Informats: INFORMAT w.
What is the use of PROC gplot?
PROC gplot has more options and can create more colorful and fancier graphics.
What is the difference between INPUT and INFILE ?
INFILE statement is used to identify an external file
INPUT statement is used to describe your variables
State the difference between INFORMAT and FORMAT ?
INFORMAT: To indicate SAS how to read data into a dataset.
FORMAT: To indicate SAS how to print the variables
How you can read the variables that you need?
You read the variables using input statement with column /line pointers, informats and length specifiers.
What are the special input delimiters used in SAS?
Special input delimiters used in SAS are DLM and DSD
How to include or exclude specific variables in a data set?
To include or exclude specific variables in a data set you can use DROP, KEEP Statements and Data set Options.
What is the difference between SAS functions and procedures?
Procedures expect one variable value per observation
Functions expect values to be supplied across an observation
What are the default statistics that PROC MEANS produce?
N MN MAX MEAN STD DEV
What is the difference between Match Merge and One to One Merge?
A one-to-one merge is suitable if both data sets in the merge statement are sorted by id, and each observation in one data set has a corresponding observation in the other data set. If the observations do not match, then match merging is suitable.
What is the use of the %include statement?
%INCLUDE statement reads an entire file into the current SAS program you are running and submits that file to the SAS System immediately.
What does the trace option do?
ODS Trace is used to find the names of the particular output objects when several of them are created by some procedure.
How would you identify a macro variable?
with Ampersand (&) sign
How would you define the end of a macro?
The end of the macro is defined by %Mend Statement
What is the difference between %LOCAL and %GLOBAL?
% Local is a macro variable defined inside a macro. %Global is a macro variable defined in open code (outside the macro or can use anywhere).
What do you understand by the term Normal Distribution?
data is distributed around a central value without any bias to the left or right and reaches normal distribution in the form of a bell-shaped curve. The random variables are distributed in the form of a symmetrical bell-shaped curve.
What does P-value signify about the statistical data?
P-value is used to determine the significance of results after a hypothesis test in statistics. P-value helps the readers to draw conclusions and is always between 0 and 1. The probability of obtaining test results at least as extreme as the results that are actually observed.
Difference between sum function and using “+” operator?
SUM function returns the sum of non-missing arguments. ‘+’ operator returns a missing value if any of the arguments are missing.
What is %LET?
%LET is a straightforward macro statement that simply assigns a value to a macro variable.
How to begin a macro?
%MACRO
What is regression analysis?
Predict a value of the Y variable given known values of the X variable.