A short simple tutorial on. SAS libname statements. for SAS for Windows



Similar documents
File Management Windows

WINDOWS 7 MANAGE FILES AND FOLDER WITH WINDOWS EXPLORER

SAS Lesson 2: More Ways to Input Data

How to get the most out of Windows 10 File Explorer

Windows XP Managing Your Files

Auto-Archiving your s in Outlook

Archiving your mail with Outlook 2003

Windows XP File Management

How to Password Protect Files & Folders in Mac OS X with Disk Images

WebDisk Essentials How to Post & Retrieve Files From Your Own Online Storage Area

Quickstart Tutorial. Bradford Technologies, Inc. 302 Piercy Road, San Jose, California fax

Freegal Frequently Asked Questions

Managing documents, files and folders

Attachments Internet Explorer

How to: Using archive files in Microsoft Outlook

Outlook Data File navigate to the PST file that you want to open, select it and choose OK. The file will now appear as a folder in Outlook.

Q1. What are the differences between Data Backup, System Restore, Disk Image, System Recovery Disc and System Repair Disk?

Define an Oracle Library in SAS Management Console

You must have at least Editor access to your own mail database to run archiving.

your Apple warranty; see There are two main failure modes for a mirrored RAID 1 set:

Backup Basics Presentation. Presented by Tom Crittenden RASCALs 2015

Working with the Ektron Content Management System

HOW TO BURN A CD/DVD IN WINDOWS XP. Data Projects

Exchange Account (Outlook) Mail Cleanup

Windows File Management A Hands-on Class Presented by Edith Einhorn

Back it up. Get it back. Simple.Secure.Affordable.

How to create a portable encrypted USB Key using TrueCrypt

Using Websense Data Endpoint Client Software

BACKING UP YOUR PC. Ed Schwartz January 2012

Configuration for Professional Client Access

Note- If you have problems using ChronoSync for these kinds of operations, See Common Problems at the end of this document.

MS Excel Template Building and Mapping for Neat 5

File Management Where did it go? Teachers College Summer Workshop

How To Use An Apple Macbook With A Dock On Itunes Macbook V.Xo (Mac) And The Powerbar On A Pc Or Macbook (Apple) With A Powerbar (Apple Mac) On A Macbook

Microsoft SQL Database

MapInfo License Server Utility

ICP Data Entry Module Training document. HHC Data Entry Module Training Document

Apple Mac Fundamentals: A Tutorial. Updated 24/4/2013 By Mac Thing enquiries@macthing.co.uk Table of Contents:

Creating and Managing Shared Folders

SAS Analyst for Windows Tutorial

Optional Lab: Data Backup and Recovery in Windows 7

Most of your tasks in Windows XP will involve working with information

Migrating your PST files

The basic steps involved in installing FLEETMATE Enterprise Edition and preparing it for initial use are as follows:

Contents. Getting Started...1. Managing Your Drives Backing Up & Restoring Folders Synchronizing Folders Managing Security...

An Introduction to Using the Command Line Interface (CLI) to Work with Files and Directories

Cleaning your Windows 7, Windows XP and Macintosh OSX Computers

1 Introduction. 2 Project Browser. 3 FlowStone Editor

After installation of Rohos Disk Encryption, insert your USB pen drive to the computer and run the Rohos Disk Encryption application.

Instructions for Configuring a SAS Metadata Server for Use with JMP Clinical

Lab - Data Backup and Recovery in Windows 7

An Introduction to Using the Command Line Interface (CLI) to Work with Files and Directories

The Social Accelerator Setup Guide

Installation notes ICECUP, ICE-GB and DCPSE

Acer erecovery Management

TortoiseGIT / GIT Tutorial: Hosting a dedicated server with auto commit periodically on Windows 7 and Windows 8

SLIMIMAGE USER GUIDE SlimWare Utilities 1 of 12

Downloading and Installing Core FTP

Storage of Messages Using Microsoft Outlook

Step by step guide how to password protect your USB flash drive

If you re like most project managers, you juggle several projects at the same time.

Introduction to SAS on Windows

Installing a Personal Server on your PC

REDUCING YOUR MICROSOFT OUTLOOK MAILBOX SIZE

Word 2010: Mail Merge to with Attachments

CommuniGate Mail Archiving and Cleanup with Outlook 2007

Final data recovery software

Flip Video Digital Camcorder Startup Guide and Making Movies Tutorial Trevor Oakley, Teen Services Librarian, Saratoga Springs Public Library

Getting Started with ODM

Guide how to protect your private data with Rohos Disk Encryption

Recalling A Sent Message in Outlook 2010

CEFNS Web Hosting a Guide for CS212

Managing your accounts

Where Are My Primary Documents?

