SAS P1 L3b Flashcards

1
Q

Four characteristics of user-created library?

A

User-created library is:

  1. Permanent
  2. Implemented within operating system file system.
  3. NOT automatically available in SAS session.
  4. must assign libref to user created library to make it available in SAS session.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How define library?

Syntax?

A

To define library, use LIBNAME to associated libref with physical location. Makes data available during current session.

Syntax: LIBNAME libref ‘SAS-library’

LIBNAME = key word

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

Rules for libref names?
length?
begin with?
use?

A

Rules for libref names:

  • length: 1 to 8 characters
  • must begin with letter or underscore
  • must use (contain) letters, underscore, or numbers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Location for libref?

A

Libref location must reference an existing folder.
Enclose physical location in single or double quotes.

[LIBNAME doesn’t create new folder]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
What is LIBNAME?
type of statement?
need run?
need be with other?
how many can you have?
A

LIBNAME:
- is a GLOBAL statement
- does NOT need run statement
- can be submitted alone or store with other SAS programs
- can use more than one LIBNAME statement/program
(for different libraries)

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

How do you browse library via a program?
Syntax?
Key words?

A

How to browse library via program:
PROC CONTENTS statement

PROC CONTENTS DATA=libref.ALL;
RUN;

this will display list of all SAS files in SAS library
Keywords: PROC, CONTENTS, ALL

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

When browsing library, how omit descriptor portion?

A

Add “nods” to end of ALL

leave space after underscore

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

What does CONTENTS produce? (3 things)

order?

A

CONTENTS produces (shows) the following:

  1. directory
  2. listing of members of library and member type (in alpha order )
  3. information about each individual data set in library = descriptor portion
  • if don’t need descriptor portion, use “nods”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does PROC PRINT do?

Syntax?

A

PROC PRINT
accesses permanent data set

PROC PRINT DATA=SAS-DATA-SET;
RUN;

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

How cancel libref?

Syntax?

A

Must use CLEAR statement to cancel libref.
(will dissociate library)
Otherwise stays in effect until session ends.

LIBNAME libref CLEAR;

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