SAS Character Functions quick revision for Interview

by | Oct 26, 2018 | SAS | 0 comments

  • use a LENGTH statement to set the desired length of a character variable
  • use the concatenation operator (| |) to join two or more character strings
  • use the COMPBL function to convert multiple blanks in a character string to a single blank
  • use the COMPRESS function to remove characters from a string
  • use the VERIFY function to check that certain values are present in a character variable
  • use the TRIM function to remove the trailing blanks from a character string
  • use the SUBSTR function to select a subset of consecutive characters from a larger string
  • use the SUBSTR function on the left-hand side of an equal sign
  • use the SUBSTR function to unpack a string of characters into its individual characters
  • use the INPUT function to convert a character variable to a numeric variable
  • use the PUT function to convert a numeric variable to a character variable
  • use the SCAN function to parse a string and/or extract part of a string
  • use the INDEX and INDEXC functions to locate a position of one string within another string
  • use the UPCASE function to change lowercase letters to uppercase letters, and use the LOWCASE function to change uppercase letters to lowercase letters
  • use the PROPCASE function to capitalize the first letter of each word
  • use the TRANWRD function to translate a word
  • use the CATS function to strip leading and trailing blanks before joining two or more strings
  • use the CATX function to strip leading and trailing blanks, and then join two or more strings with a specified character inserted between the strings
  • use the LENGTHC function to return the storage length of a character variable
  • use the LENGTH and/or LENGTHN functions to determine the length of a character variable not counting trailing blanks
  • use the COUNT function to count the number of times a particular substring appears in a string
  • use the COUNTC function to count the number of times one or more characters appear in a string

Join Today

Know more about latest trends, News in Field of Data Analytics.

We will offer Free SAS and Python Programme in Data Science & enhance your understanding of data analysis.

By rlochan2021

We offer Everything Free here and always will be, so joining is Risk Free and Always Cost Free.

Check Out These Related Posts

Proc Contents Syntax, points to remember

Basic Syntax is:- PROC CONTENTS DATA=abc; RUN; proc contents data=libref.filename <options> options:- CENTILES Print centiles information for indexed variables DATA= Specify the input data set DETAILS|NODETAILS Include information in the output about the number...

read more

Topics on SAS Arrays

1.what is the syntax of SAS Array? array array-name {n} <$> array-elements <(initial-values)>; The ARRAY statement is a compiler statement within the data step. In addition, the array elements cannot be used in compiler statements such as DROP or KEEP. I Array Q...

read more

SAS Proc Report Tutorials:- Sample Code

First immerse yourself in learning the Basic options of Proc Report because there are too many and you may get overwhelmed. A Sample Code for you:- proc sql; create table newbaseball as SELECT ‘Name’n as Team, nAtBat , nHits , nHome , nRuns , nRBI , nBB , YrMajor , CrAtBat , CrHits , CrHome […]

read more



Submit a Comment

Your email address will not be published. Required fields are marked *