Using Macros to Automate SAS Processing Kari Richardson, SAS Institute, Cary, NC Eric Rossland, SAS Institute, Dallas, TX

C6 Easy Imaging Total Computer Backup. User Guide

Many home and small office networks exist for no

Managing Contacts in Outlook

1. Base Programming. GIORGIO RUSSOLILLO - Cours de prépara+on à la cer+fica+on SAS «Base Programming»

This document should help you get started. The most important button in TagNotate is the, which you can find on the bottom of each screen:!

Outlook 2007: Managing your mailbox

Network Edition Download / Installation Instructions

Application Note 116: Gauntlet System High Availability Using Replication

Make sure you have configured the following backup methods or your data may not be properly protected.

Accessing a Remote SAS Data Library. Transcript

Working with Windows Handout

1 Using a SQL Filter in Outlook 2002/2003 Views. 2 Defining the Problem The Task at Hand

Getting Started CHAPTER 1

File Management in the Catalog Software

How To Restore Your From Backup On An Exchange Service Pack 1 On A Windows (Windows 7) On A Microsoft Powerbook (Windows) On An Ubuntu 2003 Power

So you want to create an a Friend action

Transcription:

A short simple tutorial on SAS libname statements for SAS for Windows Michael Oakes UMN Epidemiology September 2008

The libname statement creates a library reference (libref) for a SAS program. A libref is a pointer or short-cut to a place on your computer hard-drive where data and programs and other computer files are stored and retrieved. A libref is like your home street address where mail is sent from and delivered to. In general, the basic syntax for a libname is libname name 'path'; Specifically, for my computer, it might look like this libname thesis d:\data\thesis';

Look, SAS needs to read data from someplace and write results to someplace. Where is this someplace? On your computer s hard-drive! Your computer hard-drive is like a town. There are lots of addresses and places where people live. Each town (ie, hard-drive) is a bit different. How does the postman know where to deliver your mail? A street address that s specific or particular to your town. But once you know it, you re all set. Just address your letter and it ll be delivered. In SAS, your data s street address is called a path.

Your computer s hard-drive is nothing more than a metallic disk that holds electronic files. It spins around fast like a music CD/DVD. The disk is organized some stuff here, some there. Some drives are messy, others are well organized.

It s easiest to think about your hard-drives organization as a outline. Some major groups, some minor or sub groups. Let s call groups folders. Thus, the stuff on your hard-drive organized into a bunch of major and sub folders.

We typically use Windows File Explorer to examine and/or make folders.

You often navigate to a particular folder which is specified by a path. Path Folder File (SAS) in Folder

OK so let s get SAS to read and write data files to this folder/directory It s easy! Just tell SAS the path Conceptually, we d like to say to SAS: Hey, read from and write data to 124 Main Street In fact, we tell SAS the path where (data) files are located Simply type the path into your program Just make sure the path you type actually exists on your hard-drive.

Path some actual place on your hard-drive Libref This is nothing more than some name a short-cut that will now be used to refer to the path it saves you from typing the path each and every time you wish to refer to it

The libref thesis refers to the path Once submitted to SAS, you only need to use the libref (ie, thesis) instead of the path it s a short-cut!

Path names do not include the file name! The path does not include the file name The path is like an address to a house. It does not tell you what s in the house This is the filename; the file you wish to read (ie, set) The file must exist in the folder specified by the libref In this case, the file does exist in the folder specified by the libref (ie, path)

The Libref (ie, path short-cut) is used to read/write files These match. Thus, SAS will look for the data set named my_data.sas7bdat in the D:\Data\Thesis folder

Here I specify two librefs One a referring to one path, another b to another path. You can specific as many as you wish!

To summarize: 1. Libname statements are written in SAS programs to tell SAS where to read/write data; they are nothing more than programming short-cuts. 2. The actual place where data is written is some folder on your hard-drive; each folder has an address, which we call a path. 3. Each short-cut has a name, called a library reference or libref. 4. The libref name can be anything really but keep it short and sweet; most folks use a or b or thesis or something like that. 5. Once one defines a libref in their program, they submit the program. This initializes or assigns the libref. After this step, you re good to go!

Let s do this First, decide where you d like data to written/read from. I use Windows File Explorer for this step.

So I ll now type this path into my SAS program

This line tells SAS to associate the libref thesis with the path This line tells SAS to write a dataset called analysis to the temp or default work. libref This line tells SAS to read a dataset called my_data from the thesis. libref

No libref? What s up?!!!? When no libref is written, SAS assumes you re refering to the temporary (ie, work.) libref The work. folder is just a place on your hard-drive. It s hidden from view, but the only difference with it is that the contents (files etc) are deleted after you close/exit SAS.