Chapter 19: Introduction to Efficient SAS Programming

Slides:



Advertisements
Similar presentations
Chapter 11 Introduction to Programming in C
Advertisements

Computer Organization and Architecture
Managing Processing Using PROC SQL Chapter 8 1 Imelda Go, John Grego, Jennifer Lasecki, 2011.
Performing Queries Using PROC SQL Chapter 1 1 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 13: Creating Samples and Indexes 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
1 Virtual Machine Resource Monitoring and Networking of Virtual Machines Ananth I. Sundararaj Department of Computer Science Northwestern University July.
Silberschatz, Galvin and Gagne  Operating System Concepts Multistep Processing of a User Program User programs go through several steps before.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
SAS: Managing Memory and Optimizing System Performance Jacek Czajkowski 09/29/2008.
CS 0008 Day 2 1. Today Hardware and Software How computers store data How a program works Operators, types, input Print function Running the debugger.
An Introduction to Operating Systems. Definition  An Operating System, or OS, is low-level software that enables a user and higher-level application.
Chapter 18: Modifying SAS Data Sets and Tracking Changes 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
Chapter 3: Combining Tables Horizontally using PROC SQL 1 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Swapping and Contiguous Memory Allocation. Multistep Processing of a User Program User programs go through several steps before being run. Program components.
Operating Systems Chapter 8
ITEC 502 컴퓨터 시스템 및 실습 Chapter 8-1: I/O Management Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina Chapter 17 supplement: Review of Formatting Data STAT 541.
Creating and Managing Indexes Using Proc SQL Chapter 6 1.
Chapter 15: Combining Data Horizontally 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 4 Processes. Process: what is it? A program in execution A program in execution usually usually Can also have suspended or waiting processes Can.
Chapter 1: Introduction to SAS  SAS programs: A sequence of statements in a particular order  Rules for SAS statements: –Every SAS statement ends in.
1 Chapter 1: Introduction 1.1: Course Logistics 1.2: Measuring Efficiencies 1.3: SAS DATA Step Processing.
Chapter 16: Using Lookup Tables to Match Data 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Introduction. What is the course about?  Concepts History History Data representation, logic Data representation, logic Hardware: CPU, memory, storage,
Chapter 22: Using Best Practices 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Main Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The.
Chapter 17: Formatting Data 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 19: Introduction to Efficient SAS Programming 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Efficient SAS programming with Large Data Aidan McDermott Computing Group, March 2007.
Chapter 4: Combining Tables Vertically using PROC SQL 1 © Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 17 Supplement: Alternatives to IF-THEN/ELSE Processing STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South.
Chapter 23: Selecting Efficient Sorting Strategies 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 21: Controlling Data Storage Space 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 6: Modifying and Combining Data Sets  The SET statement is a powerful statement in the DATA step DATA newdatasetname; SET olddatasetname;.. run;
Chapter 14: Combining Data Vertically 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
Working Efficiently with Large SAS® Datasets Vishal Jain Senior Programmer.
Chapter 2 Memory and process management
Chapter 5: Enhancing Your Output with ODS
Chapter 6: Modifying and Combining Data Sets
Chapter 2: System Structures
Jonathan W. Duggins; James Blum NC State University; UNC Wilmington
Chapter 2: Getting Data into SAS
Chapter 13: Creating Samples and Indexes
Chapter 8: Main Memory.
Chapter 18: Modifying SAS Data Sets and Tracking Changes
Former Chapter 23: Selecting Efficient Sorting Strategies
O.S Lecture 13 Virtual Memory.
Chapter 11 Introduction to Programming in C
SAS Essentials How SAS Thinks
Chapters 5 and 7 supplement
Chapter 24 (4th ed.): Creating Functions
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Chapter 2: System Structures
Multistep Processing of a User Program
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
So far… Text RO …. printf() RW link printf Linking, loading
Main Memory Background Swapping Contiguous Allocation Paging
Defining and Calling a Macro
Chapter 8: Memory management
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
Lecture 3: Main Memory.
Program Testing and Performance
Using Macros to Solve the Collation Problem
Troubleshooting Techniques(*)
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Management From the memory view, we can list four important tasks that the OS is responsible for ; To know the used and unused memory partitions To allocate.
Chapter 24: Querying Data Efficiently
Presentation transcript:

Chapter 19: Introduction to Efficient SAS Programming STAT 541 Chapter 19: Introduction to Efficient SAS Programming ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina

SAS System Options to Track Resources We have already used STIMER CPU Time and Real Time FULLSTIMER tracks additional resources (though perhaps not as many as listed here) I/O swaps Number of buffers Buffer size Memory

SAS System Options to Track Resources My system’s output from FULLSTIMER: NOTE: PROCEDURE SORT used (Total process time):      real time           0.04 seconds      user cpu time       0.00 seconds      system cpu time     0.00 seconds      Memory                            88k      OS Memory                         10920k      Timestamp            4/16/2012  11:26:43 AM

SAS System Options to Track Resources Typical considerations Real time/CPU time Increasing buffer size/# of pages vs. Memory Decreasing I/O vs. Memory 4

Benchmarking The chapters that follow will use benchmarking to study Memory Usage Data Storage Space Best Practices Efficient Sorting 5

Benchmarking SAS uses data sets of various sizes from SASUSER for benchmarking on a variety of straightforward tasks Benchmarking guidelines are detailed Include only essential code Replication Realistic conditions 6

Chapter 20: Controlling Memory Usage STAT 541 Chapter 20: Controlling Memory Usage ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina 7

Page Size and Buffers SAS copies data a “page” at a time to a buffer in memory Observations are loaded into the PDV (Program Data Vector) one at a time, processed, then read to an output buffer When the output buffer is full, its contents are written to an output SAS data set. I/O is measured when input data is copied to the input buffer and when output buffer contents are written to the external data set. 8

Page Size and Buffers We could reduce the number of I/O operations (or swaps) by increasing the page (or buffer) size, or by increasing the number of buffers (some systems allow only a single buffer) PROC CONTENTS can print the page size Use BUFSIZE and BUFNO options to change the page size and # of buffers Obviously, such changes should not be made without an understanding of system defaults etc 9

Page Size and Buffers Example proc contents data=stat541.meddb; run; data meddb; set stat541.meddb; data meddb (bufsize=6144 bufno=2); 10

SASFILE The SASFILE statement holds the data set in memory. Useful when The data will be used for multiple data/proc steps Sufficient real memory is available A part of the data can be processed separately Be aware of unintended consequences when not enough memory is available. 11