Category Functions and CALL Routines Description
Category Functions and CALL Routines Description
Arithmetic DIVIDE Function Returns the result of a division that handles special missing
values for ODS output.
Bitwise Logical Operations BAND Function Returns the bitwise logical AND of two arguments.
BLSHIFT Function Returns the bitwise logical left shift of two arguments.
BRSHIFT Function Returns the bitwise logical right shift of two arguments.
CALL PRXDEBUG Routine Enables Perl regular expressions in a DATA step to send
debugging output to the SAS log.
CALL PRXFREE Routine Frees memory that was allocated for a Perl regular
expression.
CALL PRXNEXT Routine Returns the position and length of a substring that matches a
pattern, and iterates over multiple matches within one string.
CALL PRXPOSN Routine Returns the start position and length for a capture buffer.
CALL PRXSUBSTR Routine Returns the position and length of a substring that matches a
pattern.
PRXMATCH Function Searches for a pattern match and returns the position at
which the pattern is found.
PRXPAREN Function Returns the last bracket match for which there is a match in a
pattern.
PRXPARSE Function Compiles a Perl regular expression (PRX) that can be used
for pattern matching of a character value.
PRXPOSN Function Returns a character string that contains the value for a
capture buffer.
ANYDIGIT Function Searches a character string for a digit, and returns the first
position at which the digit is found.
ANYFIRST Function Searches a character string for a character that is valid as the
first character in a SAS variable name under
VALIDVARNAME=V7, and returns the first position at which
that character is found.
ANYLOWER Function Searches a character string for a lowercase letter, and returns
the first position at which the letter is found.
BYTE Function Returns one character in the ASCII or the EBCDIC collating
sequence.
CALL CATS Routine Removes leading and trailing blanks, and returns a
concatenated character string.
CALL CATX Routine Removes leading and trailing blanks, inserts delimiters, and
returns a concatenated character string.
CALL COMPCOST Routine Sets the costs of operations for later use by the COMPGED
function
CALL MISSING Routine Assigns missing values to the specified character or numeric
variables.
CALL SCAN Routine Returns the position and length of the nth word from a
character string.
CAT Function Does not remove leading or trailing blanks, and returns a
concatenated character string.
COALESCEC Function Returns the first non-missing value from a list of character
arguments.
COMPARE Function Returns the position of the leftmost character by which two
strings differ, or returns 0 if there is no difference.
COMPGED Function Returns the generalized edit distance between two strings.
COMPLEV Function Returns the Levenshtein edit distance between two strings.
COUNT Function Counts the number of times that a specified substring appears
within a character string.
MD5 Function Returns the result of the message digest of a specified string.
MISSING Function Returns a numeric result that indicates whether the argument
contains a missing value.
NLITERAL Function Converts a character string that you specify to a SAS name
literal.
NOTDIGIT Function Searches a character string for any character that is not a
digit, and returns the first position at which that character is
found.
NOTSPACE Function Searches a character string for a character that is not a white-
space character (blank, horizontal and vertical tab, carriage
return, line feed, and form feed), and returns the first position
at which that character is found.
NVALID Function Checks the validity of a character string for use as a SAS
variable name.
REPEAT Function Returns a character value that consists of the first argument
repeated n+1 times.
STRIP Function Returns a character string with all leading and trailing blanks
removed.
SUBPAD Function Returns a substring that has a length you specify, using blank
padding if necessary.
TRIM Function Removes trailing blanks from a character string, and returns
one blank if the string is missing.
VERIFY Function Returns the position of the first character in a string that is not
in any of several other strings.
Combinatorial ALLCOMB Function Generates all combinations of the values of n variables taken
k at a time in a minimal change order.
CALL ALLCOMB Routine Generates all combinations of the values of n variables taken
k at a time in a minimal change order.
CALL ALLCOMBI Routine Generates all combinations of the indices of n objects taken k
at a time in a minimal change order.
CALL ALLPERM Routine Generates all permutations of the values of several variables
in a minimal change order.
CALL GRAYCODE Routine Generates all subsets of n items in a minimal change order.
CALL LEXCOMB Routine Generates all distinct combinations of the non-missing values
of n variables taken k at a time in lexicographic order.
CALL LEXCOMBI Routine Generates all combinations of the indices of n objects taken k
at a time in lexicographic order.
CALL LEXPERK Routine Generates all distinct permutations of the non-missing values
of n variables taken k at a time in lexicographic order.
CALL LEXPERM Routine Generates all distinct permutations of the non-missing values
of several variables in lexicographic order.
CALL RANPERK Routine Randomly permutes the values of the arguments, and returns
a permutation of k out of n values.
LCOMB Function Computes the logarithm of the COMB function which is the
logarithm of the number of combinations of n objects taken r
at a time.
LPERM Function Computes the logarithm of the PERM function which is the
logarithm of the number of permutations of n objects, with the
option of including r number of elements.
Date and Time CALL IS8601_CONVERT Converts an ISO 8601 interval to datetime and duration
Routine values, or converts datetime and duration values to an ISO
8601 interval.
DATDIF Function Returns the number of days between two dates after
computing the difference between the dates according to
specified day count conventions.
DATETIME Function Returns the current date and time of day as a SAS datetime
value.
DAY Function Returns the day of the month from a SAS date value.
DHMS Function Returns a SAS datetime value from date, hour, minute, and
second values.
HMS Function Returns a SAS time value from hour, minute, and second
values.
HOUR Function Returns the hour from a SAS time or datetime value.
INTCINDEX Function Returns the cycle index when a date, time, or datetime
interval and value are specified.
INTFIT Function Returns a time interval that is aligned between two dates.
INTINDEX Function Returns the seasonal index when a date, time, or datetime
interval and value are specified.
INTSEAS Function Returns the length of the seasonal cycle when a date, time, or
datetime interval is specified.
INTSHIFT Function Returns the shift interval that corresponds to the base interval.
JULDATE Function Returns the Julian date from a SAS date value.
JULDATE7 Function Returns a seven-digit Julian date from a SAS date value.
MDY Function Returns a SAS date value from month, day, and year values.
MINUTE Function Returns the minute from a SAS time or datetime value.
NWKDOM Function Returns the date for the nth occurrence of a weekday for the
specified month and year.
QTR Function Returns the quarter of the year from a SAS date value.
SECOND Function Returns the second from a SAS time or datetime value.
TIME Function Returns the current time of day as a numeric SAS time value.
TODAY Function Returns the current date as a numeric SAS date value.
WEEKDAY Function From a SAS date value, returns an integer that corresponds
to the day of the week.
YYQ Function Returns a SAS date value from year and quarter year values.
LPNORM Function Returns the Lp norm of the second argument and subsequent
non-missing arguments.
MAD Function Returns the median absolute deviation from the median.
MISSING Function Returns a numeric result that indicates whether the argument
contains a missing value.
ORDINAL Function Returns the kth smallest of the missing and nonmissing
values.
RMS Function Returns the root mean square of the nonmissing arguments.
STDERR Function Returns the standard error of the mean of the nonmissing
arguments.
SUMABS Function Returns the sum of the absolute values of the non-missing
arguments.
Distance GEODIST Function Returns the geodetic distance between two latitude and
longitude coordinates.
External Files DCLOSE Function Closes a directory that was opened by the DOPEN function.
DOPTNUM Function Returns the number of information items that are available for
a directory.
DREAD Function Returns the name of a directory member.
DROPNOTE Function Deletes a note marker from a SAS data set or an external file.
FAPPEND Function Appends the current record to the end of an external file.
FCOL Function Returns the current column position in the File Data Buffer
(FDB).
FEXIST Function Verifies the existence of an external file that is associated with
a fileref.
FGET Function Copies data from the File Data Buffer (FDB) into a variable.
FILEEXIST Function Verifies the existence of an external file by its physical name.
FILEREF Function Verifies whether a fileref has been assigned for the current
SAS session.
FNOTE Function Identifies the last record that was read, and returns a value
that the FPOINT function can use.
FOPEN Function Opens an external file and returns a file identifier value.
FOPTNUM Function Returns the number of information items that are available for
an external file.
FPOINT Function Positions the read pointer on the next record to be read.
FPOS Function Sets the position of the column pointer in the File Data Buffer
(FDB).
FPUT Function Moves data to the File Data Buffer (FDB) of an external file,
starting at the FDB's current column position.
FREAD Function Reads a record from an external file into the File Data Buffer
(FDB).
FREWIND Function Positions the file pointer to the start of the file.
FRLEN Function Returns the size of the last record that was read, or, if the file
is opened for output, returns the current record size.
FSEP Function Sets the token delimiters for the FGET function.
MOPEN Function Opens a file by directory ID and member name, and returns
either the file identifier or a 0.
PATHNAME Function Returns the physical name of an external file or a SAS library,
or returns a blank.
SYSMSG Function Returns error or warning message text from processing the
last data set or external file function.
External Routines CALL MODULE Routine Calls an external routine without any return code.
MODULEC Function Calls an external routine and returns a character value.
Financial BLACKCLPRC Function Calculates call prices for European options on futures, based
on the Black model.
BLACKPTPRC Function Calculates put prices for European options on futures, based
on the Black model.
BLKSHCLPRC Function Calculates call prices for European options on stocks, based
on the Black-Scholes model.
BLKSHPTPRC Function Calculates put prices for European options on stocks, based
on the Black-Scholes model.
CONVXP Function Returns the convexity for a periodic cash flow stream, such as
a bond.
DUR Function Returns the modified duration for an enumerated cash flow.
DURP Function Returns the modified duration for a periodic cash flow stream,
such as a bond.
GARKHCLPRC Function Calculates call prices for European options on stocks, based
on the Garman-Kohlhagen model.
GARKHPTPRC Function Calculates put prices for European options on stocks, based
on the Garman-Kohlhagen model.
MARGRCLPRC Function Calculates call prices for European options on stocks, based
on the Margrabe model.
MARGRPTPRC Function Calculates put prices for European options on stocks, based
on the Margrabe model.
PVP Function Returns the present value for a periodic cash flow stream
(such as a bond), with repayment of principal at maturity.
YIELDP Function Returns the yield-to-maturity for a periodic cash flow stream,
such as a bond.
Macro CALL EXECUTE Routine Resolves the argument, and issues the resolved value for
execution at the next step boundary.
CALL SYMPUTX Routine Assigns a value to a macro variable, and removes both
leading and trailing blanks.
RESOLVE Function Returns the resolved value of the argument after it has been
processed by the macro facility.
SYMGET Function Returns the value of a macro variable during DATA step
execution.
COALESCE Function Returns the first non-missing value from a list of numeric
arguments.
GCD Function Returns the greatest common divisor for one or more
integers.
MOD Function Returns the remainder from the division of the first argument
by the second argument, fuzzed to avoid most unexpected
floating-point results.
MODZ Function Returns the remainder from the division of the first argument
by the second argument, using zero fuzzing.
TNONCT Function Returns the value of the noncentrality parameter from the
Student's t distribution.
PROBNORM Function Returns the probability from the standard normal distribution.
QUANTILE Function Returns the quantile from a distribution that you specify.
Random Number CALL RANBIN Routine Returns a random variate from a binomial distribution.
CALL STREAMINIT Routine Specifies a seed value to use for subsequent random number
generation by the RAND function.
SAS File I/O ATTRC Function Returns the value of a character attribute for a SAS data set.
ATTRN Function Returns the value of a numeric attribute for a SAS data set.
CEXIST Function Verifies the existence of a SAS catalog or SAS catalog entry.
DROPNOTE Function Deletes a note marker from a SAS data set or an external file.
DSNAME Function Returns the SAS data set name that is associated with a data
set identifier.
FETCH Function Reads the next non-deleted observation from a SAS data set
into the Data Set Data Vector (DDV).
FETCHOBS Function Reads a specified observation from a SAS data set into the
Data Set Data Vector (DDV).
GETVARC Function Returns the value of a SAS data set character variable.
GETVARN Function Returns the value of a SAS data set numeric variable.
PATHNAME Function Returns the physical name of an external file or a SAS library,
or returns a blank.
REWIND Function Positions the data set pointer at the beginning of a SAS data
set.
SYSMSG Function Returns error or warning message text from processing the
last data set or external file function.
VARFMT Function Returns the format that is assigned to a SAS data set
variable.
VARINFMT Function Returns the informat that is assigned to a SAS data set
variable.
VARLABEL Function Returns the label that is assigned to a SAS data set variable.
VARNUM Function Returns the number of a variable's position in a SAS data set.
VARTYPE Function Returns the data type of a SAS data set variable.
Search WHICHC Function Searches for a character value that is equal to the first
argument, and returns the index of the first matching value.
WHICHN Function Searches for a numeric value that is equal to the first
argument, and returns the index of the first matching value.
ADDRLONG Function Returns the memory address of a variable on 32-bit and 64-bit
platforms.
CALL POKE Routine Writes a value directly into memory on a 32-bit platform.
CALL POKELONG Routine Writes a value directly into memory on 32-bit and 64-bit
platforms.
CALL SLEEP Routine For a specified period of time, suspends the execution of a
program that invokes this CALL routine.
DIF Function Returns differences between an argument and its nth lag.
INPUT Function Returns the value that is produced when SAS converts an
expression using the specified informat.
State and ZIP Code FIPNAME Function Converts two-digit FIPS codes to uppercase state names.
FIPNAMEL Function Converts two-digit FIPS codes to mixed case state names.
STNAMEL Function Converts state postal codes to mixed case state names.
ZIPCITY Function Returns a city name and the two-character postal code that
corresponds to a ZIP code.
ATAN2 Function Returns the arc tangent of the ratio of two numeric variables.
Truncation CEIL Function Returns the smallest integer that is greater than or equal to
the argument, fuzzed to avoid unexpected floating-point
results.
CEILZ Function Returns the smallest integer that is greater than or equal to
the argument, using zero fuzzing.
FLOOR Function Returns the largest integer that is less than or equal to the
argument, fuzzed to avoid unexpected floating-point results.
FLOORZ Function Returns the largest integer that is less than or equal to the
argument, using zero fuzzing.
FUZZ Function Returns the nearest integer if the argument is within 1E-12 of
that integer.
INTZ Function Returns the integer portion of the argument, using zero
fuzzing.
ROUND Function Rounds the first argument to the nearest multiple of the
second argument, or to the nearest integer when the second
argument is omitted.
ROUNDE Function Rounds the first argument to the nearest multiple of the
second argument, and returns an even multiple when the first
argument is halfway between the two nearest multiples.
ROUNDZ Function Rounds the first argument to the nearest multiple of the
second argument, using zero fuzzing.
Variable Control CALL LABEL Routine Assigns a variable label to a specified character variable.
CALL SET Routine Links SAS data set variables to DATA step or macro variables
that have the same name and data type.
CALL VNAME Routine Assigns a variable name as the value of a specified variable.
Variable Information CALL VNEXT Routine Returns the name, type, and length of a variable that is used
in a DATA step.
VARRAY Function Returns a value that indicates whether the specified name is
an array.
VARRAYX Function Returns a value that indicates whether the value of the
specified argument is an array.
VFORMAT Function Returns the format that is associated with the specified
variable.
VFORMATD Function Returns the decimal value of the format that is associated with
the specified variable.
VFORMATDX Function Returns the decimal value of the format that is associated with
the value of the specified argument.
VFORMATN Function Returns the format name that is associated with the specified
variable.
VFORMATNX Function Returns the format name that is associated with the value of
the specified argument.
VFORMATW Function Returns the format width that is associated with the specified
variable.
VFORMATWX Function Returns the format width that is associated with the value of
the specified argument.
VFORMATX Function Returns the format that is associated with the value of the
specified argument.
VINARRAY Function Returns a value that indicates whether the specified variable
is a member of an array.
VINARRAYX Function Returns a value that indicates whether the value of the
specified argument is a member of an array.
VINFORMAT Function Returns the informat that is associated with the specified
variable.
VINFORMATD Function Returns the decimal value of the informat that is associated
with the specified variable.
VINFORMATDX Function Returns the decimal value of the informat that is associated
with the value of the specified variable.
VINFORMATN Function Returns the informat name that is associated with the
specified variable.
VINFORMATNX Function Returns the informat name that is associated with the value of
the specified argument.
VINFORMATW Function Returns the informat width that is associated with the
specified variable.
VINFORMATWX Function Returns the informat width that is associated with the value of
the specified argument.
VINFORMATX Function Returns the informat that is associated with the value of the
specified argument.
VLABEL Function Returns the label that is associated with the specified
variable.
VLABELX Function Returns the label that is associated with the value of the
specified argument.
VLENGTHX Function Returns the compile-time (allocated) size for the variable that
has a name that is the same as the value of the argument.
VTYPEX Function Returns the type (character or numeric) for the value of the
specified argument.
VVALUE Function Returns the formatted value that is associated with the
variable that you specify.
VVALUEX Function Returns the formatted value that is associated with the
argument that you specify.
Web Tools HTMLDECODE Function Decodes a string that contains HTML numeric character
references or HTML character entity references, and returns
the decoded string.
URLDECODE Function Returns a string that was decoded using the URL escape
syntax.
URLENCODE Function Returns a string that was encoded using the URL escape
syntax.