Week 3 Flashcards

1
Q

Data step commands

A

Output
If var in (‘A’, ‘B’, ‘C’) then output;
Delete
If var = x then delete
Where
(Where = (var = x)); can be done on a proc step too

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

IF-THEN-ELSE

A

IF-THEN-ELSE statements are linked. Else is conditional on the previous IF. If first condition is true then SAS skips the linked Else statement. SAS executes IF-THEN statements until it encounters its first true statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Logical operators

A

And- must meet all requirements
Or- must meet any requirement
Not
Use parentheses to frame options
Else if (cars= ‘Jetta’ and car= x)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Length

A

Length var $ 10.;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

PROC CONTENTS

A

Gives detailed summary of dataset.
View a list of SAS datasets in an active library by using
PROC CONTENTS DATA= Perm.ALL NODS;

NODS is no detailed summary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

DO….END;

A

Used in data step with IF-THEN statements to execute multiple statements after the THEN DO. DO must be followed by END

IF year > 2000 then DO;
X=Y;
P=R;
END;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly