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

Transcription

1 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 ICPSR - A PARTNER IN SOCIAL SCIENCE RESEARCH Page 1

2 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

3 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

4 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 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

5 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

Epidemiology 9509 Principles of Biostatistics Chapter 3 John Koval Department of Epidemiology and Biostatistics University of Western Ontario What we will do today We will learn to use use SAS to 1. read

PHPM 672/677 Lab #2: Variables & Conditionals Due date: Submit by 11:59pm Monday 2/5 with Assignment 2 Overview Most assignments will have a companion lab to help you learn the task and should cover similar

DSCI 325: Handout 2 Getting Data into SAS Spring 2017 Data sets come in many different formats. In some situations, data sets are stored on paper (e.g., surveys) and other times data are stored in huge

SAS Training Spring 2006 Coxe/Maner/Aiken Introduction to SAS: This is what SAS looks like when you first open it: There is a Log window on top; this will let you know what SAS is doing and if SAS encountered

Chapter 1: Introduction to SAS SAS programs: A sequence of statements in a particular order. Rules for SAS statements: 1. Every SAS statement ends in a semicolon!!!; 2. Upper/lower case does not matter

Rename Introduction Rename 1 Rename allows you to quickly rename multiple files/folders at once, formatting names and extensions by adding, removing, replacing text, and by numbering. It can be particularly

STAT 3304/5304 Introduction to Statistical Computing Introduction to SAS What is SAS? SAS (originally an acronym for Statistical Analysis System, now it is not an acronym for anything) is a program designed

Session 2: Utilizing Resource Applications Quick Reference Guide FILE CENTER Many of you are probably familiar with a Shared Drive on your Organization s network. The File Center is similar in concept.

Introduction to the SAS Macro Facility Uses for SAS Macros The macro language allows for programs that are dynamic capable of selfmodification. The major components of the macro language include: Macro

BBC Micro:Bit Year 7 Teacher Guide and Planning Micro:Bit Block Editor Planning Support - Teacher help to complete the steps required for the Micro:Bit to run successfully - 1:1 peer help and partner working.

The DATA Statement: Efficiency Techniques S. David Riba, JADE Tech, Inc., Clearwater, FL ABSTRACT One of those SAS statements that everyone learns in the first day of class, the DATA statement rarely gets

Lab #1: Introduction to Basic SAS Operations Getting Started: OVERVIEW OF SAS (access lab pages at http://www.stat.lsu.edu/exstlab/) There are several ways to open the SAS program. You may have a SAS icon

Paper 2564-2018 SAS Windowing environment Tips and Tricks Ravi Venkata and Mahesh Minnakanti, The EMMES Corporation; ABSTRACT If you work with SAS, then you probably find yourself repeating steps and tasks

ST 512 - Lab 1 - The basics of SAS What is SAS? SAS is a programming language based in C. For the most part SAS works in procedures called proc s. For instance, to do a correlation analysis there is proc

Sports Carnival Program Swimming Championships School Entry Instructions Go to CEO website (http://www.ceo.woll.catholic.edu.au/) and look for the swimmer. Click on the swimmer to access information about

CADMANAGERTOOLS.COM Layer Library Manager 2.0 Tool to manage Layer library for AutoCAD and Verticals Compatible with AutoCAD 2013 to 2018 Introduction: The LayerLibraryManager is a powerful, easy to use

Chapter 2 The SAS Environment Abstract In this chapter, we begin to become familiar with the basic SAS working environment. We introduce the basic 3-screen layout, how to navigate the SAS Explorer window,

XPS1 Automated Multi-Sample Run Procedure Follow the XPS Operating Procedure to load samples into the SAC chamber. Once the samples are in the SAC chamber, the following procedure can be used to automate

Updated July 2018 Creating a Do File in Stata This set of notes describes how to create a do file within the computer program Stata. It assumes that you have set Stata up on your computer (see the Getting

Introduction to SAS Hsueh-Sheng Wu Center for Family and Demographic Research November 1, 2010 1 Outline What is SAS? Things you need to know before using SAS SAS user interface Using SAS to manage data

Using More Efficiently by Philip R Holland, Holland Numerics Ltd, UK Abstract is a very powerful product which allow concurrent access to SAS Datasets for reading and updating. However, if not used with

Filtering Data in SAS Enterprise Guide Working with SAS Enterprise Guide (EG) can seem a bit overwhelming, at first. This is the first in a series of articles that will make the transition to using SAS

Chapter 1: An Overview of MATLAB MATLAB is: A high-level language and interactive environment for numerical computation, visualization, and programming MATLAB can: Be used as a calculator, easily create

Getting started with Panopto Instructors What is Panopto? Panopto is a video content management system for uploading, managing and sharing recorded lectures, flipped classroom videos, campus events, and

Matlab notes Matlab is a matrix-based, high-performance language for technical computing It integrates computation, visualisation and programming using familiar mathematical notation The name Matlab stands

2011-2012 Using DEWI This document covers the basic features of the Data Extraction Web Interface (DEWI) System. DEWI is an easy-to-use, platform independent one-stop-shop for data discovery and extraction.

Installing the 3M Cloud Library app on your Kindle Fire DISCLAIMER These instructions are to be used as a reference only. Please note that by downloading the 3M Cloud Library app you assume all risk of

VITAL how to guides elearning Unit Last updated: 01.10.2010 Course Files tool Overview Course Files tool enables you to: Quickly copy large numbers of files into a VITAL module. Files can be dragged and

Function Check In Get / Checkout Description Checking in a file uploads the file from the user s hard drive into the vault and creates a new file version with any changes to the file that have been saved.

QUICK START GUIDE While Internet Explorer 11 does not look that much different to what you are used to, there are a few useful features that have been added/enhanced that may make your life easier. ADDRESS

Chapter 5 Retrieving Documents Each time a document is added to ApplicationXtender Web Access, index information is added to identify the document. This index information is used for document retrieval.

SAS Studio: A New Way to Program in SAS Lora D Delwiche, Winters, CA Susan J Slaughter, Avocet Solutions, Davis, CA ABSTRACT SAS Studio is an important new interface for SAS, designed for both traditional

With the release of our new PD 502 & PD 602 portable terminals, you are required to use CPS v5.06.01.009 programming software. To maintain compatibility between the different DMR model radios, you will

What is Panopto? Panopto is a video content management system for uploading, managing and sharing recorded lectures, flipped classroom videos, campus events, and more. It comes with built-in video analytics,

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

PharmaSUG China 2015 - Paper PO71 Using GSUBMIT command to customize the interface in SAS Xin Wang, Fountain Medical Technology Co., ltd, Nanjing, China One of the reasons that SAS is widely used as the

How to Install, Configure and Use sftp (Windows Version) The sftp secure File Transfer Protocol allows you to transfer patient datasets to and from IDT s server securely. All data transfers are encrypted

25.108 Introduction To Engineering for ECE Topics Covered: 1. Creating Script Files (.m files) 2. Using the Real Time Debugger SCRIPT FILE 77-78 A script file is a sequence of MATLAB commands, called a

WORKING WITH YOUR PORTFOLIO THE INFORMATION INCLUDED HERE COVERS HOW TO CREATE YOUR PORTFOLIO FOLDER, HOW TO LINK DOCUMENTS TO YOUR TABLE OF CONTENTS, AND HOW TO SAVE / SEND YOUR PORTFOLIO TO YOUR PROFESSOR

25 CHAPTER 2 Interacting with the SAS System under Windows Overview of the SAS System Interface 27 Accessing SAS Commands, Tools, and Options from Menus 28 Using the Docking View 29 Using the Window Bar

An announcement letter introducing 4H4Me can be created using 4HPlus! SQL mail merge files and Word s mail merge. This letter includes user IDs and passwords needed for members and leaders to log on to

SAS webaf for Java Application Development, a First Sip Mickey Waxman University of Kansas, Lawrence, Kansas Larry Hoyle University of Kansas, Lawrence, Kansas ABSTRACT SAS webaf is an integrated development