SAS Functions by Example, Second Edition
295 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris

SAS Functions by Example, Second Edition , livre ebook

-

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris
Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus
295 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus

Description

Fully updated for SAS 9.2, Ron Cody's SAS Functions by Example, Second Edition, is a must-have reference for anyone who programs in Base SAS. With the addition of functions new to SAS 9.2, this comprehensive reference manual now includes more than 200 functions, including new character, date and time, distance, probability, sort, and special functions. This new edition also contains more examples for existing functions and more details concerning optional arguments.
Like the first edition, the new edition also includes a list of SAS programs, an alphabetic list of all the functions in the book, and a comprehensive index of functions and tasks. Beginning and experienced SAS users will benefit from this useful reference guide to SAS functions.
This book is part of the SAS Press program.

Sujets

Informations

Publié par
Date de parution 11 mars 2010
Nombre de lectures 0
EAN13 9781607643647
Langue English

Informations légales : prix de location à la page 0,0170€. Cette information est donnée uniquement à titre indicatif conformément à la législation en vigueur.

Extrait

The correct bibliographic citation for this manual is asfollows: Cody, Ron. 2010. SAS Functions by Example, SecondEdition. Cary, NC: SAS Institute Inc.
SAS Functions by Example,Second Edition
Copyright 2010, SASInstitute Inc., Cary, NC, USA
ISBN 978-1-60764-340-1
ISBN 978-1-60764-364-7 (electronic book)
All rights reserved. Produced in the United States of America.
For a hard-copy book: No part of this publication maybe reproduced, stored in a retrieval system, or transmitted, in any form or byany means, electronic, mechanical, photocopying, or otherwise, without theprior written permission of the publisher, SAS Institute Inc.
For a Web download or e-book: Your use of thispublication shall be governed by the terms established by the vendor at thetime you acquire this publication.
U.S.Government Restricted Rights Notice: Use, duplication, or disclosure ofthis software and related documentation by the U.S. government is subject tothe Agreement with SAS Institute and the restrictions set forth in FAR52.227-19, Commercial Computer Software-Restricted Rights (June 1987).
SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513.
1st printing, March 2010
SAS Publishing provides acomplete selection of books and electronic products to help customers use SASsoftware to its fullest potential. For more information about our e-books, e-learningproducts, CDs, and hard-copy books, visit the SAS Publishing Web site at support.sas.com/publishing or call1-800-727-3228.
SAS and all other SAS Institute Inc. product orservice names are registered trademarks or trademarks of SAS Institute Inc. inthe USA and other countries. indicates USA registration.
Other brand and product names are registered trademarks or trademarksof their respective companies.
391054pt071612
Contents

List of Programs
Preface to the Second Edition
Preface to the First Edition
Acknowledgments
Introduction

Chapter 1 Character Functions
Chapter 2 Perl Regular Expressions
Chapter 3 Sort Functions
Chapter 4 Date and Time Functions
Chapter 5 Array Functions
Chapter 6 TruncationFunctions
Chapter 7 Descriptive Statistics Functions
Chapter 8 Mathematical and Numeric Functions
Chapter 9 Random Number Functions
Chapter 10 SpecialFunctions
Chapter 11 Stateand ZIP Code Functions
Chapter 12 TrigonometricFunctions
Chapter 13 MacroFunctions
Chapter 14 SASFile I/O Functions
Chapter 15 VariableInformation Functions
Chapter 16 BitwiseLogical Functions

List of Functions
Index
List of Programs

