PDF4PRO ⚡AMP

Modern search engine that looking for books and documents around the web

Example: marketing

SUGI 25: The SAS SUBSTR Function - A Beginner's Tutorial

Back to document page

Paper 88-25The SAS SUBSTR Function A beginner s TutorialPaul D. McDonald, SPIKEware, Inc., Schaumburg, ILABSTRACTThis paper is written for SAS Users and SAS Programmers of anyexperience level. It reviews the syntax, basic applications, andtroubleshooting of theSUBSTRData Step SAS data step functionSUBSTR(commonly pronounced sub-string ) Function is used to work with a specific position or positionsof characters within a defined character variable. The functionfocuses on a portion of a string and can go on either side of the = sign in a data step has three arguments: SUBSTR (SOURCE, POSITION, N)The Function returnsNcharacters, beginning at character numberPOSITIONfrom the stringSOURCE. SOURCE This is the larger or reference string. It can be avariable or a string of characters. POSITION This value is a positive integer and references thestarting point to begin reading the internal group of characters. N This value is a positive integer and references the numberof characters to read from the starting pointPOSITIONin are two basic applications of theSUBSTRfunction: on the right side of an assignment statement or on the left side of anassignment this example, we are going to assign the area code of a telephonenumber to a variable phone = (312) 555-1212 ;data _null_ ; phone = (312) 555-1212 ; area_cd = SUBSTR (phone, 2, 3) ; area_cd = SUBSTR ( (312) 555-1212 , 2, 3) ; area_cd = SUBSTR ( &phone , 2, 3) ;run ;Each tim

Paper 88-25 The SAS SUBSTR Function –A Beginner’s Tutorial Paul D. McDonald, SPIKEware, Inc., Schaumburg, IL ABSTRACT This paper is written for SAS Users and SAS Programmers of any

  Beginner, Functions, Sas substr function a beginner s, Substr

Download SUGI 25: The SAS SUBSTR Function - A Beginner's Tutorial


Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Spam in document Broken preview Other abuse

Related search queries