©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina Chapter 17 supplement: Review of Formatting Data STAT 541.

Slides:



Advertisements
Similar presentations
Dates and Times SAS Date, Time and Date- Time Formats.
Advertisements

Examples from SAS Functions by Example Ron Cody
Chapter 9: Introducing Macro Variables 1 © Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
What is a pointer? First of all, it is a variable, just like other variables you studied So it has type, storage etc. Difference: it can only store the.
Chapter 11: Creating and Using Macro Programs 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
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 ICS103 Programming in C Lecture 3: Introduction to C (2)
1 Outline 13.1Introduction 13.2A Simple Program: Printing a Line of Text in a Web Page 13.3Another JavaScript Program: Adding Integers 13.4Memory Concepts.
1 Lecture 2  Input-Process-Output  The Hello-world program  A Feet-to-inches program  Variables, expressions, assignments & initialization  printf()
©2004 Brooks/Cole Chapter 8 Arrays. Figures ©2004 Brooks/Cole CS 119: Intro to JavaFall 2005 Sometimes we have lists of data values that all need to be.
Introduction to Python
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.
Understanding SAS Data Step Processing Alan C. Elliott stattutorials.com.
Into to SAS ®. 2 List the components of a SAS program. Open an existing SAS program and run it. Objectives.
Creating SAS® Data Sets
Data Cleaning 101 Ron Cody, Ed.D Robert Wood Johnson Medical School Piscataway, NJ.
Welcome to SAS…Session..!. What is SAS..! A Complete programming language with report formatting with statistical and mathematical capabilities.
FORMAT FESTIVAL AN INTRODUCTION TO SAS® FORMATS AND INFORMATS By David Maddox.
Chapter 10:Processing Macro Variables at Execution Time 1 STAT 541 © Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
C++ for Everyone by Cay Horstmann Copyright © 2012 by John Wiley & Sons. All rights reserved Slides by Evan Gallagher Fundamental Data Types 09/09/13.
Fortran 1- Basics Chapters 1-2 in your Fortran book.
Chapter 2 Overview of C Part I J. H. Wang ( 王正豪 ), Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National Taipei University.
Chapter 15: Combining Data Horizontally 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 3 Processing and Interactive Input. 2 Assignment  The general syntax for an assignment statement is variable = operand; The operand to the right.
Input, Output, and Processing
Chapter 1: Introduction to SAS  SAS programs: A sequence of statements in a particular order  Rules for SAS statements: –Every SAS statement ends in.
Linux+ Guide to Linux Certification, Third Edition
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
CSE1222: Lecture 3The Ohio State University1. Assignment Operations  The C++ assignment operator is: =  Examples: x = 3 * 5; y = x – 7; y = y + 4; Do.
Array in C++ / review. An array contains multiple objects of identical types stored sequentially in memory. The individual objects in an array, referred.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 8 Advanced SQL.
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.
Chapter 22: Using Best Practices 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Introducing Python CS 4320, SPRING Lexical Structure Two aspects of Python syntax may be challenging to Java programmers Indenting ◦Indenting is.
Creating and Using Custom Formats for Data Manipulation and Summarization Presented by John Schmitz, Ph.D. Schmitz Analytic Solutions, LLC Certified Advanced.
 2000 Deitel & Associates, Inc. All rights reserved. Outline 8.1Introduction 8.2A Simple Program: Printing a Line of Text in a Web Page 8.3Another JavaScript.
