SAS Function Summary PDF
SAS Function Summary PDF
SAS Function Summary PDF
CALL IS8601_CONVERT Routine Converts an ISO 8601 interval to datetime and duration
values, or converts datetime and duration values to an ISO 8601 interval.
DATDIF Function Returns the number of days between two dates.
DATE Function Returns the current date as a SAS date value.
DATEJUL Function Converts a Julian date to a SAS date value.
DATEPART Function Extracts the date from a SAS datetime value.
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.
HOLIDAY Function Returns a SAS date value of a specified holiday for a specified year.
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.
INTCK Function Returns the count of the number of interval boundaries between two
dates, two times, or two datetime values.
INTCYCLE Function Returns the date, time, or datetime interval at the next higher
seasonal cycle when a date, time, or datetime interval is specified.
INTFIT Function Returns a time interval that is aligned between two dates.
INTFMT Function Returns a recommended SAS format when a date, time, or datetime
interval is specified.
INTGET Function Returns a time interval based on three date or datetime values.
INTINDEX Function Returns the seasonal index when a date, time, or datetime interval
and value are specified.
INTNX Function Increments a date, time, or datetime value by a given time interval,
and returns a date, time, or datetime value.
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.
INTTEST Function Returns 1 if a time interval is valid, and returns 0 if a time interval is
invalid.
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.
MONTH Function Returns the month from a SAS date 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.
TIMEPART Function Extracts a time value from a SAS datetime value.
TODAY Function Returns the current date as a numeric SAS date value.
WEEK Function Returns the week-number value.
WEEKDAY Function From a SAS date value, returns an integer that corresponds to the
day of the week.
YEAR Function Returns the year from a SAS date value.
YRDIF Function Returns the difference in years between two dates.
YYQ Function Returns a SAS date value from year and quarter year values.
Descriptive Statistics
Mathematical
Probability
Array
Combinatorial
Hyperbolic
Macro
CALL EXECUTE Routine Resolves the argument, and issues the resolved value for
execution at the next step boundary.
CALL SYMPUT Routine Assigns DATA step information to a macro variable.
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.
SYMEXIST Function Returns an indication of the existence of a macro variable.
SYMGET Function Returns the value of a macro variable during DATA step execution.
SYMGLOBL Function Returns an indication of whether a macro variable is in global
scope to the DATA step during DATA step execution.
SYMLOCAL Function Returns an indication of whether a macro variable is in local scope
to the DATA step during DATA step execution.
Quantile
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.
Sort
External Routines
CALL MODULE Routine Calls an external routine without any return code.
MODULEC Function Calls an external routine and returns a character value.
MODULEN Function Calls an external routine and returns a numeric value.
Trigonometric
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.
INT Function Returns the integer value, fuzzed to avoid unexpected floating-point
results.
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.
TRUNC Function Truncates a numeric value to a specified number of bytes.
Variable Control
Arithmetic
DIVIDE Returns the result of a division that handles special missing values for ODS
output.
Numeric
IFN Function Returns a numeric value based on whether an expression is true, false, or
missing.
Web Tools
External Files
DCLOSE Function Closes a directory that was opened by the DOPEN function.
DCREATE Function Returns the complete pathname of a new, external directory.
DINFO Function Returns information about a directory.
DNUM Function Returns the number of members in a directory.
DOPEN Function Opens a directory, and returns a directory identifier value.
DOPTNAME Function Returns directory attribute information.
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.
FCLOSE Function Closes an external file, directory, or directory member.
FCOL Function Returns the current column position in the File Data Buffer (FDB).
FDELETE Function Deletes an external file or an empty directory.
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.
FILENAME Function Assigns or deassigns a fileref to an external file, directory, or output
device.
FILEREF Function Verifies whether a fileref has been assigned for the current SAS
session.
FINFO Function Returns the value of a file information item.
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.
FOPTNAME Function Returns the name of an item of information about a file.
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.
FWRITE Function Writes a record to an external file.
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.
RENAME Function Renames a member of a SAS library, an entry in a SAS catalog, an
external file, or a directory.
SYSMSG Function Returns error or warning message text from processing the last data
set or external file function.
SYSRC Function Returns a system error number.
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.
COMPOUND Function Returns compound interest parameters.
CONVX Function Returns the convexity for an enumerated cash flow.
CONVXP Function Returns the convexity for a periodic cash flow stream, such as a
bond.
DACCDB Function Returns the accumulated declining balance depreciation.
DACCDBSL Function Returns the accumulated declining balance with conversion to a
straight-line depreciation.
DACCSL Function Returns the accumulated straight-line depreciation.
DACCSYD Function Returns the accumulated sum-of-years-digits depreciation.
DACCTAB Function Returns the accumulated depreciation from specified tables.
DEPDB Function Returns the declining balance depreciation.
DEPDBSL Function Returns the declining balance with conversion to a straight-line
depreciation.
DEPSL Function Returns the straight-line depreciation.
DEPSYD Function Returns the sum-of-years-digits depreciation.
DEPTAB Function Returns the depreciation from specified tables.
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.
FINANCE Function Computes financial calculations such as depreciation, maturation,
accrued interest, net present value, periodic savings, and internal rates of return.
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.
INTRR Function Returns the internal rate of return as a fraction.
IRR Function Returns the internal rate of return as a percentage.
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.
MORT Function Returns amortization parameters.
NETPV Function Returns the net present value as a fraction.
NPV Function Returns the net present value with the rate expressed as a percentage.
PVP Function Returns the present value for a periodic cash flow stream (such as a
bond), with repayment of principal at maturity.
SAVING Function Returns the future value of a periodic saving.
YIELDP Function Returns the yield-to-maturity for a periodic cash flow stream, such as a
bond.
Random Number
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.
CLOSE Function Closes a SAS data set.
CUROBS Function Returns the observation number of the current observation.
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.
ENVLEN Function Returns the length of an environment variable.
EXIST Function Verifies the existence of a SAS library member.
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.
IORCMSG Function Returns a formatted error message for _IORC_.
LIBNAME Function Assigns or deassigns a libref for a SAS library.
LIBREF Function Verifies that a libref has been assigned.
NOTE Function Returns an observation ID for the current observation of a SAS data set.
OPEN Function Opens a SAS data set.
PATHNAME Function Returns the physical name of an external file or a SAS library, or
returns a blank.
POINT Function Locates an observation that is identified by the NOTE function.
RENAME Function Renames a member of a SAS library, an entry in a SAS catalog, an
external file, or a directory.
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.
SYSRC Function Returns a system error number.
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.
VARLEN Function Returns the length of a SAS data set variable.
VARNAME Function Returns the name of 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.
Special
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.
VLENGTH Function Returns the compile-time (allocated) size of the specified variable.
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.
VNAME Function Returns the name of the specified variable.
VNAMEX Function Validates the value of the specified argument as a variable name.
VTYPE Function Returns the type (character or numeric) of the specified variable.
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.
Distance
GEODIST Function Returns the geodetic distance between two latitude and longitude
coordinates.
ZIPCITYDISTANCE Function Returns the geodetic distance between two zip code
locations.
FIPNAME Function Converts two-digit FIPS codes to uppercase state names. FIPNAMEL
Function Converts two-digit FIPS codes to mixed case state names. FIPSTATE Function
Converts two-digit FIPS codes to two-character state postal codes. STFIPS Function
Converts state postal codes to FIPS state codes.
STNAME Function Converts state postal codes to uppercase 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.
ZIPCITYDISTANCE Function Returns the geodetic distance between two zip code
locations.
ZIPFIPS Function Converts zip codes to two-digit FIPS codes.
ZIPNAME Function Converts zip codes to uppercase state names.
ZIPNAMEL Function Converts zip codes to mixed case state names.
ZIPSTATE Function Converts zip codes to two-character state postal codes.