Chapter Contents

Previous

Next
SAS Language Reference: Dictionary

Functions and CALL Routines by Category

Categories and Descriptions of Functions and CALL Routines
Category Functions and CALL Routine Description
Array DIM
Returns the number of elements in an array

HBOUND
Returns the upper bound of an array

LBOUND
Returns the lower bound of an array
Bitwise Logical Operations BAND
Returns the bitwise logical AND of two arguments

BLSHIFT
Returns the bitwise logical left shift of two arguments

BNOT
Returns the bitwise logical NOT of an argument

BOR
Returns the bitwise logical OR of two arguments

BRSHIFT
Returns the bitwise logical right shift of two arguments

BXOR
Returns the bitwise logical EXCLUSIVE OR of two arguments
Character String Matching CALL RXCHANGE
Changes one or more substrings that match a pattern

CALL RXFREE
Frees memory allocated by other regular expression (RX) functions and CALL routines

CALL RXSUBSTR
Finds the position, length, and score of a substring that matches a pattern

RXMATCH
Finds the beginning of a substring that matches a pattern and returns a value

RXPARSE
Parses a pattern and returns a value
Character BYTE
Returns one character in the ASCII or the EBCDIC collating sequence

COLLATE
Returns an ASCII or EBCDIC collating sequence character string

COMPBL
Removes multiple blanks from a character string

COMPRESS
Removes specific characters from a character string

DEQUOTE
Removes quotation marks from a character value

INDEX
Searches a character expression for a string of characters

INDEXC
Searches a character expression for specific characters

INDEXW
Searches a character expression for a specified string as a word

LEFT
Left aligns a SAS character expression

LENGTH
Returns the length of an argument

LOWCASE
Converts all letters in an argument to lowercase

MISSING
Returns a numeric result that indicates whether the argument contains a missing value

QUOTE
Adds double quotation marks to a character value

RANK
Returns the position of a character in the ASCII or EBCDIC collating sequence

REPEAT
Repeats a character expression

REVERSE
Reverses a character expression

RIGHT
Right aligns a character expression

SCAN
Selects a given word from a character expression

SOUNDEX
Encodes a string to facilitate searching

SPEDIS
Determines the likelihood of two words matching, expressed as the asymmetric spelling distance between the two words

SUBSTR (left of =)
Replaces character value contents

SUBSTR (right of =)
Extracts a substring from an argument

TRANSLATE
Replaces specific characters in a character expression

TRANWRD
Replaces or removes all occurrences of a word in a character string

TRIM
Removes trailing blanks from character expressions and returns one blank if the expression is missing

TRIMN
Removes trailing blanks from character expressions and returns a null string (zero blanks) if the expression is missing

UPCASE
Converts all letters in an argument to uppercase

VERIFY
Returns the position of the first character that is unique to an expression
DBCS KCOMPARE
Returns the result of a comparison of character strings

KCOMPRESS
Removes specific characters from a character string

KCOUNT
Returns the number of double-byte characters in a string

KINDEX
Searches a character expression for a string of characters

KINDEXC
Searches a character expression for specific characters

KLEFT
Left aligns a SAS character expression by removing unnecessary leading DBCS blanks and SO/SI

KLENGTH
Returns the length of an argument

KLOWCASE
Converts all letters in an argument to lowercase

KREVERSE
Reverses a character expression

KRIGHT
Right aligns a character expression by trimming trailing DBCS blanks and SO/SI

KSCAN
Selects a given word from a character expression

KSTRCAT
Concatenates two or more character strings

KSUBSTR
Extracts a substring from an argument

KSUBSTRB
Extracts a substring from an argument based on byte position

KTRANSLATE
Replaces specific characters in a character expression

KTRIM
Removes trailing DBCS blanks and SO/SI from character expressions

KTRUNCATE
Truncates a numeric value to a specified length

KUPCASE
Converts all single-byte letters in an argument to uppercase

KUPDATE
Inserts, deletes, and replaces character value contents

KUPDATEB
Inserts, deletes, and replaces character value contents based on byte unit

KVERIFY
Returns the position of the first character that is unique to an expression
Date and Time DATDIF
Returns the number of days between two dates

DATE
Returns the current date as a SAS date value

DATEJUL
Converts a Julian date to a SAS date value

DATEPART
Extracts the date from a SAS datetime value

DATETIME
Returns the current date and time of day as a SAS datetime value

DAY
Returns the day of the month from a SAS date value

DHMS
Returns a SAS datetime value from date, hour, minute, and second

HMS
Returns a SAS time value from hour, minute, and second values

HOUR
Returns the hour from a SAS time or datetime value

INTCK
Returns the integer number of time intervals in a given time span

INTNX
Advances a date, time, or datetime value by a given interval, and returns a date, time, or datetime value

JULDATE
Returns the Julian date from a SAS date value

JULDATE7
Returns a seven-digit Julian date from a SAS date value

MDY
Returns a SAS date value from month, day, and year values

MINUTE
Returns the minute from a SAS time or datetime value

MONTH
Returns the month from a SAS date value

QTR
Returns the quarter of the year from a SAS date value

SECOND
Returns the second from a SAS time or datetime value

TIME
Returns the current time of day

TIMEPART
Extracts a time value from a SAS datetime value

TODAY
Returns the current date as a SAS date value

WEEKDAY
Returns the day of the week from a SAS date value

YEAR
Returns the year from a SAS date value

YRDIF
Returns the difference in years between two dates

YYQ
Returns a SAS date value from the year and quarter
Descriptive Statistics CSS
Returns the corrected sum of squares

CV
Returns the coefficient of variation

KURTOSIS
Returns the kurtosis

MAX
Returns the largest value

MEAN
Returns the arithmetic mean (average)

MIN
Returns the smallest value

MISSING
Returns a numeric result that indicates whether the argument contains a missing value

N
Returns the number of nonmissing values

NMISS
Returns the number of missing values

ORDINAL
Returns any specified order statistic

RANGE
Returns the range of values

SKEWNESS
Returns the skewness

STD
Returns the standard deviation

STDERR
Returns the standard error of the mean

SUM
Returns the sum of the nonmissing arguments

USS
Returns the uncorrected sum of squares

VAR
Returns the variance
External Files DCLOSE
Closes a directory that was opened by the DOPEN function and returns a value

DINFO
Returns information about a directory

DNUM
Returns the number of members in a directory

DOPEN
Opens a directory and returns a directory identifier value

DOPTNAME
Returns directory attribute information

DOPTNUM
Returns the number of information items that are available for a directory

DREAD
Returns the name of a directory member

DROPNOTE
Deletes a note marker from a SAS data set or an external file and returns a value

FAPPEND
Appends the current record to the end of an external file and returns a value

FCLOSE
Closes an external file, directory, or directory member, and returns a value

FCOL
Returns the current column position in the File Data Buffer (FDB)

FDELETE
Deletes an external file or an empty directory

FEXIST
Verifies the existence of an external file associated with a fileref and returns a value

FGET
Copies data from the File Data Buffer (FDB) into a variable and returns a value

FILEEXIST
Verifies the existence of an external file by its physical name and returns a value

FILENAME
Assigns or deassigns a fileref for an external file, directory, or output device and returns a value

FILEREF
Verifies that a fileref has been assigned for the current SAS session and returns a value

FINFO
Returns the value of a file information item

FNOTE
Identifies the last record that was read and returns a value that FPOINT can use

FOPEN
Opens an external file and returns a file identifier value

FOPTNAME
Returns the name of an item of information about a file

FOPTNUM
Returns the number of information items that are available for an external file

FPOINT
Positions the read pointer on the next record to be read and returns a value

FPOS
Sets the position of the column pointer in the File Data Buffer (FDB) and returns a value

FPUT
Moves data to the File Data Buffer (FDB) of an external file, starting at the FDB's current column position, and returns a value

FREAD
Reads a record from an external file into the File Data Buffer (FDB) and returns a value

FREWIND
Positions the file pointer to the start of the file and returns a value

FRLEN
Returns the size of the last record read, or, if the file is opened for output, returns the current record size

FSEP
Sets the token delimiters for the FGET function and returns a value

FWRITE
Writes a record to an external file and returns a value

MOPEN
Opens a file by directory id and member name, and returns the file identifier or a 0

PATHNAME
Returns the physical name of a SAS data library or of an external file, or returns a blank

SYSMSG
Returns the text of error messages or warning messages from the last data set or external file function execution

SYSRC
Returns a system error number
External Routines CALL MODULE
Calls the external routine without any return code

CALL MODULEI
Calls the external routine without any return code (in IML environment only)

MODULEC
Calls an external routine and returns a character value

MODULEIC
Calls an external routine and returns a character value (in IML environment only)

MODULEIN
Calls an external routine and returns a numeric value (in IML environment only)

MODULEN
Calls an external routine and returns a numeric value
Financial COMPOUND
Returns compound interest parameters

CONVX
Returns the convexity for an enumerated cashflow

CONVXP
Returns the convexity for a periodic cashflow stream, such as a bond

DACCDB
Returns the accumulated declining balance depreciation

DACCDBSL
Returns the accumulated declining balance with conversion to a straight-line depreciation

DACCSL
Returns the accumulated straight-line depreciation

DACCSYD
Returns the accumulated sum-of-years-digits depreciation

DACCTAB
Returns the accumulated depreciation from specified tables

DEPDB
Returns the declining balance depreciation

DEPDBSL
Returns the declining balance with conversion to a straight-line depreciation

DEPSL
Returns the straight-line depreciation

DEPSYD
Returns the sum-of-years-digits depreciation

DEPTAB
Returns the depreciation from specified tables

DUR
Returns the modified duration for an enumerated cashflow

DURP
Returns the modified duration for a periodic cashflow stream, such as a bond

INTRR
Returns the internal rate of return as a fraction

IRR
Returns the internal rate of return as a percentage

MORT
Returns amortization parameters

NETPV
Returns the net present value as a fraction

NPV
Returns the net present value with the rate expressed as a percentage

PVP
Returns the present value for a periodic cashflow stream, such as a bond

SAVING
Returns the future value of a periodic saving

YIELDP
Returns the yield-to-maturity for a periodic cashflow stream, such as a bond
Hyperbolic COSH
Returns the hyperbolic cosine

SINH
Returns the hyperbolic sine

TANH
Returns the hyperbolic tangent
Macro CALL EXECUTE
Resolves an argument and issues the resolved value for execution

CALL SYMPUT
Assigns DATA step information to a macro variable

RESOLVE
Returns the resolved value of an argument after it has been processed by the macro facility

SYMGET
Returns the value of a macro variable during DATA step execution
Mathematical ABS
Returns the absolute value

AIRY
Returns the value of the airy function

CNONCT
Returns the noncentrality parameter from a chi-squared distribution

COMB
Computes the number of combinations of n elements taken r at a time and returns a value

CONSTANT
Computes some machine and mathematical constants and returns a value

DAIRY
Returns the derivative of the airy function

DEVIANCE
Computes the deviance and returns a value

DIGAMMA
Returns the value of the DIGAMMA function

ERF
Returns the value of the (normal) error function

ERFC
Returns the value of the complementary (normal) error function

EXP
Returns the value of the exponential function

FACT
Computes a factorial and returns a value

FNONCT
Returns the value of the noncentrality parameter of an F distribution

GAMMA
Returns the value of the Gamma function

IBESSEL
Returns the value of the modified bessel function

JBESSEL
Returns the value of the bessel function

LGAMMA
Returns the natural logarithm of the Gamma function

LOG
Returns the natural (base e) logarithm

LOG10
Returns the logarithm to the base 10

LOG2
Returns the logarithm to the base 2

MOD
Returns the remainder value

PERM
Computes the number of permutations of n items taken r at a time and returns a value

SIGN
Returns the sign of a value

SQRT
Returns the square root of a value

TNONCT
Returns the value of the noncentrality parameter from the student's t distribution

TRIGAMMA
Returns the value of the TRIGAMMA function
Probability CDF
Computes cumulative distribution functions

LOGPDF
Computes the logarithm of a probability (mass) function

LOGSDF
Computes the logarithm of a survival function

PDF
Computes probability density (mass) functions

POISSON
Returns the probability from a Poisson distribution

PROBBETA
Returns the probability from a beta distribution

PROBBNML
Returns the probability from a binomial distribution

PROBBNRM
Computes a probability from the bivariate normal distribution and returns a value

PROBCHI
Returns the probability from a chi-squared distribution

PROBF
Returns the probability from an F distribution

PROBGAM
Returns the probability from a gamma distribution

PROBHYPR
Returns the probability from a hypergeometric distribution

PROBMC
Computes a probability or a quantile from various distributions for multiple comparisons of means, and returns a value

PROBNEGB
Returns the probability from a negative binomial distribution

PROBNORM
Returns the probability from the standard normal distribution

PROBT
Returns the probability from a t distribution

SDF
Computes a survival function
Quantile BETAINV
Returns a quantile from the beta distribution

CINV
Returns a quantile from the chi-squared distribution

FINV
Returns a quantile from the F distribution

GAMINV
Returns a quantile from the gamma distribution

PROBIT
Returns a quantile from the standard normal distribution

TINV
Returns a quantile from the t distribution
Random Number CALL RANBIN
Returns a random variate from a binomial distribution

CALL RANCAU
Returns a random variate from a Cauchy distribution

CALL RANEXP
Returns a random variate from an exponential distribution

CALL RANGAM
Returns a random variate from a gamma distribution

CALL RANNOR
Returns a random variate from a normal distribution

CALL RANPOI
Returns a random variate from a Poisson distribution

CALL RANTBL
Returns a random variate from a tabled probability distribution

CALL RANTRI
Returns a random variate from a triangular distribution

CALL RANUNI
Returns a random variate from a uniform distribution

NORMAL
Returns a random variate from a normal distribution

RANBIN
Returns a random variate from a binomial distribution

RANCAU
Returns a random variate from a Cauchy distribution

RANEXP
Returns a random variate from an exponential distribution

RANGAM
Returns a random variate from a gamma distribution

RANNOR
Returns a random variate from a normal distribution

RANPOI
Returns a random variate from a Poisson distribution

RANTBL
Returns a random variate from a tabled probability

RANTRI
Random variate from a triangular distribution

RANUNI
Returns a random variate from a uniform distribution

UNIFORM
Random variate from a uniform distribution
SAS File I/O ATTRC
Returns the value of a character attribute for a SAS data set

ATTRN
Returns the value of a numeric attribute for the specified SAS data set

CEXIST
Verifies the existence of a SAS catalog or SAS catalog entry and returns a value

CLOSE
Closes a SAS data set and returns a value

CUROBS
Returns the observation number of the current observation

DROPNOTE
Deletes a note marker from a SAS data set or an external file and returns a value

DSNAME
Returns the SAS data set name that is associated with a data set identifier

EXIST
Verifies the existence of a SAS data library member

FETCH
Reads the next nondeleted observation from a SAS data set into the Data Set Data Vector (DDV) and returns a value

FETCHOBS
Reads a specified observation from a SAS data set into the Data Set Data Vector (DDV) and returns a value

GETVARC
Returns the value of a SAS data set character variable

GETVARN
Returns the value of a SAS data set numeric variable

IORCMSG
Returns a formatted error message for _IORC_

LIBNAME
Assigns or deassigns a libref for a SAS data library and returns a value

LIBREF
Verifies that a libref has been assigned and returns a value

NOTE
Returns an observation ID for the current observation of a SAS data set

OPEN
Opens a SAS data set and returns a value

PATHNAME
Returns the physical name of a SAS data library or of an external file, or returns a blank

POINT
Locates an observation identified by the NOTE function and returns a value

REWIND
Positions the data set pointer at the beginning of a SAS data set and returns a value

SYSMSG
Returns the text of error messages or warning messages from the last data set or external file function execution

SYSRC
Returns a system error number

VARFMT
Returns the format assigned to a SAS data set variable

VARINFMT
Returns the informat assigned to a SAS data set variable

VARLABEL
Returns the label assigned to a SAS data set variable

VARLEN
Returns the length of a SAS data set variable

VARNAME
Returns the name of a SAS data set variable

VARNUM
Returns the number of a variable's position in a SAS data set

VARTYPE
Returns the data type of a SAS data set variable
Special ADDR
Returns the memory address of a variable

CALL POKE
Writes a value directly into memory

CALL SYSTEM
Submits an operating environment command for execution

DIF
Returns differences between the argument and its nth lag

GETOPTION
Returns the value of a SAS system or graphics option

INPUT
Returns the value produced when a SAS expression that uses a specified informat expression is read

INPUTC
Enables you to specify a character informat at run time

INPUTN
Enables you to specify a numeric informat at run time

LAG
Returns values from a queue

PEEK
Stores the contents of a memory address into a numeric variable

PEEKC
Stores the contents of a memory address into a character variable

POKE
Writes a value directly into memory

PUT
Returns a value using a specified format

PUTC
Enables you to specify a character format at run time

PUTN
Enables you to specify a numeric format at run time

SYSGET
Returns the value of the specified operating environment variable

SYSPARM
Returns the system parameter string

SYSPROD
Determines if a product is licensed

SYSTEM
Issues an operating environment command during a SAS session
State and ZIP Code FIPNAME
Converts FIPS codes to uppercase state names

FIPNAMEL
Converts FIPS codes to mixed case state names

FIPSTATE
Converts FIPS codes to two-character postal codes

STFIPS
Converts state postal codes to FIPS state codes

STNAME
Converts state postal codes to uppercase state names

STNAMEL
Converts state postal codes to mixed case state names

ZIPFIPS
Converts ZIP codes to FIPS state codes

ZIPNAME
Converts ZIP codes to uppercase state names

ZIPNAMEL
Converts ZIP codes to mixed case state names

ZIPSTATE
Converts ZIP codes to state postal codes
Trigonometric ARCOS
Returns the arccosine

ARSIN
Returns the arcsine

ATAN
Returns the arctangent

COS
Returns the cosine

SIN
Returns the sine

TAN
Returns the tangent
Truncation CEIL
Returns the smallest integer that is greater than or equal to the argument

FLOOR
Returns the largest integer that is less than or equal to the argument

FUZZ
Returns the nearest integer if the argument is within 1E-12

INT
Returns the integer value

ROUND
Rounds to the nearest round-off unit

TRUNC
Truncates a numeric value to a specified length
Variable Control CALL LABEL
Assigns a variable label to a specified character variable

CALL SET
Links SAS data set variables to DATA step or macro variables that have the same name and data type

CALL VNAME
Assigns a variable name as the value of a specified variable
Variable Information VARRAY
Returns a value that indicates whether the specified name is an array

VARRAYX
Returns a value that indicates whether the value of the specified argument is an array

VFORMAT
Returns the format that is associated with the specified variable

VFORMATD
Returns the format decimal value that is associated with the specified variable

VFORMATDX
Returns the format decimal value that is associated with the value of the specified argument

VFORMATN
Returns the format name that is associated with the specified variable

VFORMATNX
Returns the format name that is associated with the value of the specified argument

VFORMATW
Returns the format width that is associated with the specified variable

VFORMATWX
Returns the format width that is associated with the value of the specified argument

VFORMATX
Returns the format that is associated with the value of the specified argument

VINARRAY
Returns a value that indicates whether the specified variable is a member of an array

VINARRAYX
Returns a value that indicates whether the value of the specified argument is a member of an array

VINFORMAT
Returns the informat that is associated with the specified variable

VINFORMATD
Returns the informat decimal value that is associated with the specified variable

VINFORMATDX
Returns the informat decimal value that is associated with the value of the specified argument

VINFORMATN
Returns the informat name that is associated with the specified variable

VINFORMATNX
Returns the informat name that is associated with the value of the specified argument

VINFORMATW
Returns the informat width that is associated with the specified variable

VINFORMATWX
Returns the informat width that is associated with the value of the specified argument

VINFORMATX
Returns the informat that is associated with the value of the specified argument

VLABEL
Returns the label that is associated with the specified variable

VLABELX
Returns the variable label for the value of a specified argument

VLENGTH
Returns the compile-time (allocated) size of the specified variable

VLENGTHX
Returns the compile-time (allocated) size for the value of the specified argument

VNAME
Returns the name of the specified variable

VNAMEX
Validates the value of the specified argument as a variable name

VTYPE
Returns the type (character or numeric) of the specified variable

VTYPEX
Returns the type (character or numeric) for the value of the specified argument
Web Tools HTMLDECODE
Decodes a string containing HTML numeric character references or HTML character entity references and returns the decoded string

HTMLENCODE
Encodes characters using HTML character entity references and returns the encoded string

URLDECODE
Returns a string that was decoded using the URL escape syntax

URLENCODE
Returns a string that was encoded using the URL escape syntax


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.