Skip to Main Content
Hands-On SAS for Data Analysis
book

Hands-On SAS for Data Analysis

by Harish Gulati
September 2019
Beginner to intermediate content levelBeginner to intermediate
346 pages
7h 35m
English
Packt Publishing
Content preview from Hands-On SAS for Data Analysis

The Scan function

Unless you can successfully identify a part of the string successfully, replacement or modification of the string value is impossible. In the following code block, we will review some functions that help in string identification:

Data Cities;Input City $50.;First=Scan(City, +1);Last=Scan(City,-1);Third=Scan(City,4);Datalines;Chicago Paris London Geneva Dublin;

The following output shows the words identified from the given string:

The First and the Last words in the string are identified using the positive and negative count. The positive count looks for the first instance of a word in a string from left to right. A negative ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Big Data Analytics with SAS

Big Data Analytics with SAS

David Pope, Subhashini S Tripathi
An Introduction to SAS Visual Analytics

An Introduction to SAS Visual Analytics

Tricia Aanderud, Rob Collum, Ryan Kumpfmiller

Publisher Resources

ISBN: 9781788839822Supplemental Content