Using an ICPSR set-up file to create a SAS dataset

Similar documents
Using a set-up file to read ASCII data into Stata

Epidemiology Principles of Biostatistics Chapter 3. Introduction to SAS. John Koval

SAS 101. Based on Learning SAS by Example: A Programmer s Guide Chapter 21, 22, & 23. By Tasha Chapman, Oregon Health Authority

Introduction to the SAS System

Desktop Command window

PHPM 672/677 Lab #2: Variables & Conditionals Due date: Submit by 11:59pm Monday 2/5 with Assignment 2

ECLT 5810 SAS Programming - Introduction

DSCI 325: Handout 2 Getting Data into SAS Spring 2017

SAS Training Spring 2006

Basic Concept Review

Chapter 1: Introduction to SAS

SAS Drug Development Program Portability

Using SAS Files CHAPTER 3

SAS PROGRAMMING AND APPLICATIONS (STAT 5110/6110): FALL 2015 Module 2

Rename. Introduction. Rename 1

A Guided Tour Through the SAS Windowing Environment Casey Cantrell, Clarion Consulting, Los Angeles, CA

STAT 7000: Experimental Statistics I

STAT:5400 Computing in Statistics

Lecture 1 Getting Started with SAS

STAT 3304/5304 Introduction to Statistical Computing. Introduction to SAS

Chapter 2: Getting Data Into SAS

Reading data in SAS and Descriptive Statistics

SAS Programming Basics

Session 2: Utilizing Resource Applications Quick Reference Guide FILE CENTER

April 4, SAS General Introduction

Importing CSV Data to All Character Variables Arthur L. Carpenter California Occidental Consultants, Anchorage, AK

Introduction to the SAS Macro Facility

Introduction to the OpenVMS Operating Environment

BVA LLP Web Portal User Guide

Introduction to the OpenVMS Operating Environment

BIOMETRICS INFORMATION

BBC Micro:Bit. Year 7. Teacher Guide and Planning

MATLAB - Lecture # 4

Chapter 2 Entering Data. Chapter Table of Contents

APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software. Each of these steps can be executed independently.

The DATA Statement: Efficiency Techniques

Lab #1: Introduction to Basic SAS Operations

ROES EVENTS SYSTEM TUTORIAL

Easy Windows Working with Disks, Folders, - and Files

Create a SAS Program to create the following files from the PREC2 sas data set created in LAB2.

SAS Data Libraries. Definition CHAPTER 26

SAS Windowing environment Tips and Tricks

ST Lab 1 - The basics of SAS

Sports Carnival Program Swimming Championships School Entry Instructions

Layer Library Manager 2.0

EMResource Resource Detail View

Impossible Solutions, Inc. JDF Ticket Creator & DP2 to Indigo scripts Reference Manual Rev

Chapter 2 The SAS Environment

Introduction to SAS Statistical Package

XPS1 Automated Multi-Sample Run Procedure

Changes and Enhancements

Creating a Do File in Stata

Introduction to SAS. Hsueh-Sheng Wu. Center for Family and Demographic Research. November 1, 2010

Using SAS/SHARE More Efficiently

Filtering Data in SAS Enterprise Guide

Chapter 1: An Overview of MATLAB

Customizing Your SAS Session

Getting started with Panopto Instructors

What Is SAS? CHAPTER 1 Essential Concepts of Base SAS Software

Beginning Tutorials. PROC FSEDIT NEW=newfilename LIKE=oldfilename; Fig. 4 - Specifying a WHERE Clause in FSEDIT. Data Editing

Matlab notes Matlab is a matrix-based, high-performance language for technical computing It integrates computation, visualisation and programming usin

You will be asked to enter your SUNet ID (Stanford University Network Identifier). See the following URL for information on obtaining a SUNet ID:

In order to update you will have to uninstall the current version and install the newer version using the same procedure.

Creating and Executing Stored Compiled DATA Step Programs

SAS Display Manager Windows. For Windows

Starting SAS. 2. Click START, ALL PROGRAMS, SAS, and the SAS ICON

Once file and folders are added to your Module Content area you will need to link to them using the Item tool.

Introduction to SAS. Cristina Murray-Krezan Research Assistant Professor of Internal Medicine Biostatistician, CTSC

Talend Data Preparation Free Desktop. Getting Started Guide V2.1

Function. Description

Internet Explorer 11 QUICK START GUIDE ADDRESS BAR SEARCH ACCESSING FMS

Chapter 5 Retrieving Documents

SAS Studio: A New Way to Program in SAS

Contents. Announcer Pro Version 4.6 Page 2 of 35 Version V4.6

Information Visualization

Don t jump ahead, there is more you need to do first in order for this to work properly.

Getting started with Panopto Instructors

Using the SQL Editor. Overview CHAPTER 11

This presentation, titled Uploading Files with the Ext File Content Type is another installment in the series of training modules instructing faculty

Using GSUBMIT command to customize the interface in SAS Xin Wang, Fountain Medical Technology Co., ltd, Nanjing, China

Reading in Data Directly from Microsoft Word Questionnaire Forms

SETTING UP SALESFORCE KNOWLEDGE

How to Install, Configure and Use sftp (Windows Version)

A SAS Macro Utility to Modify and Validate RTF Outputs for Regional Analyses Jagan Mohan Achi, PPD, Austin, TX Joshua N. Winters, PPD, Rochester, NY