Chapter 17: Formatting Data 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 1: Overview of SAS System Basic Concepts of SAS System.
Chapter 19: Introduction to Efficient SAS Programming 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
JavaScript 1 COE 201- Computer Proficiency. Introduction JavaScript scripting language ▫Originally created by Netscape ▫Facilitates disciplined approach.
Computing with SAS Software A SAS program consists of SAS statements. 1. The DATA step consists of SAS statements that define your data and create a SAS.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
PHP Variables.  Variables are "containers" for storing information. How to Declare PHP Variables  In PHP, a variable starts with the $ sign, followed.
“LAG with a WHERE” and other DATA Step Stories Neil Howard A.
Chapter 17 Supplement: Alternatives to IF-THEN/ELSE Processing STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South.
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
Chapter 21: Controlling Data Storage Space 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
Chapter 14: Combining Data Vertically 1 STAT 541 ©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina.
An Introduction to Programming with C++ Sixth Edition Chapter 5 The Selection Structure.
Online Programming| Online Training| Real Time Projects | Certifications |Online Classes| Corporate Training |Jobs| CONTACT US: STANSYS SOFTWARE SOLUTIONS.
A Sample Program #include using namespace std; int main(void) { cout
1 C Syntax and Semantics Dr. Sherif Mohamed Tawfik Lecture Two.
SAS Certification Prep Guide Chapter 7 Creating and Applying User-Defined Formats.
Basic SAS Functions in Version 8.2 Kim Michalski Office of the Actuary Rick Andrews Office of Research, Development, and Information.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 5 & 6 By Ravi Mandal.
Revision Lecture
ICS103 Programming in C Lecture 3: Introduction to C (2)
Chapter 2: Getting Data into SAS
The Selection Structure
Chapter 19: Introduction to Efficient SAS Programming
Chapter 13: Creating Samples and Indexes
Chapter 18: Modifying SAS Data Sets and Tracking Changes
Chapter 4: Sorting, Printing, Summarizing
Chapters 5 and 7 supplement
Chapter 24 (4th ed.): Creating Functions
First Python Program Professor Hugh C. Lauer CS-1004 — Introduction to Programming for Non-Majors (Slides include materials from Python Programming: An.
Using Macros to Solve the Collation Problem
Presentation transcript:

©Spring 2012 Imelda Go, John Grego, Jennifer Lasecki and the University of South Carolina Chapter 17 supplement: Review of Formatting Data STAT 541

Informats (input-related) how to read data values CONVERT [interpretation] Formats (output-related) how to write data values PRINT [appearance] are instructions

Standard examples: 2.1 $5. $char5. yymmdd8. User- Defined  PROC FORMAT Formats and Informats

original values:  desired values: Standard Informat for Input

Standard Informat for Fixed-Width Input

Standard Informat for Delimited Input The : argument indicates length is up to 19 characters. with the LENGTH statement

Character Begins with $ INFORMAT + up to 30 characters FORMAT + up to 31 characters Numeric INFORMAT Up to 31 characters FORMAT Up to 32 characters Naming Conventions for User-Defined Formats (VALUE, PICTURE) and Informats (INVALUE) in PROC FORMAT Use valid SAS names that do not end in a number. VALID $gender $gender2F INVALID $gender2 $2gender VALID gender gender2F INVALID gender2 2gender In SAS code, refer to them with a period following their name, BUT do not use the period in PROC FORMAT.

User-Defined Informat for Input

Data Validation with Informats

Standard and User-Defined Formats for Output Appearance of Numbers in Output

Why are formats and informats useful for SAS date variables?

Date type  an integer equal to the number of days elapsed since Jan. 1, 1960 DateSAS Date Value Dec. 31, 1959 Jan. 1, Jan. 2, Jan. 10,

Appearance of SAS Dates (Numbers) in Output

Appearance of Numbers in Output

Formats for Output: Just a PROC

Formats for Output: Many PROCs

A numeric missing value in SAS means there is no data value. Missing Value TypeRepresentation Description Regular Numeric. Single period Special Numeric.a.b.c..x.y.z Single period followed by a letter These are not case-sensitive. (.A is equivalent to.a ). Special Numeric._ Single period followed by an underscore Numeric Missing Values

Meaning of Special Numeric Missing Values

Format for Group Processing

Create new variables from existing ones (recode) with PUT and INPUT functions

General syntax without optional arguments: PUT(source,format) Always returns a character value by applying a format to an expression (source) Converts numeric to character values The format must be of the same type as source. PUT Function and Format

General syntax without optional arguments: INPUT(source,informat) Returns a value by applying an informat to an expression ( source ) Informat type determines numeric or character type result. Converts character to numeric values INPUT Function and Informat

Array Index Values are Easier to Follow

LOOKUP TABLES

Q: What do I do if there’s A LOT to type?? A: If the information is in a data set, you can create the format automatically.

INPUT CONTROL DATA SETS (CNTLIN=) TYPE: C for Character FORMAT N for Numeric FORMAT I for Numeric INFORMAT J for Character INFORMAT

OUTPUT CONTROL DATA SETS (CNTLOUT=)

PROC CONTENTS labels describe variables in output control data sets.

User-defined formats can be stored in format catalogs and accessed later. Later: PC SAS Example

NESTED FORMATS