LENGTH Statement – letting SAS format the variables as they are

SAS Introduction – Summer 2005
Appendices
Page 1
LENGTH Statement – letting SAS format the variables as they are input usually works pretty
well, as long as you distinguish between character and numeric. However, occasionally
things go awry. The length statement is needed to specify character variable with more
than 8 characters. With column input this is not needed. It is needed for list input.
The length statement is also useful for reducing the size of large files. By default SAS reads and
stores character variables as 8 characters. This is inefficient if fewer characters are
needed, so a length statement can reduce the size of a database by specifying fewer
characters.
Many integer variables can be stored in less than 8 bytes. For example, station numbers, month,
day and year can usually be stored with 3 bytes. The length statement can also be used to
reduce the size of stored integer variables, but this is a bit trickier. The table below
specifies the largest integer that can be stored with a given number of characters.
Length in Bytes
Largest Integer Represented Exactly
3
8,192
4
2,097,152
5
536,870,912
6
137,438,953,472
7
35,184,372,088,832
8
9,007,199,254,740,992
Do not use fewer than 8 bytes to store numbers that are not integers or precision will be reduced.
Date informats used to read dates in different forms (example result is the SASdate value
“14686” except for MONYYw. which gives 14670 and YYQW. which gives 14610).
List
Input
DATEw.
17MAR2000
DATE9.
17MAR2000
DDMMYYw.
170300
DDMMYY8.
17032000
JULIANw.
0077
JULIAN7.
2000077
MMDDYYw.
031700
MMDDYY10.
03172000
MONYYw.
MAR00
YYMMDDw.
000317
YYMMDD10.
20000317
YYQw.
00Q1
See SAS for time and date time formats and informats.
SAS Introduction – Summer 2005
Appendices
Page 2
Date formats used to write dates in different forms (example is the format applied to “14686”).
Format
DATEw.
DATE9.
DAYw.
DDMMYYw.
DDMMYY10.
DDMMYYBw.
DDMMYYB10.
DDMMYYCw.
DDMMYYC10.
DDMMYYDw.
DDMMYYD10.
DDMMYYNw.
DDMMYYN10
DDMMYYPw.
DDMMYYP10.
DDMMYYSw.
DDMMYYS10.
DOWNAME.
JULDAYw.
JULIANw.
MMDDYYw.
MMDDYY10.
MMDDYYBw.
MMDDYYB10.w.
MMDDYYCw.
MMDDYYC10
MMDDYYDw.
MMDDYYD10.
MMDDYYNw.
MMDDYYN10.
MMDDYYP
MMDDYYP10.
MMDDYYS
MMDDYYS10.
MMYY.xw.
MMYYCw.
MMYYD.
MMYYN.
MMYYP.
Result
17MAR00
17MAR2000a
17
17/03/00
17/03/2000
17 03 00
17 03 2000
17:03:20
17:03:2000
17-03-00
17-03-2000
17MAR00
17MAR2000
17.03.00
17.03.2000
17/03/00
17/03/2000
Friday
77
00077
03/17/00
03/17/2000
03 17 00
03 17 2000
03:17:00
03:17:2000
03-17-00
03-17-2000
031700
03172000
03.17.00
03.17.2000
03/17/00
03/17/2000
03M2000
03:2000
03-2000
032000
03.2000
MMYYS.
MONNAME.
MONTH.
MONYY.
PDJULGw.
PDJULIw.
QTRw.
QTRRw.
TIMEw.d
TIMEAMPMw.d
TOD
WEEKDATEw.
WEEKDAYw.
WORDDATE.w.
WORDDATXw.
YEARw.
YYMMw.
YYMMCw.
YYMMDDw.
YYMMPw.
YYMMS.
YYMMN.
YYMMDDw.
YYMON.
YYQxw.
YYQCw.
YYQDw.
YYQPw.
YYQSw.
YYQNw.
YYQRw.
YYQRCw.
YYQRDw.
YYQRPw.w.
YYQRSw.
YYQRNw.
03/2000
March
3
MAR2000
2000077F
0100077F
1
I
4:04:46
4:04:46 AM
4:04:46
Friday, March 17, 2000
6
March 17, 2000
17 MARCH 2000
2000
2000M03
2000:03
2000-03
2000.03
2000/03
200003
00-03-17
2000MAR
2000Q1
2000:1
2000-1
2000.1
2000/1
20001
2000QI
2000:I
2000-I
2000.I
2000/I
III
EXST 4087 – Introduction to SAS
Page 3
Today is Tuesday, June 27, 2006. This is SASdate 16979.
Lengths of variables and names in SAS
Maximum Length of SAS Names
SAS Application
Arrays
CALL routines
Catalog entries
DATA step statement labels
DATA step variable labels
DATA step variables
DATA step windows
Engines
Filerefs
Formats, character
Formats, numeric
Functions
Generation data sets
Informats, character
Informats, numeric
Librefs
Macro variables
Macro windows
Macros
Members of SAS data libraries (SAS data sets, views,
catalogs, indexes) except for generation data sets
Passwords
Procedure names (first 8 characters must be unique, and may not
begin with "SAS")
SCL variables
Max Length
32
16
32
32
256
32
32
8
8
31
32
16
28
30
31
8
32
32
32
32
8
16
32
EXST 4087 – Introduction to SAS
Page 4
SAS Built-in Functions
Type
Array
Array
Array
Bitwise Logical Operations
Bitwise Logical Operations
Bitwise Logical Operations
Bitwise Logical Operations
Bitwise Logical Operations
Bitwise Logical Operations
Character String Matching
Character String Matching
Functions and CALL Routines
DIM Function
HBOUND Function
LBOUND Function
BAND Function
BLSHIFT Function
BNOT Function
BOR Function
BRSHIFT Function
BXOR Function
CALL PRXCHANGE Routine
CALL PRXDEBUG Routine
Character String Matching
Character String Matching
CALL PRXFREE Routine
CALL PRXNEXT Routine
Character String Matching
Character String Matching
Character String Matching
Character String Matching
CALL PRXPOSN Routine
CALL PRXSUBSTR Routine
CALL RXCHANGE Routine
CALL RXFREE Routine
Character String Matching
Character String Matching
Character String Matching
CALL RXSUBSTR Routine
PRXCHANGE Function
PRXMATCH Function
Character String Matching
Character String Matching
PRXPAREN Function
PRXPARSE Function
Character String Matching
Character String Matching
Character String Matching
Character
PRXPOSN Function
RXMATCH Function
RXPARSE Function
ANYALNUM Function
Character
ANYALPHA Function
Character
ANYCNTRL Function
Character
ANYDIGIT Function
Character
ANYFIRST Function
Character
ANYGRAPH Function
Character
ANYLOWER Function
Character
ANYNAME Function
Character
ANYPRINT Function
Character
ANYPUNCT Function
Character
ANYSPACE Function
Character
ANYUPPER Function
Character
ANYXDIGIT Function
Character
Character
Character
Character
BYTE Function
CALL CATS Routine
CALL CATT Routine
CALL CATX Routine
Character
Character
Character
CALL COMPCOST Routine
CALL MISSING Routine
CALL SCAN Routine
Description
Returns the number of elements in an array
Returns the upper bound of an array
Returns the lower bound of an array
Returns the bitwise logical AND of two arguments
Returns the bitwise logical left shift of two arguments
Returns the bitwise logical NOT of an argument
Returns the bitwise logical OR of two arguments
Returns the bitwise logical right shift of two arguments
Returns the bitwise logical EXCLUSIVE OR of two arguments
Performs a pattern-matching replacement
Enables Perl regular expressions in a DATA step to send debug output to the
SAS log
Frees unneeded memory that was allocated for a Perl regular expression
Returns the position and length of a substring that matches a pattern and iterates
over multiple matches within one string
Returns the start position and length for a capture buffer
Returns the position and length of a substring that matches a pattern
Changes one or more substrings that match a pattern
Frees memory allocated by other regular expression (RX) functions and CALL
routines
Finds the position, length, and score of a substring that matches a pattern
Performs a pattern-matching replacement
Searches for a pattern match and returns the position at which the pattern is
found
Returns the last bracket match for which there is a match in a pattern
Compiles a Perl regular expression (PRX) that can be used for pattern matching
of a character value
Returns the value for a capture buffer
Finds the beginning of a substring that matches a pattern
Parses a pattern
Searches a character string for an alphanumeric character and returns the first
position at which it is found
Searches a character string for an alphabetic character and returns the first
position at which it is found
Searches a character string for a control character and returns the first position
at which it is found
Searches a character string for a digit and returns the first position at which it is
found
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
Searches a character string for a graphical character and returns the first
position at which it is found
Searches a character string for a lowercase letter and returns the first position at
which it is found
Searches a character string for a character that is valid in a SAS variable name
under VALIDVARNAME=V7, and returns the first position at which that
character is found
Searches a character string for a printable character and returns the first position
at which it is found
Searches a character string for a punctuation character and returns the first
position at which it is found
Searches a character string for a white-space character (blank, horizontal and
vertical tab, carriage return, line feed, form feed) and returns the first position at
which it is found
Searches a character string for an uppercase letter and returns the first position
at which it is found
Searches a character string for a hexadecimal character that represents a digit
and returns the first position at which that character is found
Returns one character in the ASCII or the EBCDIC collating sequence
Concatenates character strings and removes leading and trailing blanks
Concatenates character strings and removes trailing blanks
Concatenates character strings, removes leading and trailing blanks, and inserts
separators
Sets the costs of operations for later use by the COMPGED function
Assigns a missing value to the specified character or numeric variables.
Returns the position and length of a given word from a character expression
EXST 4087 – Introduction to SAS
Character
CALL SCANQ Routine
Character
Character
Character
Character
CAT Function
CATS Function
CATT Function
CATX Function
Character
CHOOSEC Function
Character
CHOOSEN Function
Character
Character
Character
COALESCEC Function
COLLATE Function
COMPARE Function
Character
Character
Character
Character
Character
COMPBL Function
COMPGED Function
COMPLEV Function
COMPRESS Function
COUNT Function
Character
COUNTC Function
Character
DEQUOTE Function
Character
FIND Function
Character
FINDC Function
Character
IFC Function
Character
IFN Function
Character
Character
Character
Character
Character
INDEX Function
INDEXC Function
INDEXW Function
LEFT Function
LENGTH Function
Character
Character
Character
LENGTHC Function
LENGTHM Function
LENGTHN Function
Character
Character
LOWCASE Function
MISSING Function
Character
Character
NLITERAL Function
NOTALNUM Function
Character
NOTALPHA Function
Character
NOTCNTRL Function
Character
NOTDIGIT Function
Character
NOTFIRST Function
Character
NOTGRAPH Function
Character
NOTLOWER Function
Character
NOTNAME Function
Character
NOTPRINT Function
Character
NOTPUNCT Function
Character
NOTSPACE Function
Page 5
Returns the position and length of a given word from a character expression,
and ignores delimiters that are enclosed in quotation marks
Concatenates character strings without removing leading or trailing blanks
Concatenates character strings and removes leading and trailing blanks
Concatenates character strings and removes trailing blanks
Concatenates character strings, removes leading and trailing blanks, and inserts
separators
Returns a character value that represents the results of choosing from a list of
arguments
Returns a numeric value that represents the results of choosing from a list of
arguments
Returns the first non-missing value from a list of character arguments.
Returns an ASCII or EBCDIC collating sequence character string
Returns the position of the leftmost character by which two strings differ, or
returns 0 if there is no difference
Removes multiple blanks from a character string
Compares two strings by computing the generalized edit distance
Compares two strings by computing the Levenshtein edit distance
Removes specific characters from a character string
Counts the number of times that a specific substring of characters appears
within a character string that you specify
Counts the number of specific characters that either appear or do not appear
within a character string that you specify
Removes matching quotation marks from a character string that begins with an
individual quotation mark and deletes everything that is to the right of the
closing quotation mark
Searches for a specific substring of characters within a character string that you
specify
Searches for specific characters that either appear or do not appear within a
character string that you specify
Returns a character value of an expression based on whether the expression is
true, false, or missing
Returns a numeric value of an expression based on whether the expression is
true, false, or missing
Searches a character expression for a string of characters
Searches a character expression for specific characters
Searches a character expression for a specified string as a word
Left aligns a SAS character expression
Returns the length of a non-blank character string, excluding trailing blanks,
and returns 1 for a blank character string
Returns the length of a character string, including trailing blanks
Returns the amount of memory (in bytes) that is allocated for a character string
Returns the length of a non-blank character string, excluding trailing blanks,
and returns 0 for a blank character string
Converts all letters in an argument to lowercase
Returns a numeric result that indicates whether the argument contains a missing
value
Converts a character string that you specify to a SAS name literal (n-literal)
Searches a character string for a non-alphanumeric character and returns the
first position at which it is found
Searches a character string for a non-alphabetic character and returns the first
position at which it is found
Searches a character string for a character that is not a control character and
returns the first position at which it is found
Searches a character string for any character that is not a digit and returns the
first position at which that character is found
Searches a character string for an invalid first character in a SAS variable name
under VALIDVARNAME=V7, and returns the first position at which that
character is found
Searches a character string for a non-graphical character and returns the first
position at which it is found
Searches a character string for a character that is not a lowercase letter and
returns the first position at which that character is found
Searches a character string for an invalid character in a SAS variable name
under VALIDVARNAME=V7, and returns the first position at which that
character is found
Searches a character string for a non-printable character and returns the first
position at which it is found
Searches a character string for a character that is not a punctuation character
and returns the first position at which it is found
Searches a character string for a character that is not a white-space character
(blank, horizontal and vertical tab, carriage return, line feed, form feed) and
EXST 4087 – Introduction to SAS
Character
NOTUPPER Function
Character
NOTXDIGIT Function
Character
NVALID Function
Character
Character
Character
Character
Character
Character
Character
Character
PROPCASE Function
QUOTE Function
RANK Function
REPEAT Function
REVERSE Function
RIGHT Function
SCAN Function
SCANQ Function
Character
Character
SOUNDEX Function
SPEDIS Function
Character
Character
STRIP Function
SUBPAD Function
Character
Character
Character
Character
Character
Character
Character
SUBSTR (left of =) Function
SUBSTR (right of =) Function
SUBSTRN Function
TRANSLATE Function
TRANTAB Function
TRANWRD Function
TRIM Function
Character
TRIMN Function
Character
Character
Currency Conversion
DBCS
DBCS
DBCS
DBCS
DBCS
DBCS
DBCS
UPCASE Function
VERIFY Function
EUROCURR Function
KCOMPARE Function
KCOMPRESS Function
KCOUNT Function
KCVT Function
KINDEX Function
KINDEXC Function
KLEFT Function
DBCS
DBCS
DBCS
DBCS
KLENGTH Function
KLOWCASE Function
KREVERSE Function
KRIGHT Function
DBCS
DBCS
DBCS
DBCS
KSCAN Function
KSTRCAT Function
KSUBSTR Function
KSUBSTRB Function
DBCS
DBCS
DBCS
DBCS
DBCS
DBCS
KTRANSLATE Function
KTRIM Function
KTRUNCATE Function
KUPCASE Function
KUPDATE Function
KUPDATEB Function
DBCS
Date and Time
Date and Time
Date and Time
Date and Time
Date and Time
Date and Time
Date and Time
Date and Time
Date and Time
Date and Time
KVERIFY Function
DATDIF Function
DATE Function
DATEJUL Function
DATEPART Function
DATETIME Function
DAY Function
DHMS Function
HMS Function
HOUR Function
INTCK Function
Page 6
returns the first position at which it is found
Searches a character string for a character that is not an uppercase letter and
returns the first position at which that character is found
Searches a character string for a character that is not a hexadecimal digit and
returns the first position at which that character is found
Checks a character string for validity for use as a SAS variable name in a SAS
statement
Converts all words in an argument to proper case
Adds double quotation marks to a character value
Returns the position of a character in the ASCII or EBCDIC collating sequence
Repeats a character expression
Reverses a character expression
Right aligns a character expression
Selects a given word from a character expression
Returns the nth word from a character expression, ignoring delimiters that are
enclosed in quotation marks
Encodes a string to facilitate searching
Determines the likelihood of two words matching, expressed as the asymmetric
spelling distance between the two words
Returns a character string with all leading and trailing blanks removed
Returns a substring that has a length you specify, using blank padding if
necessary
Replaces character value contents
Extracts a substring from an argument
Returns a substring, allowing a result with a length of zero
Replaces specific characters in a character expression
Transcodes a data string by using a translation table
Replaces or removes all occurrences of a word in a character string
Removes trailing blanks from character expressions and returns one blank if the
expression is missing
Removes trailing blanks from character expressions and returns a null string
(zero blanks) if the expression is missing
Converts all letters in an argument to uppercase
Returns the position of the first character that is unique to an expression
Converts one European currency to another
Returns the result of a comparison of character strings
Removes specific characters from a character string
Returns the number of double-byte characters in a string
Converts data from an encoding code to another encoding code
Searches a character expression for a string of characters
Searches a character expression for specific characters
Left aligns a character expression by removing unnecessary leading DBCS
blanks and SO/SI
Returns the length of an argument
Converts all letters in an argument to lowercase
Reverses a character expression
Right aligns a character expression by trimming trailing DBCS blanks and
SO/SI
Selects a specific word from a character expression
Concatenates two or more character strings
Extracts a substring from an argument
Extracts a substring from an argument according to the byte position of the
substring in the argument
Replaces specific characters in a character expression
Removes trailing DBCS blanks and SO/SI from character expressions
Truncates a numeric value to a specified length
Converts all single-byte letters in an argument to uppercase
Inserts, deletes, and replaces character value contents
Inserts, deletes, and replaces the contents of the character value according to the
byte position of the character value in the argument
Returns the position of the first character that is unique to an expression
Returns the number of days between two dates
Returns the current date as a SAS date value
Converts a Julian date to a SAS date value
Extracts the date from a SAS datetime value
Returns the current date and time of day as a SAS datetime value
Returns the day of the month from a SAS date value
Returns a SAS datetime value from date, hour, minute, and second
Returns a SAS time value from hour, minute, and second values
Returns the hour from a SAS time or datetime value
Returns the integer count of the number of interval boundaries between two
EXST 4087 – Introduction to SAS
Date and Time
INTNX Function
Date and Time
Date and Time
Date and Time
Date and Time
Date and Time
Date and Time
JULDATE Function
JULDATE7 Function
MDY Function
MINUTE Function
MONTH Function
NLDATE Function
Date and Time
NLDATM Function
Date and Time
NLTIME Function
Date and Time
Date and Time
Date and Time
Date and Time
Date and Time
Date and Time
Date and Time
Date and Time
Date and Time
Date and Time
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
QTR Function
SECOND Function
TIME Function
TIMEPART Function
TODAY Function
WEEK Function
WEEKDAY Function
YEAR Function
YRDIF Function
YYQ Function
CSS Function
CV Function
GEOMEAN Function
GEOMEANZ Function
HARMEAN Function
HARMEANZ Function
IQR Function
KURTOSIS Function
LARGEST Function
MAD Function
MAX Function
MEAN Function
MEDIAN Function
MIN Function
MISSING Function
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
Descriptive Statistics
External Files
External Files
External Files
External Files
External Files
External Files
External Files
External Files
External Files
External Files
External Files
External Files
External Files
External Files
External Files
External Files
External Files
N Function
NMISS Function
ORDINAL Function
PCTL Function
RANGE Function
RMS Function
SKEWNESS Function
SMALLEST Function
STD Function
STDERR Function
SUM Function
USS Function
VAR Function
DCLOSE Function
DINFO Function
DNUM Function
DOPEN Function
DOPTNAME Function
DOPTNUM Function
DREAD Function
DROPNOTE Function
FAPPEND Function
FCLOSE Function
FCOL Function
FDELETE Function
FEXIST Function
FGET Function
FILEEXIST Function
FILENAME Function
FILEREF Function
Page 7
dates, two times, or two datetime values
Increments a date, time, or datetime value by a given interval or intervals, and
returns a date, time, or datetime value
Returns the Julian date from a SAS date value
Returns a seven-digit Julian date from a SAS date value
Returns a SAS date value from month, day, and year values
Returns the minute from a SAS time or datetime value
Returns the month from a SAS date value
Converts the SAS date value to the date value of the specified locale using the
date-format modifiers
Converts the SAS datetime values to the time value of the specified locale using
the datetime format modifiers
Converts the SAS time or datetime value to the time value of the specified
locale using the time-format modifiers
Returns the quarter of the year from a SAS date value
Returns the second from a SAS time or datetime value
Returns the current time of day
Extracts a time value from a SAS datetime value
Returns the current date as a SAS date value
Returns the week number value
Returns the day of the week from a SAS date value
Returns the year from a SAS date value
Returns the difference in years between two dates
Returns a SAS date value from the year and quarter
Returns the corrected sum of squares
Returns the coefficient of variation
Returns the geometric mean
Returns the geometric mean, using zero fuzzing
Returns the harmonic mean
Returns the harmonic mean, using zero fuzzing
Returns the interquartile range
Returns the kurtosis
Returns the kth largest non-missing value
Returns the median absolute deviation from the median
Returns the largest value
Returns the arithmetic mean (average)
Computes median values
Returns the smallest value
Returns a numeric result that indicates whether the argument contains a missing
value
Returns the number of nonmissing values
Returns the number of missing values
Returns any specified order statistic
Computes percentiles
Returns the range of values
Returns the root mean square
Returns the skewness
Returns the kth smallest nonmissing value
Returns the standard deviation
Returns the standard error of the mean
Returns the sum of the nonmissing arguments
Returns the uncorrected sum of squares
Returns the variance
Closes a directory that was opened by the DOPEN function
Returns information about a directory
Returns the number of members in a directory
Opens a directory and returns a directory identifier value
Returns directory attribute information
Returns the number of information items that are available for a directory
Returns the name of a directory member
Deletes a note marker from a SAS data set or an external file
Appends the current record to the end of an external file
Closes an external file, directory, or directory member
Returns the current column position in the File Data Buffer (FDB)
Deletes an external file or an empty directory
Verifies the existence of an external file associated with a fileref
Copies data from the File Data Buffer (FDB) into a variable
Verifies the existence of an external file by its physical name
Assigns or deassigns a fileref to an external file, directory, or output device
Verifies that a fileref has been assigned for the current SAS session
EXST 4087 – Introduction to SAS
External Files
External Files
External Files
External Files
External Files
External Files
External Files
External Files
FINFO Function
FNOTE Function
FOPEN Function
FOPTNAME Function
FOPTNUM Function
FPOINT Function
FPOS Function
FPUT Function
External Files
External Files
External Files
FREAD Function
FREWIND Function
FRLEN Function
External Files
External Files
External Files
FSEP Function
FWRITE Function
MOPEN Function
External Files
PATHNAME Function
External Files
SYSMSG Function
External Files
External Routines
External Routines
External Routines
External Routines
SYSRC Function
CALL MODULE Routine
CALL MODULEI Routine
MODULEC Function
MODULEIC Function
External Routines
MODULEIN Function
External Routines
Financial
Financial
Financial
Financial
Financial
MODULEN Function
COMPOUND Function
CONVX Function
CONVXP Function
DACCDB Function
DACCDBSL Function
Financial
Financial
Financial
Financial
Financial
Financial
Financial
Financial
Financial
Financial
Financial
Financial
Financial
Financial
Financial
Financial
DACCSL Function
DACCSYD Function
DACCTAB Function
DEPDB Function
DEPDBSL Function
DEPSL Function
DEPSYD Function
DEPTAB Function
DUR Function
DURP Function
INTRR Function
IRR Function
MORT Function
NETPV Function
NPV Function
PVP Function
Financial
Financial
Hyperbolic
Hyperbolic
Hyperbolic
Macro
Macro
Macro
SAVING Function
YIELDP Function
COSH Function
SINH Function
TANH Function
CALL EXECUTE Routine
CALL SYMPUT Routine
CALL SYMPUTX Routine
Macro
RESOLVE Function
Macro
Macro
Macro
SYMEXIST Function
SYMGET Function
SYMGLOBL Function
Macro
SYMLOCAL Function
Mathematical
ABS Function
Page 8
Returns the value of a file information item
Identifies the last record that was read and returns a value that FPOINT can use
Opens an external file and returns a file identifier value
Returns the name of an item of information about a file
Returns the number of information items that are available for an external file
Positions the read pointer on the next record to be read
Sets the position of the column pointer in the File Data Buffer (FDB)
Moves data to the File Data Buffer (FDB) of an external file, starting at the
FDB's current column position
Reads a record from an external file into the File Data Buffer (FDB)
Positions the file pointer to the start of the file
Returns the size of the last record read, or, if the file is opened for output,
returns the current record size
Sets the token delimiters for the FGET function
Writes a record to an external file
Opens a file by directory id and member name, and returns the file identifier or
a0
Returns the physical name of a SAS data library or of an external file, or returns
a blank
Returns the text of error messages or warning messages from the last data set or
external file function execution
Returns a system error number
Calls the external routine without any return code
Calls the external routine without any return code (in IML environment only)
Calls an external routine and returns a character value
Calls an external routine and returns a character value (in IML environment
only)
Calls an external routine and returns a numeric value (in IML environment
only)
Calls an external routine and returns a numeric value
Returns compound interest parameters
Returns the convexity for an enumerated cash flow
Returns the convexity for a periodic cash flow stream, such as a bond
Returns the accumulated declining balance depreciation
Returns the accumulated declining balance with conversion to a straight-line
depreciation
Returns the accumulated straight-line depreciation
Returns the accumulated sum-of-years-digits depreciation
Returns the accumulated depreciation from specified tables
Returns the declining balance depreciation
Returns the declining balance with conversion to a straight-line depreciation
Returns the straight-line depreciation
Returns the sum-of-years-digits depreciation
Returns the depreciation from specified tables
Returns the modified duration for an enumerated cash flow
Returns the modified duration for a periodic cash flow stream, such as a bond
Returns the internal rate of return as a fraction
Returns the internal rate of return as a percentage
Returns amortization parameters
Returns the net present value as a fraction
Returns the net present value with the rate expressed as a percentage
Returns the present value for a periodic cash flow stream with repayment of
principal at maturity, such as a bond
Returns the future value of a periodic saving
Returns the yield-to-maturity for a periodic cash flow stream, such as a bond
Returns the hyperbolic cosine
Returns the hyperbolic sine
Returns the hyperbolic tangent
Resolves an argument and issues the resolved value for execution
Assigns DATA step information to a macro variable
Assigns a value to a macro variable and removes both leading and trailing
blanks
Returns the resolved value of an argument after it has been processed by the
macro facility
Returns an indication of the existence of a macro variable
Returns the value of a macro variable during DATA step execution
Returns an indication as to whether a macro variable is in a global scope to the
DATA step during DATA step execution.
Returns an indication as to whether a macro variable is in a local scope to the
DATA step during DATA step execution
Returns the absolute value
EXST 4087 – Introduction to SAS
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
AIRY Function
BETA Function
CALL ALLPERM Routine
CALL LOGISTIC Routine
CALL SOFTMAX Routine
CALL STDIZE Routine
CALL TANH Routine
CNONCT Function
COALESCE Function
COMB Function
CONSTANT Function
DAIRY Function
DEVIANCE Function
DIGAMMA Function
ERF Function
ERFC Function
EXP Function
FACT Function
FNONCT Function
GAMMA Function
IBESSEL Function
JBESSEL Function
LGAMMA Function
LOG Function
LOG10 Function
LOG2 Function
LOGBETA Function
MOD Function
Mathematical
MODZ Function
Mathematical
Mathematical
Mathematical
Mathematical
Mathematical
Probability
Probability
Probability
Probability
Probability
Probability
Probability
Probability
Probability
Probability
Probability
Probability
Probability
Probability
PERM Function
SIGN Function
SQRT Function
TNONCT Function
TRIGAMMA Function
CDF Function
LOGCDF Function
LOGPDF Function
LOGSDF Function
PDF Function
POISSON Function
PROBBETA Function
PROBBNML Function
PROBBNRM Function
PROBCHI Function
PROBF Function
PROBGAM Function
PROBHYPR Function
PROBMC Function
Probability
Probability
Probability
Probability
Quantile
Quantile
Quantile
Quantile
Quantile
Quantile
Quantile
Random Number
Random Number
Random Number
Random Number
Random Number
Random Number
PROBNEGB Function
PROBNORM Function
PROBT Function
SDF Function
BETAINV Function
CINV Function
FINV Function
GAMINV Function
PROBIT Function
QUANTILE Function
TINV Function
CALL RANBIN Routine
CALL RANCAU Routine
CALL RANEXP Routine
CALL RANGAM Routine
CALL RANNOR Routine
CALL RANPERK Routine
Random Number
CALL RANPERM Routine
Page 9
Returns the value of the airy function
Returns the value of the beta function
Generates all permutations of the values of several variables
Returns the logistic value
Returns the softmax value
Standardizes the values of one or more variables
Returns the hyperbolic tangent
Returns the noncentrality parameter from a chi-squared distribution
Returns the first non-missing value from a list of numeric arguments.
Computes the number of combinations of n elements taken r at a time
Computes some machine and mathematical constants
Returns the derivative of the AIRY function
Computes the deviance
Returns the value of the Digamma function
Returns the value of the (normal) error function
Returns the value of the complementary (normal) error function
Returns the value of the exponential function
Computes a factorial
Returns the value of the noncentrality parameter of an F distribution
Returns the value of the Gamma function
Returns the value of the modified bessel function
Returns the value of the bessel function
Returns the natural logarithm of the Gamma function
Returns the natural (base e) logarithm
Returns the logarithm to the base 10
Returns the logarithm to the base 2
Returns the logarithm of the beta function
Returns the remainder from the division of the first argument by the second
argument, fuzzed to avoid most unexpected floating-point results
Returns the remainder from the division of the first argument by the second
argument, using zero fuzzing
Computes the number of permutations of n items taken r at a time
Returns the sign of a value
Returns the square root of a value
Returns the value of the noncentrality parameter from the student's t distribution
Returns the value of the Trigamma function
Computes cumulative distribution functions
Computes the logarithm of a left cumulative distribution function
Computes the logarithm of a probability density (mass) function
Computes the logarithm of a survival function
Computes probability density (mass) functions
Returns the probability from a Poisson distribution
Returns the probability from a beta distribution
Returns the probability from a binomial distribution
Computes a probability from the bivariate normal distribution
Returns the probability from a chi-squared distribution
Returns the probability from an F distribution
Returns the probability from a gamma distribution
Returns the probability from a hypergeometric distribution
Computes a probability or a quantile from various distributions for multiple
comparisons of means
Returns the probability from a negative binomial distribution
Returns the probability from the standard normal distribution
Returns the probability from a t distribution
Computes a survival function
Returns a quantile from the beta distribution
Returns a quantile from the chi-squared distribution
Returns a quantile from the F distribution
Returns a quantile from the gamma distribution
Returns a quantile from the standard normal distribution
Computes the quantile from a specified distribution
Returns a quantile from the t distribution
Returns a random variate from a binomial distribution
Returns a random variate from a Cauchy distribution
Returns a random variate from an exponential distribution
Returns a random variate from a gamma distribution
Returns a random variate from a normal distribution
Randomly permutes the values of the arguments, and returns a permutation of k
out of n values
Randomly permutes the values of the arguments
EXST 4087 – Introduction to SAS
Random Number
Random Number
Random Number
Random Number
Random Number
CALL RANPOI Routine
CALL RANTBL Routine
CALL RANTRI Routine
CALL RANUNI Routine
CALL STREAMINIT Routine
Random Number
Random Number
Random Number
Random Number
Random Number
Random Number
Random Number
Random Number
Random Number
Random Number
Random Number
Random Number
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
NORMAL Function
RANBIN Function
RANCAU Function
RAND Function
RANEXP Function
RANGAM Function
RANNOR Function
RANPOI Function
RANTBL Function
RANTRI Function
RANUNI Function
UNIFORM Function
ATTRC Function
ATTRN Function
CEXIST Function
CLOSE Function
CUROBS Function
DROPNOTE Function
DSNAME Function
EXIST Function
FETCH Function
SAS File I/O
FETCHOBS Function
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
GETVARC Function
GETVARN Function
IORCMSG Function
LIBNAME Function
LIBREF Function
NOTE Function
OPEN Function
PATHNAME Function
SAS File I/O
SAS File I/O
SAS File I/O
POINT Function
REWIND Function
SYSMSG Function
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
SAS File I/O
Special
Special
SYSRC Function
VARFMT Function
VARINFMT Function
VARLABEL Function
VARLEN Function
VARNAME Function
VARNUM Function
VARTYPE Function
ADDR Function
ADDRLONG Function
Special
Special
Special
CALL POKE Routine
CALL POKELONG Routine
CALL SLEEP Routine
Special
Special
Special
Special
CALL SYSTEM Routine
DIF Function
GETOPTION Function
INPUT Function
Special
Special
Special
Special
INPUTC Function
INPUTN Function
LAG Function
PEEK Function
Special
PEEKC Function
Page 10
Returns a random variate from a Poisson distribution
Returns a random variate from a tabled probability distribution
Returns a random variate from a triangular distribution
Returns a random variate from a uniform distribution
Specifies a seed value to use for subsequent random number generation by the
RAND function
Returns a random variate from a normal distribution
Returns a random variate from a binomial distribution
Returns a random variate from a Cauchy distribution
Generates random numbers from a specified distribution
Returns a random variate from an exponential distribution
Returns a random variate from a gamma distribution
Returns a random variate from a normal distribution
Returns a random variate from a Poisson distribution
Returns a random variate from a tabled probability distribution
Returns a random variate from a triangular distribution
Returns a random variate from a uniform distribution
Returns a random variate from a uniform distribution
Returns the value of a character attribute for a SAS data set
Returns the value of a numeric attribute for the specified SAS data set
Verifies the existence of a SAS catalog or SAS catalog entry
Closes a SAS data set
Returns the observation number of the current observation
Deletes a note marker from a SAS data set or an external file
Returns the SAS data set name that is associated with a data set identifier
Verifies the existence of a SAS data library member
Reads the next nondeleted observation from a SAS data set into the Data Set
Data Vector (DDV)
Reads a specified observation from a SAS data set into the Data Set Data
Vector (DDV)
Returns the value of a SAS data set character variable
Returns the value of a SAS data set numeric variable
Returns a formatted error message for _IORC_
Assigns or deassigns a libref for a SAS data library
Verifies that a libref has been assigned
Returns an observation ID for the current observation of a SAS data set
Opens a SAS data set
Returns the physical name of a SAS data library or of an external file, or returns
a blank
Locates an observation identified by the NOTE function
Positions the data set pointer at the beginning of a SAS data set
Returns the text of error messages or warning messages from the last data set or
external file function execution
Returns a system error number
Returns the format assigned to a SAS data set variable
Returns the informat assigned to a SAS data set variable
Returns the label assigned to a SAS data set variable
Returns the length of a SAS data set variable
Returns the name of a SAS data set variable
Returns the number of a variable's position in a SAS data set
Returns the data type of a SAS data set variable
Returns the memory address of a numeric variable on a 32-bit platform
Returns the memory address of a character variable on 32-bit and 64-bit
platforms
Writes a value directly into memory on a 32-bit platform
Writes a value directly into memory on 32-bit and 64-bit platforms
Suspends the execution of a program that invokes this call routine for a
specified period of time
Submits an operating environment command for execution
Returns differences between the argument and its nth lag
Returns the value of a SAS system or graphics option
Returns the value produced when a SAS expression that uses a specified
informat expression is read
Enables you to specify a character informat at run time
Enables you to specify a numeric informat at run time
Returns values from a queue
Stores the contents of a memory address into a numeric variable on a 32-bit
platform
Stores the contents of a memory address in a character variable on a 32-bit
platform
EXST 4087 – Introduction to SAS
Special
PEEKCLONG Function
Special
PEEKLONG Function
Special
PTRLONGADD Function
Special
Special
Special
Special
PUT Function
PUTC Function
PUTN Function
SLEEP Function
Special
Special
Special
Special
SYSGET Function
SYSPARM Function
SYSPROCESSID Function
SYSPROCESSNAME Function
Special
Special
SYSPROD Function
SYSTEM Function
Special
State and ZIP Code
State and ZIP Code
State and ZIP Code
State and ZIP Code
State and ZIP Code
State and ZIP Code
State and ZIP Code
UUIDGEN Function
FIPNAME Function
FIPNAMEL Function
FIPSTATE Function
STFIPS Function
STNAME Function
STNAMEL Function
ZIPCITY Function
State and ZIP Code
State and ZIP Code
State and ZIP Code
State and ZIP Code
Trigonometric
Trigonometric
Trigonometric
Trigonometric
Trigonometric
Trigonometric
Trigonometric
Truncation
ZIPFIPS Function
ZIPNAME Function
ZIPNAMEL Function
ZIPSTATE Function
ARCOS Function
ARSIN Function
ATAN Function
ATAN2 Function
COS Function
SIN Function
TAN Function
CEIL Function
Truncation
CEILZ Function
Truncation
FLOOR Function
Truncation
FLOORZ Function
Truncation
Truncation
Truncation
Truncation
FUZZ Function
INT Function
INTZ Function
ROUND Function
Truncation
ROUNDE Function
Truncation
ROUNDZ Function
Truncation
Variable Control
Variable Control
TRUNC Function
CALL LABEL Routine
CALL SET Routine
Variable Control
Variable Information
Variable Information
Variable Information
CALL VNAME Routine
CALL VNEXT Routine
VARRAY Function
VARRAYX Function
Variable Information
Variable Information
Variable Information
Variable Information
VARTRANSCODE Function
VFORMAT Function
VFORMATD Function
VFORMATDX Function
Page 11
Stores the contents of a memory address in a character variable on 32-bit and
64-bit platforms
Stores the contents of a memory address in a numeric variable on 32-bit and 64bit platforms
Returns the pointer address as a character variable on 32-bit and 64-bit
platforms
Returns a value using a specified format
Enables you to specify a character format at run time
Enables you to specify a numeric format at run time
Suspends the execution of a program that invokes this function for a specified
period of time
Returns the value of the specified operating environment variable
Returns the system parameter string
Returns the process id of the current process
Returns the process name associated with a given process id or the name of the
current process
Determines if a product is licensed
Issues an operating environment command during a SAS session and returns
the system return code
Returns the short or binary form of a Universal Unique Identifier (UUID)
Converts two-digit FIPS codes to uppercase state names
Converts two-digit FIPS codes to mixed case state names
Converts two-digit FIPS codes to two-character state postal codes
Converts state postal codes to FIPS state codes
Converts state postal codes to uppercase state names
Converts state postal codes to mixed case state names
Returns a city name and the two-character postal code that corresponds to a ZIP
code
Converts ZIP codes to two-digit FIPS codes
Converts ZIP codes to uppercase state names
Converts ZIP codes to mixed case state names
Converts ZIP codes to two-character state postal codes
Returns the arccosine
Returns the arcsine
Returns the arc tangent
Returns the arc tangent of two numeric variables
Returns the cosine
Returns the sine
Returns the tangent
Returns the smallest integer that is greater than or equal to the argument, fuzzed
to avoid unexpected floating-point results
Returns the smallest integer that is greater than or equal to the argument, using
zero fuzzing
Returns the largest integer that is less than or equal to the argument, fuzzed to
avoid unexpected floating-point results
Returns the largest integer that is less than or equal to the argument, using zero
fuzzing
Returns the nearest integer if the argument is within 1E-12
Returns the integer value, fuzzed to avoid unexpected floating-point results
Returns the integer portion of the argument, using zero fuzzing
Rounds the first argument to the nearest multiple of the second argument, or to
the nearest integer when the second argument is omitted
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
Rounds the first argument to the nearest multiple of the second argument, with
zero fuzzing
Truncates a numeric value to a specified length
Assigns a variable label to a specified character variable
Links SAS data set variables to DATA step or macro variables that have the
same name and data type
Assigns a variable name as the value of a specified variable
Returns the name, type, and length of a variable that is used in a DATA step
Returns a value that indicates whether the specified name is an array
Returns a value that indicates whether the value of the specified argument is an
array
Returns the transcode attribute of a SAS data set variable
Returns the format that is associated with the specified variable
Returns the format decimal value that is associated with the specified variable
Returns the format decimal value that is associated with the value of the
specified argument
EXST 4087 – Introduction to SAS
Variable Information
Variable Information
VFORMATN Function
VFORMATNX Function
Variable Information
Variable Information
VFORMATW Function
VFORMATWX Function
Variable Information
Variable Information
VFORMATX Function
VINARRAY Function
Variable Information
VINARRAYX Function
Variable Information
Variable Information
Variable Information
VINFORMAT Function
VINFORMATD Function
VINFORMATDX Function
Variable Information
Variable Information
VINFORMATN Function
VINFORMATNX Function
Variable Information
Variable Information
VINFORMATW Function
VINFORMATWX Function
Variable Information
Variable Information
Variable Information
Variable Information
Variable Information
VINFORMATX Function
VLABEL Function
VLABELX Function
VLENGTH Function
VLENGTHX Function
Variable Information
Variable Information
Variable Information
VNAME Function
VNAMEX Function
VTRANSCODE Function
Variable Information
VTRANSCODEX Function
Variable Information
Variable Information
Variable Information
Variable Information
VTYPE Function
VTYPEX Function
VVALUE Function
VVALUEX Function
Web Tools
HTMLDECODE Function
Web Tools
HTMLENCODE Function
Web Tools
Web Tools
URLDECODE Function
URLENCODE Function
Page 12
Returns the format name that is associated with the specified variable
Returns the format name that is associated with the value of the specified
argument
Returns the format width that is associated with the specified variable
Returns the format width that is associated with the value of the specified
argument
Returns the format that is associated with the value of the specified argument
Returns a value that indicates whether the specified variable is a member of an
array
Returns a value that indicates whether the value of the specified argument is a
member of an array
Returns the informat that is associated with the specified variable
Returns the informat decimal value that is associated with the specified variable
Returns the informat decimal value that is associated with the value of the
specified argument
Returns the informat name that is associated with the specified variable
Returns the informat name that is associated with the value of the specified
argument
Returns the informat width that is associated with the specified variable
Returns the informat width that is associated with the value of the specified
argument
Returns the informat that is associated with the value of the specified argument
Returns the label that is associated with the specified variable
Returns the variable label for the value of the specified argument
Returns the compile-time (allocated) size of the specified variable
Returns the compile-time (allocated) size for the value of the specified
argument
Returns the name of the specified variable
Validates the value of the specified argument as a variable name
Returns a value that indicates whether transcoding is on or off for the specified
character variable
Returns a value that indicates whether transcoding is on or off for the specified
argument
Returns the type (character or numeric) of the specified variable
Returns the type (character or numeric) for the value of the specified argument
Returns the formatted value that is associated with the variable that you specify
Returns the formatted value that is associated with the argument that you
specify
Decodes a string containing HTML numeric character references or HTML
character entity references and returns the decoded string
Encodes characters using HTML character entity references and returns the
encoded string
Returns a string that was decoded using the URL escape syntax
Returns a string that was encoded using the URL escape syntax