SAS in Data Cleaning.

Slides:



Advertisements
Similar presentations
Manipulating Strings String Functions. VB provides a large number of functions that facilitate working with strings. These are found in Microsoft.VisualBasic.Strings.
Advertisements

LECTURE 17 C++ Strings 18. 2Strings Creating String Objects 18 C-string C++ - string \0 Array of chars that is null terminated (‘\0’). Object.
Computer Science & Engineering 2111 Text Functions 1CSE 2111 Lecture-Text Functions.
Classes and Data Abstraction Lecture 9. Objects Models of things in the real world Defined in classes  Class name is the object name Example: Library.
Character and String definitions, algorithms, library functions Characters and Strings.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
 Just the word will find too many instances  Searching for blanks on both sides loses start and end  How to solve? › See last Thursday examples.
Grep, comm, and uniq. The grep Command The grep command allows a user to search for specific text inside a file. The grep command will find all occurrences.
Data Transformation Data cleaning. Importing Data Reading data from external formats Libname/Infile/Input for text form data Proc Import for Excel/Access.
1.
Computer Programming for Biologists Class 2 Oct 31 st, 2014 Karsten Hokamp
Advanced Programming Collage of Information Technology University of Palestine, Gaza Prepared by: Mahmoud Rafeek Alfarra Lecture 16: Working with Text.
2 Alerts and the If/Else Conditional Statement CONTINUED There's No Right Way to Do It There are, literally, a million ways to write any given script.
Strings IDIA 618 Spring 2013 Bridget M. Blodgett.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
Computer Programming for Biologists Class 5 Nov 20 st, 2014 Karsten Hokamp
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 9 More About Strings.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
Matlab Programming for Engineers Dr. Bashir NOURI Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
Manipulating Strings. What is a string? Data composed of text characters. The data is stored in consecutive bytes of memory. Each byte stores the ASCII.
C++ Basics #7 Basic Input and Output. In this video Standard output (cout) Standard input (cin) stringstream.
Working with Forms and Regular Expressions Validating a Web Form with JavaScript.
Java Overview. Comments in a Java Program Comments can be single line comments like C++ Example: //This is a Java Comment Comments can be spread over.
Computer Programming for Biologists Class 3 Nov 13 th, 2014 Karsten Hokamp
Chapter 9 Streams: Input stream: source of characters. Output stream: destination for characters. Up to now the input stream has defaulted to the keyboard.
Project 1: Using Arrays and Manipulating Strings Essentials for Design JavaScript Level Two Michael Brooks.
JavaScript III ECT 270 Robin Burke. Outline Validation examples password more complex Form validation Regular expressions.
Introduction To JavaScript. Putting it Together (page 11) All javascript must go in-between the script tags. All javascript must go in-between the script.
C++ String Class nalhareqi©2012. string u The string is any sequence of characters u To use strings, you need to include the header u The string is one.
Unit 11 –Reglar Expressions Instructor: Brent Presley.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming strings.
Part:2.  Keywords are words with special meaning in JavaScript  Keyword var ◦ Used to declare the names of variables ◦ A variable is a location in the.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
Chapter 7 Continued Arrays & Strings. Strings as Class Members Strings frequently appear as members of classes. The next example, a variation of the objpart.
ABAP/4 Defining Data Defining Data: –Data statement –Parameters statement –Tables statement –Constants statement –Data statement to define field strings.
An Introduction to Programming with C++ Sixth Edition Chapter 13 Strings.
More about strings in C++. String member functions The next three slides present information about functions that are members of the C++ string class.
#N14 Pattern Value (aka Substring attribute) SDD 1.1 Initial Discussion XXX = [Proposal | Initial Discussion | General Direction Proposal]
1 CSE 2337 Chapter 7 Organizing Data. 2 Overview Import unstructured data Concatenation Parse Create Excel Lists.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
ORAFACT Text Processing. ORAFACT Searching Inside Files grep - searches for patterns within files grep [options] [[-e] pattern] filename [...] -n shows.
Strings PART I STRINGS, DATES, AND TIMES. FUNDAMENTALS OF CHARATERS AND STRINGS VB represents characters using American National Standards Institute(ANSI)
Dept. of Animal Breeding and Genetics Programming basics & introduction to PERL Mats Pettersson.
CSC 4630 Perl 3 adapted from R. E. Beck. Problem But we worked on it first: Input: Read from a text file named in a command line argument Output: List.
Strings in Python String Methods. String methods You do not have to include the string library to use these! Since strings are objects, you use the dot.
1 Lecture 8 Shell Programming – Control Constructs COP 3353 Introduction to UNIX.
Single Row Functions Part I Week 2. Objectives –Describe types of single row functions in SQL –Describe and use character, number and date SQL functions.
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
Client-side (JavaScript) Validation. Associating a function with a click event – Part 1 Use the input tag’s onclick attribute to associate a function.
Lecture 24: 12/3/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
Introduction to Calculated Columns Variables, Conditionals, and String Manipulation PRESENTER: Cameron Blashka| Informer Implementation Specialist| April.
Chapter 6 JavaScript: Introduction to Scripting
Domain Testing Functional testing which tests the application by giving inputs and evaluating its appropriate outputs. system does not accept invalid and.
Computer Programming ||
CIRC Summer School 2017 Baowei Liu
MARK CARPENTER, Ph.D. Introduction to SAS Programming and Applications
Additive and Multiplicative Relationships
Chapter 7 - JavaScript: Introduction to Scripting
Advanced String handling
JavaScript: Introduction to Scripting
How are your SAS Skills? Chapter 1: Accessing Data (Question # 1)
Use Special Products to factor Cubics
Introduction to Computer Science
Chapter 7 - JavaScript: Introduction to Scripting
Chapter 7 - JavaScript: Introduction to Scripting
Lecture 5 SQL FUNCTIONS.
CIS 136 Building Mobile Apps
Chapter 7 - JavaScript: Introduction to Scripting
Lesson 3.3 Writing functions.
Presentation transcript:

SAS in Data Cleaning

Changing Text Words TRANWRD(source,target,replacement) replaces or removes all occurrences of a word in a character string Will change all occurrences of the target character string with the new one. Supplier= Tranwrd(supplier, "Incorporated", "Inc.");

Extract a specific ‘word’ from a string. SCAN(argument,n<,delimiters>)returns a given word from a character expression Extracts the n-th word from the string. The delimiters can define the word. Default delimiters are blank and special characters. If scan(Reverse(Trim(supplier)),1, " ") = "& " then do; …

Extracting specific characters by position var=SUBSTR(argument,position<,n>) extracts a substring from an argument. (var is any valid SAS variable name.) Position starts with 1. n is number of characters to extract Department= Substr(pcode,1,2);

If … Then IF condition THEN action; Or IF condition THEN DO; Statements END;

Multiple output data sets DATA One Two; SET Input; … OUTPUT One; OUTPUT Two;