Chapter 1
Program 1.1: How SAS determines storage lengths ofcharacter variables
Program 1.2: Running PROC CONTENTS to determine storagelengths
Program1.3: Changing lowercase to uppercase for all character variablesin a data set
Program 1.4: Program to demonstrate the LOWCASEfunction
Program 1.5: Capitalizing the first letter of each wordin a string
Program 1.6: Program to capitalize the first letter ofeach word in a string
Program1.7: Using the COMPBL function to convert multiple blanks to asingle blank
Program 1.8: Removing dashes and parentheses from phonenumbers
Program1.9: Converting Social Security numbers from character tonumeric
Program 1.10: Counting the number of digits in a string
Program 1.11: Demonstrating the ANY characterfunctions
Program1.12: Using the functions ANYDIGIT and ANYSPACE to find thefirst number in a string
Program 1.13: Demonstrating the NOT characterfunctions
Program1.14: Using the FIND and FINDC functions to search for stringsand characters
Program1.15: Converting numeric values of mixed units (e.g., kg and lbs)to a single numeric quantity
Program1.16: Searching for one of several characters in a character variable
Program 1.17: Demonstrating the o modifier with FINDC
Program 1.18: Searching for a word using the FINDWfunction
Program 1.19: Reading dates in a mixture of formats
Program1.20: Using the VERIFY function to check for invalid characterdata values
Program1.21: Extracting portions of a character value and creating acharacter variable and a numeric value
Program1.22: Extracting the last two characters from a string, regardlessof the length
Program 1.23: Using the SUBSTR function to unpack a string
Program1.24: Demonstrating the SUBSTR function on the left-hand sideof the equal sign
Program1.25: Demonstrating the unique features of the SUBSTRN function
Program 1.26: Demonstrating the CHAR function
Program 1.27: Demonstrating the FIRST function
Program 1.28: Demonstrating the three concatenation CALLroutines
Program 1.29: Demonstrating the five concatenationfunctions
Program1.30: Left-aligning text values from variables read with the$CHAR informat
Program 1.31: Right-aligning text values
Program1.32: Creating a program to concatenate first, middle, and lastnames into a single variable
Program1.33: Demonstrating the difference between the TRIM and TRIMNfunctions
Program1.34: Using the STRIP function to strip both leading and trailingblanks from a string
Program 1.35: Comparing two strings using the COMPAREfunction
Program 1.36: Using the COMPGED function with a SAS n -literal
Program 1.37: Demonstration of the generalized editdistance (COMPGED)and Levenshtein edit distance (COMPLEV) functions
Program1.38: Changing the effect of the call to COMPCOST on the resultfrom COMPGED
Program 1.39 Fuzzy matchingon names using the SOUNDEX function
Program1.40: Using the SPEDIS function to match Social Securitynumbers that are the same or differ by a small amount
Program 1.41: Fuzzy matching on names using thespelling distance (SPEDIS) function
Program1.42: A novel use of the SCAN function to convert mixednumbers to decimal values
Program 1.43: Program to reada tab-delimited file
Program1.44: Alphabetical listing by last name when the name fieldcontains first name, possibly middle initial, and last name
Program 1.45: Demonstrating the SCAN CALL routine
Program 1.46: Using CALL SCAN to count the words in astring
Program1.47: Converting values of '1','2','3','4', and '5' to 'A','B','C','D', and'E' respectively
Program 1.48: Convertingthe values Y and N to 1's and 0's
Program1.49: Converting words such as Street to their abbreviationssuch as St. in an address
Program1.50: Demonstrating the LENGTH, LENGTHC, LENGTHM, andLENGTHN functions
Program1.51: Using the COUNT function to count the number of times theword the appears in a string
Program1.52: Demonstrating the COUNTC function to find one or morecharacters or to check if characters are not present in a string
Program 1.53: Demonstrating the COUNTW function
Program 1.54: Usingthe CHOOSEC function to randomly select one of three reviewers for each candidate (numbered 1 to n )
Program1.55: Using CHOOSEN to randomly select a reviewer (bynumber) for each of n candidates
Program1.56: Determining if there are any missing values for all variablesin a data set
Program 1.57: Demonstrating the MISSING function with.A, .B, etc. numeric values
Program 1.58: Demonstrating the COALESCEC function
Program1.59: Using the IFC function to select a character value, basedon the value of a logical expression
Program1.60: Using the collating sequence to convert plain text to MorseCode
Program 1.61: Using the REPEAT function to underlineoutput values
Program 1.62: Using the REVERSE function to createbackwards writing
Program 1.63: Demonstrating the NLITERAL function
Program 1.64: Demonstrating the NVALID function
Program1.65: Using the NVALID function to count the number of validV7 and non-valid V7 variable names in a data set
Chapter 2
Program 2.1: Using a Perl regular expression tolocate lines with an exacttext match
Program 2.2: Using a regular expression to searchfor phone numbers in astring
Program2.3: Modifying Program 2.2 to search for toll-free phone numbers
Program2.4: Using PRXMATCH without PRXPARSE (entering the regularexpression directly in the function)
Program 2.5: Locating all 5- or 9-digit ZIP codes in alist of addresses
Program 2.6: Extracting a phone number from a textstring
Program 2.7: Using the PRXPOSN CALL routine to extract the area codeand exchange from a phone number
Program 2.8: Using regular expressions to read veryunstructured data
Program 2.9: Finding digits in random positions in an input string usingCALL PRXNEXT
Program 2.10: Demonstrating the PRXPAREN function
Program 2.11: Demonstrating the CALL PRXCHANGE function
Program 2.12: Demonstrating the use of capture bufferswith PRXCHANGE
Program2.13: Data cleaning example using PRXPARSE andCALL PRXFREE
Chapter 3
Program 3.1: Program to grade quizzes, dropping thetwo lowest quiz scores (using CALL SORTN)
Program3.2: Another example of CALL SORTN using array elements asthe arguments
Program 3.3: Demonstrating the CALL SORTC routine
Chapter 4
Program 4.1: Creating a SAS date value from separatevariablesrepresenting the day, month, and year of the date
Program 4.2: Program to read in dates and set theday of the month to 15 if the day is missing from the date
Program 4.3: Determining the date, datetime value, andtime of day
Program 4.4: Program tocreate the DATES data set
Program4

  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents