Search the site...

SASCRUNCH TRAINING
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
Sentry Page Protection
Please Wait...
Accessing Library
SAS Base Exam


Library
Accessing data sets from different libraries is a common SAS programming task.

In this session, you will learn how to:
  • Create a temporary data set
  • Create a permanent library and data set
  • Read the data from one data set and write it onto another

Create a Temporary Data Set

​Code

Data DS1;
XYZ = 1;
Run;

This creates a temporary data set in the WORK library.
Picture

Create a Permanent Library and Permanent Data Set

​Code

Libname NewLib '/folders/myfolders';

Data NewLib.DS2;
XYZ = 2;
Run;​

The libname statement creates a new library called NewLib. 

  Libname NewLib '/folders/myfolders';

A library reference (libref) of NewLib is added to the DS2 data set (i.e. NewLib.DS2).

  Data NewLib.DS2;
  XYZ = 2;
  Run;​


As a result, the data step creates a permanent data set in the NewLib library.
Picture

Read data from a data set and write it onto another

​Code

Libname NewLib '/folders/myfolders';

Data NewLib.DS3;
Set Work.DS1;
Run;​
Picture

Exercise

Compute the average market share percentage by Internet Explorer (IE) over the 13-month period.
Next

Need some help? 

Get Hint
Get Solution

Fill out my online form.
Already a member? Go to member's area.