Module 1: Basics Flashcards

1
Q

Define a SAS Statement

A

is a SAS language element used to perform a particular operation in a SAS program or to provide info to a SAS program

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

T/F: SAS statements are not case senstive.

A

True (unless enclosed in quotes)

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

T/F: Statements cannot continue over several lines.

A

False: its free format

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

What are the two types of steps?

A

1) Data steps that can manipulate data
2) Proc steps that helps analyze data

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

Define a global statement.

A

A statement that can be used throughout a program until its changed, cancelled, or SAS ends.
Ex. title, libname, options

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

What happends when the RUN statement is not used a the end of a data step?

A

SAS assumes that the beginning of a new step implies the end of a previous step.

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

Why should you include the run statement at the end of a step?

A

Helps makes statements and log easier to read

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

What are the naming rules for SAS files?

A

1) Must begin with a letter or an underscore
2) can be any combination of letters,numbers, or underscores
3) can be 1-32 characters long

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

What is a SAS library?

A

A storage unit for SAS system files.

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

What are temporary files and their properties?

A

Temporary and end when SAS section closes
Default is WORK unless specified.
Can be referenced by name only.

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

What are permanent Files and their properties?

A

Available after the end of the current session.
Must define library and then tell SAS to store there.

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

What are the rules to library names?

A

1)Begin with a letter or underscore
2) Can continue with other combinations of letters, numbers, or underscores.
3) Can by 1-8 characters long
4) Must be assigned in each SAS session

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

Write the syntax to creating libraries.

A

libname NAME ‘PATH’;

capital letters means that is what you name it.
Lowercase is actual code

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

Write the syntax to reference a permanent file.

A

LIBREF.FILENAME

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

Write the syntax to reference an externam file

A

filename FILEREF ‘path’;

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

What are the naming rules for filenames?

A

Same as librefs
(begin with letter/underscore, 1-8 characters long, assigned in each SAS session)

17
Q

What are the naming rules to SAS variables?

A

Same as data set names

18
Q

What are the two basic variable types and their properties?

A

1)Numeric: default length 8 bytes and stored as floating-point numbers. Informat: w.d

2)Character: 1-32,767 bytes long. Informat: $w.

19
Q

Write the syntax to directing log and output windows to external files.

Define and proc print code

A

filename logfile ‘path.log’;
filename lstfile ‘path.lst’;
filename loglst ‘path.loglist’;

proc printo log= logfile print list=lstfile new;
run;

20
Q

What does the ‘proc printto’ command do?

A

Redirects output to the log and output windows