Beginning Tutorials. Introduction to SAS/FSP in Version 8 Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California

View the full TurnItIn report. Submit the file to TurnItIn for originality checking

Electricity Forecasting Full Circle

MATLAB Introduction To Engineering for ECE Topics Covered: 1. Creating Script Files (.m files) 2. Using the Real Time Debugger

WORKING WITH YOUR PORTFOLIO

An Introduction to SAS/FSP Software Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California

ABSTRACT MORE THAN SYNTAX ORGANIZE YOUR WORK THE SAS ENTERPRISE GUIDE PROJECT. Paper 50-30

A Macro to Create Program Inventory for Analysis Data Reviewer s Guide Xianhua (Allen) Zeng, PAREXEL International, Shanghai, China

CHAPTER 2 Interacting with the SAS System under Windows

4H4Me Announcement Letter

FSEDIT Procedure Windows

SAP Favorites. You can manage your own SAP menu Favorites in multiple ways: 1. From the SAP menu bar click on Favorites to display your options:

Computer Programming ECIV 2303 Chapter 1 Starting with MATLAB Instructor: Dr. Talal Skaik Islamic University of Gaza Faculty of Engineering

No previous knowledge of Java is required for this workshop.

Using SAS Files CHAPTER 3

SYSTOC to PureOHS Employer Portal Install and Upgrade Instructions

Transcription:

Using an ICPSR set-up file to create a SAS dataset Name library and raw data files. From the Start menu, launch SAS, and in the Editor program, write the codes to create and name a folder in the SAS permanent file for this project, DS8872, and rename the raw data file, Input1, and save in the new folder, DS8872. Be sure to observe the SAS filenaming convention, which states that names are no longer than 8 characters, start with a letter, and contain only letters, numbers, or underscores (_). The Log above the Editor confirms action complete and shows errors, if any. Move data and set-up file into new SAS folder. From the zip folder downloaded from ICPSR, select the set-up.sas file and the data.txt file and drag and drop them into the new folder, DS8872. If there are more than one dataset in the downloaded file, be sure that the set-up file and the data file have the same dataset number, which is the second set of numbers in the name, such as.0001. ICPSR - A PARTNER IN SOCIAL SCIENCE RESEARCH Page 1

Delete comment marks from procedures. Comment marks precede (/*) and follow (*/) statements that are not enabled in the set-up file. These statements contain the labels and names for values and variables, labeling for missing data and other useful information. To include the statements, delete the marks around the statement. Continue working through the file until you reach the DATA and INFILE statements. Edit Data and Infile Commands. The DATA statement names the new dataset preceded by the library s name, DS8872.da8872. The INFILE statement points to the raw data or its location to create the new dataset. We have already given the raw data a SAS filename, Infile1. Highlight and delete Data-filename and replace it with Infile1. Retain the LRECL if given. Continue working through the file removing comment marks, as appropriate. ICPSR - A PARTNER IN SOCIAL SCIENCE RESEARCH Page 2

Run set-up file. Once the DATA and INFILE commands have been edited to include the names and location of the files and the naming of variables and value labels have been enabled, check to be sure that there is a RUN; command in place. Then click on the icon at the top of the window to run the file. Confirm success. Here is the confirmation in the Log file that the new SAS dataset has been created. ICPSR - A PARTNER IN SOCIAL SCIENCE RESEARCH Page 3

Edit and save set-up file. Copy and paste the Libname and Filename commands from the beginning of this process into the beginning of the set-up file after the heading and before the first PROC FORMAT statement. Write a short statement about what the statements accomplish preceded by an asterisk (*) and followed by a semicolon (;). Save the file to the folder, DS8872 with a name that is descriptive, such as edited.08872-0001.setup. Create Formats Catalog for future use. Start with a short statement about the statement preceded by an asterisk (*) and followed by a semi-colon (;). This statement saves the Formats Catalog that the set-up file created so it can be used with the dataset in the future. Use a PROC FORMAT statement and the option CNTLOUT=DS8872.Formats to create the catalog and add a Run ; command. Be sure to close each line with a semi-colon. Highlight the PROC FORMAT AND RUN statements and go to the menus at the top and click on Submit. After confirming in the log file that the catalog has been successfully created, save the edited set up file again. In subsequent sessions using this dataset, use a PROC FORMAT and CNTLIN option to make the data and variable labels and names available in the SAS session. ICPSR - A PARTNER IN SOCIAL SCIENCE RESEARCH Page 4

Open dataset for subsequent use. Open SAS and begin in a new Program Editor. Write a short note about opening a dataset in SAS and applying the formats catalog. Remember to start with an asterisk (*) and end with a semi-colon (;). Name the library DS8872 using the LIBNAME statement and enter the path to the file. Titling the files is optional but is included here following the LIBNAME. Use the PROC FORMAT statement with the option CNTLIN and point to the formats catalog to make the formats accessible to SAS, cntlin=ds8872.formats. A PROC CONTENT statement that describes the dataset can be used but is also optional. Add a RUN ; command at the end of the script and go to the menus at the top and click on Submit. Confirm dataset opened in SAS. The results of the PROC CONTENT statement confirms the location of the file, the number of cases, and the path to the file. This dataset is ready for analysis. ICPSR - A PARTNER IN SOCIAL SCIENCE RESEARCH Page 5