42
Categories and Descriptions of Data Category Data Set Option Syntax Description ENCRYPT=YES | NO GENNUM=integer Data Set Control ALTER= ALTER=alter- password Assigns an alter password to a SAS file and enables access to a password-protected SAS file. Alter-password must be a SAS name. BUFNO= BUFNO=number-of- buffers Specifies the number of buffers for processing a SAS data set. Specifies a value from 1 to the maximum number of buffers available in your operating environment. BUFSIZE= BUFSIZE=number- of-bytes specifies the minimum number of bytes in a page in the data set. The number of bytes can have a value from 0, the system default, to the maximum value allowed by your operating environment. If the value is 0, SAS chooses an operating environment default that is optimal for the SAS data set. If any value you specify is not adequate, SAS automatically rounds up to the next buffer size for the data set. CNTLLEV= CNTLLEV=LIB | MEM | REC LIB: controls concurrent access at the library level. Library-level control restricts concurrent access to only one update process to the library. MEM: controls concurrent access at the SAS data set (or member) level. Member-level control restricts concurrent access to only one update or output process but allows read access to many sessions, procedures, or statements. REC: controls concurrent access at the observation (or record) level. Record-level control allows more than one update access to the same SAS data set, but it denies concurrent update of the same observation. COMPRESS= COMPRESS= YES | NO | CHAR | BINARY YES | CHAR: pecifies that the observations in a newly created SAS output data set are compressed (variable-length records). NO: specifies that the observations in a newly created SAS data set are uncompressed (fixed-length records). BINARY: specifies that observations in a newly created SAS output data set are compressed. DLDMGACTION= DLDMGACTION=FAIL | ABORT | REPAIR | PROMPT FAIL: stops the step, issues an error message to the log immediately. This is the default for batch mode. ABORT: terminates the step, issues an error message to the log, and aborts the SAS session. REPAIR: automatically repairs and rebuilds indexes and integrity constraints. It issues a warning message to the log. This is the default for interactive mode. PROMPT: displays a requestor window that asks you to select the FAIL, ABORT, or REPAIR action. ENCRYPT= YES: encrypts the file. The encryption method uses passwords. At a minimum, you must specify the READ= or the PW= data set option at the same time that you specify ENCRYPT=YES. Because the encryption method uses passwords, you cannot change any password on an encrypted data set without re-creating the data set. NO: does not encrypt the file. GENMAX= GENMAX=number-of- generations equests generations for a data set and specifies the maximum number of versions to maintain. The value can be from 0 to 1000. The default is GENMAX=0, which means that generations is not in effect. GENNUM= is a number that references a specific version from a generation group. Specifying a positive number is an absolute reference to a specific version number that is appended to a data set's name. Specifying a negative number is a relative reference to a version in relation to the base version, from the youngest to the oldest. A value of 0 refers to the current (base) version. Specify an asterisk for integer when you rename the entire generation group for a data set. INDEX= INDEX=(index- specification- 1 ...<index- names and describes a simple or a composite index to be built. Index-specification has this form:

SAS - Useful Spread Sheet

  • Upload
    vkeyur

  • View
    590

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SAS - Useful Spread Sheet

Categories and Descriptions of Data Set Options

Category Data Set Option Syntax Description

Data Set Control

GENNUM=integer

ALTER= ALTER=alter-password

Assigns an alter password to a SAS file and enables access to a password-protected SAS file. Alter-password must be a SAS name.

BUFNO= BUFNO=number-of-buffers

Specifies the number of buffers for processing a SAS data set. Specifies a value from 1 to the maximum number of buffers available in your operating environment.

BUFSIZE= BUFSIZE=number-of-bytes

specifies the minimum number of bytes in a page in the data set. The number of bytes can have a value from 0, the system default, to the maximum value allowed by your operating environment. If the value is 0, SAS chooses an operating environment default that is optimal for the SAS data set. If any value you specify is not adequate, SAS automatically rounds up to the next buffer size for the data set.

CNTLLEV= CNTLLEV=LIB | MEM | REC

LIB: controls concurrent access at the library level. Library-level control restricts concurrent access to only one update process to the library.

MEM: controls concurrent access at the SAS data set (or member) level. Member-level control restricts concurrent access to only one update or output process but allows read access to many sessions, procedures, or statements.

REC: controls concurrent access at the observation (or record) level. Record-level control allows more than one update access to the same SAS data set, but it denies concurrent update of the same observation.

COMPRESS= COMPRESS= YES | NO | CHAR |

BINARY

YES | CHAR: pecifies that the observations in a newly created SAS output data set are compressed (variable-length records).

NO: specifies that the observations in a newly created SAS data set are uncompressed (fixed-length records).

BINARY: specifies that observations in a newly created SAS output data set are compressed.

DLDMGACTION= DLDMGACTION=FAIL | ABORT |

REPAIR | PROMPT

FAIL: stops the step, issues an error message to the log immediately. This is the default for batch mode.

ABORT: terminates the step, issues an error message to the log, and aborts the SAS session.

REPAIR: automatically repairs and rebuilds indexes and integrity constraints. It issues a warning message to the log. This is the default for interactive mode.

PROMPT: displays a requestor window that asks you to select the FAIL, ABORT, or REPAIR action.

ENCRYPT= ENCRYPT=YES | NO

YES: encrypts the file. The encryption method uses passwords. At a minimum, you must specify the READ= or the PW= data set option at the same time that you specify ENCRYPT=YES. Because the encryption method uses passwords, you cannot change any password on an encrypted data set without re-creating the data set.

NO: does not encrypt the file.

GENMAX= GENMAX=number-of-generations

equests generations for a data set and specifies the maximum number of versions to maintain. The value can be from 0 to 1000. The default is GENMAX=0, which means that generations is not in effect.

GENNUM= is a number that references a specific version from a generation group. Specifying a positive number is an absolute reference to a specific version number that is appended to a data set's name. Specifying a negative number is a relative reference to a version in relation to the base version, from the youngest to the oldest. A value of 0 refers to the current (base) version. Specify an asterisk for integer when you rename the entire generation group for a data set.

INDEX= INDEX=(index-specification-1 ...<index-specification-n>)

names and describes a simple or a composite index to be built. Index-specification has this form:

index: is the name of a variable that forms the index or the name you choose for a composite index.

Page 2: SAS - Useful Spread Sheet

LABEL='label'

PW=password

PWREQ=YES|NO

REUSE=NO | YES

TOBSNO=n

TYPE=data-set-type Specifies the data set type for a specially structured SAS data set

Miscellaneous

INDEX=

index <= (variable(s)) > </UNIQUE> </NOMISS>

UNIQUE: specifies that the values of the key variables must be unique. If you specify UNIQUE for a new data set and multiple observations have the same values for the index variables, the index is not created. A slash (/) must precede the UNIQUE option.

NOMISS: excludes all observations with missing values from the index. Observations with missing values are still read from the data set but not through the index. A slash (/) must precede the NOMISS option.

LABEL= It is a text string of up to 256 characters. If the label text contains single quotation marks, use double quotation marks around the label, or use two single quotation marks in the label text and surround the string with single quotation marks. To remove a label from a data set, assign a label that is equal to a blank that is enclosed in quotation marks.

OUTREP= OUTREP=format-type

specifies the requirements vector for the output file. For example, specify OUTREP=PC_ANSI if you want a file in PC format with characters that are encoded in ANSI ASCII

PW= The PW= option applies to all types of SAS files except catalogs. You can use this option to assign a password to a SAS file or to access a password-protected SAS file.

PWREQ= YES: specifies that a requestor window appear.

NO: prevents a requestor window from appearing. If a missing or invalid password is entered, the data set is not opened and an error message is written to the SAS log.

READ= READ=read-password

The READ= option applies to all types of SAS files except catalogs. You can use this option to assign a read-password to a SAS file or to access a read-protected SAS file.

REPEMPTY= REPEMPTY=YES | NO

YES: specifies that a new empty data set with a given name replaces an existing data set with the same name. This is the default. When REPEMPTY=YES and REPLACE=NO, then the data set is not replaced.

NO: specifies that a new empty data set with a given name does not replace an existing data set with the same name.

REPLACE= REPLACE=NO | YES

NO: specifies that a new data set with a given name does not replace an existing data set with the same name.

YES: specifies that a new data set with a given name replaces an existing data set with the same name.

REUSE= NO: does not track and reuse space in compressed data sets. New observations are appended to the existing data set. Specifying the NO argument results in less efficient data storage if you delete or update many observations in the SAS data set.

YES: racks and reuses space in compressed SAS data sets. New observations are inserted in the space that is freed when other observations are updated or deleted.

SORTEDBY= SORTEDBY=by-clause </ collate-name> | _NULL_

by-clause < / collate-name>: indicates how the data are currently sorted.

by-clause: are the variables and options that you use in a BY statement in a PROC SORT step.

collate-name: names the collating sequence that is used for the sort. By default, the collating sequence is that of your operating environment. A slash (/) must precede the collating sequence.

_NULL_: removes any existing sort information.

TOBSNO= Specifies the number of observations to be transmitted in each multi-observation exchange with a SAS server

TRANTAB= TRANTAB=table-name

specifies the name of a translation table that is used to translate the characters in a data set from foreign encoding to local encoding. SAS searches for translation tables in SASUSER.PROFILE first and then SASUSER.HOST.

TYPE=

WRITE= WRITE=write-password

The WRITE= option applies to all types of SAS files except catalogs. You can use this option to assign a write-password to a SAS file or to access a write-protected SAS file.

FILECLOSE= FILECLOSE=DISP | LEAVE | REREAD | REWIND

DISP: positions the tape volume according to the disposition specified in the operating environment's control language

LEAVE: positions the tape at the end of the file that was just processed. Use FILECLOSE=LEAVE if you are not repeatedly accessing the same files in a SAS program but you are accessing one or more subsequent SAS files on the same tape.

REREAD: positions the tape volume at the beginning of the file that was just processed. Use FILECLOSE=REREAD if you are accessing the same SAS data set on tape several times in a SAS program.

REWIND: rewinds the tape volume to the beginning. Use FILECLOSE=REWIND if you are accessing one or more previous SAS files on the same tape, but you are not repeatedly accessing the same files in a SAS program.

Page 3: SAS - Useful Spread Sheet

FIRSTOBS=n

IN=variable

OBS=n|MAX

Variable Control DROP=variable(s)

KEEP=variable(s)

Changes the name of a variable

Observation Control

FIRSTOBS= n is a positive integer that is less than or equal to the number of observations in the data set.

IN= variable: names the new variable whose value indicates whether that input data set contributed data to the current observation. Within the DATA step, the value of the variable is 1 if the data set contributed to the current observation, and 0 otherwise.

OBS= n specifies a positive integer that is less than or equal to the number of observations in the data set or zero.

MAX represents the total number of observations in the data set.

POINTOBS= POINTOBS= YES | NO

Controls whether a compressed data set may be processed with random access (by observation number) rather than sequential access only

WHERE= WHERE=(where-expression)

where-expression is an arithmetic or logical expression that consists of a sequence of operators, operands, and SAS functions. The expression must be enclosed in parentheses.

WHEREUP= WHEREUP= NO | YES

NO: does not evaluate added observations and modified observations against a WHERE expression.

YES: evaluates added observations and modified observations against a WHERE expression.

User Control of SAS Index

Usage

IDXNAME= IDXNAME=index-name

index-name:specifies the name (up to 32 characters) of a simple or composite index for the SAS data set. SAS does not attempt to determine if the specified index is the best one or if a sequential search might be more resource-efficient.

IDXWHERE= IDXWHERE=YES|NO

YES: tells SAS to choose the best index to optimize a WHERE expression, and to disregard the possibility that a sequential search of the data set might be more resource-efficient.

NO: tells SAS to ignore all indexes and satisfy the conditions of a WHERE expression with a sequential search of the data set.

DROP= Variable(s): lists one or more variable names. You can list the variables in any form that SAS allows

KEEP= Variable: lists one or more variable names. You can list the variables in any form that SAS allows.

RENAME= RENAME=(old-name-1=new-name-1 < . . . old-name-n=new-name-n>)

Page 4: SAS - Useful Spread Sheet

Categories and Descriptions of Data Set Options

Example

Example: This example creates an encrypted SAS data set: data salary(encrypt=yes read=green); input name $ yrsal bonuspct; datalines;Muriel 34567 3.2Bjorn 74644 2.5Freda 38755 4.1Benny 29855 3.5Agnetha 70998 4.1;

To use this data set, specify the read password: proc contents data=salary(read=green);run;

Example 1: Requesting Generations When You Create a Data Set, This example shows how to request generations for a new data set. The DATA step creates a data set namedWORK.A that can have as many as 10 generations (one current version and nine historical versions):data a(genmax=10); x=1; output;run;

Example 2: Modifying the Number of Generations on an Existing Data Set, This example shows how to change the number of generations on the data set MYLIB.A to 4:proc datasets lib=mylib; modify a(genmax=4);run;

Example 1: Defining a Simple Index The following INDEX= data set option defines a simple index for the SSN variable: data new(index=(ssn));

Example 2: Defining a Composite Index, The following INDEX= data set option defines a composite index named CITYST that uses the CITY and STATE variables: data new(index=(cityst=(city state)));

Page 5: SAS - Useful Spread Sheet

Example 3: Defining a Simple and a Composite Index, The following INDEX= data set option defines a simple index for SSN and a composite index for CITY and STATE: data new(index=(ssn cityst=(city state)));

Example: These examples assign labels to data sets: data w2(label='1976 W2 Info, Hourly'); data new(label='Peter''s List'); data new(label="Hillside's Daily Account"); data sales(label='Sales For May(NE)');

If you plan to use procedures that add observations to the end of SAS data sets (for example, the APPEND and FSEDIT procedures) with compressed data sets, use the REUSE=NO argument. REUSE=YES causes new observations to be added wherever there is space in the file, not necessarily at the end of the file.

This example uses the SORTEDBY= data set option to specify how the data are currently sorted. The data set ORDERS is sorted by PRIORITY and by the descending values of INDATE. Once the data set is created, the sort information is stored with it. These statements create the data set ORDERS and record the sort information: libname mylib 'SAS-data-library';options yearcutoff=1920;data mylib.orders(sortedby=priority descending indate); input priority 1. +1 indate date7. +1 office $ code $; format indate date7.; datalines;1 03may01 CH J8U1 21mar01 LA M911 01dec00 FW L6R1 27feb99 FW Q2A2 15jan00 FW I9U2 09jul99 CH P3Q3 08apr99 CH H5T3 31jan99 FW D2W;

Page 6: SAS - Useful Spread Sheet

This PROC step prints the data set STUDY beginning with observation 20: proc print data=study(firstobs=20);run; This SET statement uses both FIRSTOBS= and OBS= to read only observations 5 through 10 from the data set STUDY. Data set NEW contains six observations. data new; set study(firstobs=5 obs=10);run;

Example: In this example, IN= creates a new variable, OVERSEAS, that denotes international flights. The variable I has a value of 1 when the observation is read from the NONUSA data set; otherwise, it has a value of 0. The IF-THEN statement checks the value of I to determine if the data set NONUSA contributed data to the current observation. If I=1, the variable OVERSEAS receives an asterisk (*) as a value. data allflts; set usa nonusa(in=i); by fltnum; if i then overseas='*';run;

Example: In this example, the OBS= data set option in the SET statement reads in the first ten observations from data set OLD: data new; set old(obs=10);run; This statement prints only observations 5 through 10 in data set STUDY: proc print data=study(firstobs=5 obs=10);

Example 1: Accepting Updates That Do Not Match the WHERE expression, This example shows how WHEREUP= permits observations to be updated and added even though the modified observation does not match the WHERE expression: data a; x=1; output; x=2; output;run;

data a; modify a(where=(x=1) whereup=no);Example 1: Using a Specific Index, This example uses the IDXNAME= data set option to direct SAS to use a specific index to optimize the WHERE expression. SAS then disregards the possibility that a sequential search of the data set might be more resource-efficient and does not attempt to determine if the specified index is the best one data mydata.empnew; set mydata.employee (idxname=empnum); where empnum < 2000;

Example 1: Specifying Index Usage This example uses the IDXWHERE= data set option to tell SAS to decide which index is the best to optimize the WHERE expression. SAS then disregards the possibility that a sequential search of the data set might be more resource-efficient: data mydata.empnew; set mydata.employee (idxwhere=yes); where empnum < 2000;

Example 1: Excluding Variables from Input, In this example, the variables SALARY and GENDER are not included in processing and they are not written to either output data set: data plan1 plan2; set payroll(drop=salary gender); if hired<'01jan98'd then output plan1; else output plan2;run; You cannot use SALARY or GENDER in any logic in the DATA step because DROP= prevents the SET statement from reading them from PAYROLL. Example 2: Processing Variables without Writing Them to a Data Set, In this example, SALARY and GENDER are not written to PLAN2, but they are written to PLAN1: data plan1 plan2(drop=salary gender); set payroll; if hired<'01jan98'd then output plan1; else output plan2;run;

Example: In this example, only IDNUM and SALARY are read from PAYROLL, and they are the only variables in PAYROLL that are available for processing: data bonus; set payroll(keep=idnum salary); bonus=salary*1.1;run;

Example 1: Renaming a Variable at Time of Output This example uses RENAME= in the DATA statement to show that the variable is renamed at the time it is written to the output data set. The variable keeps its original name, X, during the DATA step processing: data two(rename=(x=keys)); set one; z=x+y; run; Example 2: Renaming a Variable at Time of Input, This example renames variable X to a variable named KEYS in the SET statement, which is a rename before DATA step processing. KEYS, not X, is the name to use for the variable for DATA step processing. data three; set one(rename=(x=keys)); z=keys+y;run;

Page 7: SAS - Useful Spread Sheet

Categories and Descriptions of Formats

Category Format Description

Character Converts native format character data to ASCII representation

Converts character data to binary representation

Writes standard character data

Converts native format character data to EBCDIC representation

Converts character data to hexadecimal representation

Writes character data in uppercase when the MSGCASE system option is in effect

Converts character data to octal representation

Writes data values that are enclosed in double quotation marks

Writes character data in reverse order and preserves blanks

Writes character data in reverse order and left aligns

Converts character data to uppercase

Writes character data of varying length

Writes standard character data

DBCS Adds shift-code data to DBCS data

Removes shift code data from DBCS data

Date and Time

Writes date values as the day of the month

Writes date values as the name of the day of the week

Writes international date values as the day of the week

Writes international date values as the name of the day

Writes international date values as the name of the month

Writes time values as hours and decimal fractions of hours

Writes date values as the Julian day of the year

Writes time values as the number of minutes and seconds since midnight

Writes date values as the month and the year and separates them with a character

Writes date values as the name of the month

Writes date values as the month of the year

Writes date values as the quarter of the year

Writes date values as the quarter of the year in Roman numerals

$ASCIIw.

$BINARYw.

$CHARw.

$EBCDICw.

$HEXw.

$MSGCASEw.

$OCTALw.

$QUOTEw.

$REVERJw.

$REVERSw.

$UPCASEw.

$VARYINGw.

$w.

$KANJIw.

$KANJIXw.

DATEw. Writes date values in the form ddmmmyy or ddmmmyyyy

DATEAMPMw.d Writes datetime values in the form ddmmmyy:hh:mm:ss.ss with AM or PM

DATETIMEw.d Writes datetime values in the form ddmmmyy:hh:mm:ss.ss

DAYw.

DDMMYYw. Writes date values in the form ddmmyy or ddmmyyyy

DDMMYYxw. Writes date values in the form ddmmyy or ddmmyyyy with a specified separator

DOWNAMEw.

EURDFDDw. Writes international date values in the form dd.mm.yy or dd.mm.yyyy

EURDFDEw. Writes international date values in the form ddmmmyy or ddmmmyyyy

EURDFDNw.

EURDFDTw.d Writes international datetime values in the form ddmmmyy:hh:mm:ss.ss or ddmmmyyyy hh:mm:ss.ss

EURDFDWNw.

EURDFMNw.

EURDFMYw. Writes international date values in the form mmmyy or mmmyyyy

EURDFWDXw. Writes international date values as the name of the month, the day, and the year in the form dd month-name yy (or yyyy )

EURDFWKXw. Writes international date values as the name of the day and date in the form day-of-week, dd month-name yy (or yyyy)

HHMMw.d Writes time values as hours and minutes in the form hh:mm

HOURw.d

JULDAYw.

JULIANw. Writes date values as Julian dates in the form yyddd or yyyyddd

MINGUOw. Writes date values as Taiwanese dates in the form yyymmdd

MMDDYYw. Writes date values in the form mmddyy or mmddyyyy

MMDDYYxw. Writes date values in the form mmddyy or mmddyyyy with a specified separator

MMSSw.d

MMYYxw.

MONNAMEw.

MONTHw.

MONYYw. Writes date values as the month and the year in the form mmmyy or mmmyyyy

NENGOw. Writes date values as Japanese dates in the form e.yymmdd

PDJULGw. Writes packed Julian date values in the hexadecimal format yyyydddF for IBM

PDJULIw. Writes packed Julian date values in the hexadecimal format ccyydddF for IBM

QTRw.

QTRRw.

TIMEw.d Writes time values as hours, minutes, and seconds in the form hh:mm:ss.ss

TIMEAMPMw.d Writes time values as hours, minutes, and seconds in the form hh:mm:ss.ss with AM or PM

TODw.d Writes the time portion of datetime values in the form hh:mm:ss.ss

Page 8: SAS - Useful Spread Sheet

Date and Time

Writes date values as the day of the week

Writes date values as the year

Writes date values as the year and month and separates them with a character

Writes date values as the year and the month abbreviation

Writes date values as the year and the quarter and separates them with a character

Writes date values as the year and the quarter in Roman numerals and separates them with characters

Numeric SAS chooses the best notation

Converts numeric values to binary representation

Writes numeric values with commas and decimal points

Writes numeric values with periods and commas

Prints variables, possibly with a great range of values, lining up decimal places for values of similar magnitude

Writes numeric values with dollar signs, commas, and decimal points

Writes numeric values with dollar signs, periods, and commas

Writes numeric values in scientific notation

Converts numeric values to fractions

Converts real binary (floating-point) values to hexadecimal representation

Writes native integer binary (fixed-point) values, including negative values

Writes integer binary (fixed-point) values in Intel and DEC formats

Writes negative numeric values in parentheses

Writes numeric values with a comma in place of the decimal point

Converts numeric values to octal representation

Writes data in packed decimal format

Writes numeric values as percentages

Writes positive integer binary (fixed-point) values

Writes positive integer binary (fixed-point) values in Intel and DEC formats

Writes data in unsigned packed decimal format

Writes real binary data (floating-point) in real binary format

Writes numeric values as Roman numerals

Writes Social Security numbers

Writes native standard numeric data in IBM mainframe format

Writes integer binary (fixed-point) values, including negative values, in IBM mainframe format

Writes unsigned integer binary (fixed-point) values in IBM mainframe format

Writes packed decimal data in IBM mainframe format

Writes unsigned packed decimal data in IBM mainframe format

Writes positive integer binary (fixed-point) values in IBM mainframe format

Writes real binary (floating-point) data in IBM mainframe format

Writes zoned decimal data in IBM mainframe format

Writes zoned decimal leading sign data in IBM mainframe format

Writes zoned decimal separate leading-sign data in IBM mainframe format

Writes zoned decimal separate trailing-sign data in IBM mainframe format

Writes unsigned zoned decimal data in IBM mainframe format

Writes standard numeric data one digit per byte

Writes numeric values as words with fractions that are shown numerically

Writes numeric values as words

WEEKDATEw. Writes date values as the day of the week and the date in the form day-of-week, month-name dd, yy (or yyyy)

WEEKDATXw. Writes date values as day of week and date in the form day-of-week, dd month-name yy (or yyyy)

WEEKDAYw.

WORDDATEw. Writes date values as the name of the month, the day, and the year in the form month-name dd, yyyy

WORDDATXw. Writes date values as the day, the name of the month, and the year in the form dd month-name yyyy

YEARw.

YYMMxw.

YYMMDDw. Writes date values in the form yymmdd or yyyymmdd

YYMMDDxw. Writes date values in the form yymmdd or yyyymmdd with a specified separator

YYMONw.

YYQxw.

YYQRxw.

BESTw.

BINARYw.

COMMAw.d

COMMAXw.d

Dw.s

DOLLARw.d

DOLLARXw.d

Ew.

FLOATw.d Generates a native single-precision, floating-point value by multiplying a number by 10 raised to the dth power

FRACTw.

HEXw.

IBw.d

IBRw.d

IEEEw.d Generates an IEEE floating-point value by multiplying a number by 10 raised to the dth power

NEGPARENw.d

NUMXw.d

OCTALw.

PDw.d

PERCENTw.d

PIBw.d

PIBRw.d

PKw.d

PVALUEw.d Writes p-values

RBw.d

ROMANw.

SSNw.

S370FFw.d

S370FIBw.d

S370FIBUw.d

S370FPDw.d

S370FPDUw.d

S370FPIBw.d

S370FRBw.d

S370FZDw.d

S370FZDLw.d

S370FZDSw.d

S370FZDTw.d

S370FZDUw.d

w.d

WORDFw.

WORDSw.

Page 9: SAS - Useful Spread Sheet

Numeric

Writes numeric values with yen signs, commas, and decimal points

Writes standard numeric data with leading 0s

Writes numeric data in zoned decimal format

YENw.d

Zw.d

ZDw.d

Page 10: SAS - Useful Spread Sheet

Functions and CALL Routines by Category

Category Description

Array 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

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

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

Parses a pattern and returns a value

Character Returns one character in the ASCII or the EBCDIC collating sequence

Returns an ASCII or EBCDIC collating sequence character string

Removes multiple blanks from a character string

Removes specific characters from a character string

Removes quotation marks from a character value

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 an argument

Converts all letters in an argument to lowercase

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

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

Encodes a string to facilitate searching

Replaces character value contents

Extracts a substring from an argument

Replaces specific characters in a character expression

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

Converts all letters in an argument to uppercase

Returns the position of the first character that is unique to an expression

DBCS 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

Searches a character expression for a string of characters

Searches a character expression for specific characters

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 given word from a character expression

Concatenates two or more character strings

Extracts a substring from an argument

Extracts a substring from an argument based on byte position

Functions and CALL Routine

DIM

HBOUND

LBOUND

Bitwise Logical Operations

BAND

BLSHIFT

BNOT

BOR

BRSHIFT

BXOR

Character String Matching

CALL RXCHANGE

CALL RXFREE

CALL RXSUBSTR

RXMATCH

RXPARSE

BYTE

COLLATE

COMPBL

COMPRESS

DEQUOTE

INDEX

INDEXC

INDEXW

LEFT

LENGTH

LOWCASE

MISSING

QUOTE

RANK

REPEAT

REVERSE

RIGHT

SCAN

SOUNDEX

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

SUBSTR (left of =)

SUBSTR (right of =)

TRANSLATE

TRANWRD

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

VERIFY

KCOMPARE

KCOMPRESS

KCOUNT

KINDEX

KINDEXC

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

KLENGTH

KLOWCASE

KREVERSE

KRIGHT

KSCAN

KSTRCAT

KSUBSTR

KSUBSTRB

Page 11: SAS - Useful Spread Sheet

DBCS

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 character value contents based on byte unit

Returns the position of the first character that is unique to an expression

Date and Time 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 number of time intervals in a given time span

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

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 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 kurtosis

Returns the largest value

Returns the arithmetic mean (average)

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

Returns the range of values

Returns the skewness

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

External Files Closes a directory that was opened by the DOPEN function and returns a value

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 and returns a value

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

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

KTRANSLATE

KTRIM

KTRUNCATE

KUPCASE

KUPDATE

KUPDATEB

KVERIFY

DATDIF

DATE

DATEJUL

DATEPART

DATETIME

DAY

DHMS

HMS

HOUR

INTCK

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

JULDATE

JULDATE7

MDY

MINUTE

MONTH

QTR

SECOND

TIME

TIMEPART

TODAY

WEEKDAY

YEAR

YRDIF

YYQ

Descriptive Statistics

CSS

CV

KURTOSIS

MAX

MEAN

MIN

MISSING

N

NMISS

ORDINAL

RANGE

SKEWNESS

STD

STDERR

SUM

USS

VAR

DCLOSE

DINFO

DNUM

DOPEN

DOPTNAME

DOPTNUM

DREAD

DROPNOTE

FAPPEND

FCLOSE

Page 12: SAS - Useful Spread Sheet

External Files

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 and returns a value

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

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

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

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 and returns a value

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

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

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

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

Writes a record to an external file and returns a value

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

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

Returns a system error number

External Routines 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

Financial Returns compound interest parameters

Returns the convexity for an enumerated cashflow

Returns the convexity for a periodic cashflow 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 cashflow

Returns the modified duration for a periodic cashflow 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 cashflow stream, such as a bond

Returns the future value of a periodic saving

Returns the yield-to-maturity for a periodic cashflow stream, such as a bond

Hyperbolic Returns the hyperbolic cosine

Returns the hyperbolic sine

Returns the hyperbolic tangent

Macro Resolves an argument and issues the resolved value for execution

Assigns DATA step information to a macro variable

FCOL

FDELETE

FEXIST

FGET

FILEEXIST

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

FILEREF

FINFO

FNOTE

FOPEN

FOPTNAME

FOPTNUM

FPOINT

FPOS

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

FREWIND

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

FSEP

FWRITE

MOPEN

PATHNAME

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

SYSRC

CALL MODULE

CALL MODULEI

MODULEC

MODULEIC

MODULEIN

MODULEN

COMPOUND

CONVX

CONVXP

DACCDB

DACCDBSL

DACCSL

DACCSYD

DACCTAB

DEPDB

DEPDBSL

DEPSL

DEPSYD

DEPTAB

DUR

DURP

INTRR

IRR

MORT

NETPV

NPV

PVP

SAVING

YIELDP

COSH

SINH

TANH

CALL EXECUTE

CALL SYMPUT

Page 13: SAS - Useful Spread Sheet

Macro

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

Returns the value of a macro variable during DATA step execution

Mathematical Returns the absolute value

Returns the value of the airy function

Returns the noncentrality parameter from a chi-squared distribution

Computes some machine and mathematical constants and returns a value

Returns the derivative of the airy function

Computes the deviance and returns a value

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 and returns a value

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 remainder value

Returns the sign of a value

Returns the square root of a value

Returns the value of the TRIGAMMA function

Probability Computes cumulative distribution functions

Computes the logarithm of a probability (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 and returns a value

Returns the probability from a chi-squared distribution

Returns the probability from a gamma distribution

Returns the probability from a hypergeometric distribution

Returns the probability from a negative binomial distribution

Returns the probability from the standard normal distribution

Computes a survival function

Quantile Returns a quantile from the beta distribution

Returns a quantile from the chi-squared distribution

Returns a quantile from the gamma distribution

Returns a quantile from the standard normal distribution

Random Number 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

Returns a random variate from a Poisson distribution

Returns a random variate from a tabled probability distribution

RESOLVE

SYMGET

ABS

AIRY

CNONCT

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

CONSTANT

DAIRY

DEVIANCE

DIGAMMA

ERF

ERFC

EXP

FACT

FNONCT

GAMMA

IBESSEL

JBESSEL

LGAMMA

LOG

LOG10

LOG2

MOD

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

SIGN

SQRT

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

TRIGAMMA

CDF

LOGPDF

LOGSDF

PDF

POISSON

PROBBETA

PROBBNML

PROBBNRM

PROBCHI

PROBF Returns the probability from an F distribution

PROBGAM

PROBHYPR

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

PROBNEGB

PROBNORM

PROBT Returns the probability from a t distribution

SDF

BETAINV

CINV

FINV Returns a quantile from the F distribution

GAMINV

PROBIT

TINV Returns a quantile from the t distribution

CALL RANBIN

CALL RANCAU

CALL RANEXP

CALL RANGAM

CALL RANNOR

CALL RANPOI

CALL RANTBL

Page 14: SAS - Useful Spread Sheet

Random Number

Returns a random variate from a triangular distribution

Returns a random variate from a uniform distribution

Returns a random variate from a normal 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

Returns a random variate from a Poisson distribution

Returns a random variate from a tabled probability

Random variate from a triangular distribution

Returns a random variate from a uniform distribution

Random variate from a uniform distribution

SAS File I/O 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 and returns a value

Closes a SAS data set and returns a value

Returns the observation number of the current observation

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

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

Verifies the existence of a SAS data library member

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 and returns a value

Verifies that a libref has been assigned and returns a value

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

Opens a SAS data set and returns a value

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 and returns a value

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

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

Special Returns the memory address of a variable

Writes a value directly into memory

Submits an operating environment command for execution

Returns the value of a SAS system or graphics option

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

Stores the contents of a memory address into a character variable

Writes a value directly into memory

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

Returns the value of the specified operating environment variable

CALL RANTRI

CALL RANUNI

NORMAL

RANBIN

RANCAU

RANEXP

RANGAM

RANNOR

RANPOI

RANTBL

RANTRI

RANUNI

UNIFORM

ATTRC

ATTRN

CEXIST

CLOSE

CUROBS

DROPNOTE

DSNAME

EXIST

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

GETVARN

IORCMSG

LIBNAME

LIBREF

NOTE

OPEN

PATHNAME

POINT

REWIND

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

SYSRC

VARFMT

VARINFMT

VARLABEL

VARLEN

VARNAME

VARNUM

VARTYPE

ADDR

CALL POKE

CALL SYSTEM

DIF Returns differences between the argument and its nth lag

GETOPTION

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

INPUTC

INPUTN

LAG

PEEK

PEEKC

POKE

PUT

PUTC

PUTN

SYSGET

Page 15: SAS - Useful Spread Sheet

Special

Returns the system parameter string

Determines if a product is licensed

Issues an operating environment command during a SAS session

State and ZIP Code Converts FIPS codes to uppercase state names

Converts FIPS codes to mixed case state names

Converts FIPS codes to two-character 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

Converts ZIP codes to FIPS state codes

Converts ZIP codes to uppercase state names

Converts ZIP codes to mixed case state names

Converts ZIP codes to state postal codes

Trigonometric Returns the arccosine

Returns the arcsine

Returns the arctangent

Returns the cosine

Returns the sine

Returns the tangent

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

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

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

Returns the integer value

Rounds to the nearest round-off unit

Truncates a numeric value to a specified length

Variable Control Assigns a variable label to a specified character variable

Assigns a variable name as the value of a specified variable

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 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

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 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 a 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 the type (character or numeric) of the specified variable

Returns the type (character or numeric) for the value of the specified argument

Web Tools

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

Returns a string that was decoded using the URL escape syntax

SYSPARM

SYSPROD

SYSTEM

FIPNAME

FIPNAMEL

FIPSTATE

STFIPS

STNAME

STNAMEL

ZIPFIPS

ZIPNAME

ZIPNAMEL

ZIPSTATE

ARCOS

ARSIN

ATAN

COS

SIN

TAN

CEIL

FLOOR

FUZZ

INT

ROUND

TRUNC

CALL LABEL

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

CALL VNAME

Variable Information

VARRAY

VARRAYX

VFORMAT

VFORMATD

VFORMATDX

VFORMATN

VFORMATNX

VFORMATW

VFORMATWX

VFORMATX

VINARRAY

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

VINFORMAT

VINFORMATD

VINFORMATDX

VINFORMATN

VINFORMATNX

VINFORMATW

VINFORMATWX

VINFORMATX

VLABEL

VLABELX

VLENGTH

VLENGTHX

VNAME

VNAMEX

VTYPE

VTYPEX

HTMLDECODE Decodes a string containing HTML numeric character references or HTML character entity references and returns the decoded string

HTMLENCODE

URLDECODE

Page 16: SAS - Useful Spread Sheet

Web Tools

Returns a string that was encoded using the URL escape syntaxURLENCODE

Page 17: SAS - Useful Spread Sheet

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

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

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

Parses a pattern and returns a value

Returns one character in the ASCII or the EBCDIC collating sequence

Returns an ASCII or EBCDIC collating sequence character string

Removes multiple blanks from a character string

Removes specific characters from a character string

Removes quotation marks from a character value

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 an argument

Converts all letters in an argument to lowercase

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

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

Encodes a string to facilitate searching

Replaces character value contents

Extracts a substring from an argument

Replaces specific characters in a character expression

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

Converts all letters in an argument to uppercase

Returns the position of the first character that is unique to an expression

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

Searches a character expression for a string of characters

Searches a character expression for specific characters

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 given word from a character expression

Concatenates two or more character strings

Extracts a substring from an argument

Extracts a substring from an argument based on byte position

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

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

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

Page 18: SAS - Useful Spread Sheet

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 character value contents based on byte unit

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 number of time intervals in a given time span

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

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 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 kurtosis

Returns the largest value

Returns the arithmetic mean (average)

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

Returns the range of values

Returns the skewness

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 and returns a value

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 and returns a value

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

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

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

Page 19: SAS - Useful Spread Sheet

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 and returns a value

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

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

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

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 and returns a value

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

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

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

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

Writes a record to an external file and returns a value

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

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

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 cashflow

Returns the convexity for a periodic cashflow 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 cashflow

Returns the modified duration for a periodic cashflow 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 cashflow stream, such as a bond

Returns the future value of a periodic saving

Returns the yield-to-maturity for a periodic cashflow 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 or deassigns a fileref for an external file, directory, or output device and returns a value

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

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

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

Page 20: SAS - Useful Spread Sheet

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

Returns the value of a macro variable during DATA step execution

Returns the absolute value

Returns the value of the airy function

Returns the noncentrality parameter from a chi-squared distribution

Computes some machine and mathematical constants and returns a value

Returns the derivative of the airy function

Computes the deviance and returns a value

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 and returns a value

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 remainder value

Returns the sign of a value

Returns the square root of a value

Returns the value of the TRIGAMMA function

Computes cumulative distribution functions

Computes the logarithm of a probability (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 and returns a value

Returns the probability from a chi-squared distribution

Returns the probability from a gamma distribution

Returns the probability from a hypergeometric distribution

Returns the probability from a negative binomial distribution

Returns the probability from the standard normal 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 gamma distribution

Returns a quantile from the standard normal 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

Returns a random variate from a Poisson distribution

Returns a random variate from a tabled probability distribution

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

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

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

Returns the probability from an F distribution

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

Returns the probability from a t distribution

Returns a quantile from the F distribution

Returns a quantile from the t distribution

Page 21: SAS - Useful Spread Sheet

Returns a random variate from a triangular distribution

Returns a random variate from a uniform distribution

Returns a random variate from a normal 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

Returns a random variate from a Poisson distribution

Returns a random variate from a tabled probability

Random variate from a triangular distribution

Returns a random variate from a uniform distribution

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 and returns a value

Closes a SAS data set and returns a value

Returns the observation number of the current observation

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

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

Verifies the existence of a SAS data library member

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 and returns a value

Verifies that a libref has been assigned and returns a value

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

Opens a SAS data set and returns a value

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 and returns a value

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

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 variable

Writes a value directly into memory

Submits an operating environment command for execution

Returns the value of a SAS system or graphics option

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

Stores the contents of a memory address into a character variable

Writes a value directly into memory

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

Returns the value of the specified operating environment variable

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

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

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

Returns differences between the argument and its nth lag

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

Page 22: SAS - Useful Spread Sheet

Returns the system parameter string

Determines if a product is licensed

Issues an operating environment command during a SAS session

Converts FIPS codes to uppercase state names

Converts FIPS codes to mixed case state names

Converts FIPS codes to two-character 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

Converts ZIP codes to FIPS state codes

Converts ZIP codes to uppercase state names

Converts ZIP codes to mixed case state names

Converts ZIP codes to state postal codes

Returns the arccosine

Returns the arcsine

Returns the arctangent

Returns the cosine

Returns the sine

Returns the tangent

Returns the smallest integer that is greater than or equal to the argument

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

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

Returns the integer value

Rounds to the nearest round-off unit

Truncates a numeric value to a specified length

Assigns a variable label to a specified character variable

Assigns a variable name as the value of a specified variable

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 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

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 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 a 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 the type (character or numeric) of the specified variable

Returns the type (character or numeric) for the value of the specified argument

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

Returns a string that was decoded using the URL escape syntax

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

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

Decodes a string containing HTML numeric character references or HTML character entity references and returns the decoded string

Page 23: SAS - Useful Spread Sheet

Returns a string that was encoded using the URL escape syntax

Page 24: SAS - Useful Spread Sheet

Categories and Descriptions of Informats

Category Informat Description

Character Converts ASCII character data to native format

Converts binary data to character data

Reads character data with blanks

Converts binary 0s to blanks

Converts EBCDIC character data to native format

Converts hexadecimal data to character data

Converts octal data to character data

Converts packed hexadecimal data to character data

Removes matching quotation marks from character data

Reads character data from right to left and preserves blanks

Reads character data from right to left and left aligns

Converts character data to uppercase

Reads character data of varying length

Reads standard character data

Column Binary Reads standard character data from column-binary files

Reads standard numeric values from column-binary files

Reads whether a row of column-binary data is punched

Reads a column-binary field down a card column

DBCS Removes shift code data from DBCS data

Adds shift code data to DBCS data

Date and Time

Reads international date values

Reads dates in Taiwanese form

Reads TIME MIC values

Reads packed decimal time of SMF and RMF records

Reads duration intervals of RMF records

Reads time and date fields of RMF records

Reads date and time values of SHR records

Reads time and date values of SMF records

Reads an eight-byte time-of-day stamp

Reads timer units

Reads quarters of the year

Numeric Converts positive binary values to integers

Extracts bits

Converts blanks to 0s

Removes embedded characters

$ASCIIw.

$BINARYw.

$CHARw.

$CHARZBw.

$EBCDICw.

$HEXw.

$OCTALw.

$PHEXw.

$QUOTEw.

$REVERJw.

$REVERSw.

$UPCASEw.

$VARYINGw.

$w.

$CBw.

CBw.d

PUNCH.d

ROWw.d

$KANJIw.

$KANJIXw.

DATEw. Reads date values in the form ddmmmyy or ddmmmyyyy

DATETIMEw. Reads datetime values in the form ddmmmyy hh:mm:ss.ss or ddmmmyyyy hh:mm:ss.ss

DDMMYYw. Reads date values in the form ddmmyy or ddmmyyyy

EURDFDEw.

EURDFDTw. Reads international datetime values in the form ddmmmyy hh:mm:ss.ss or ddmmmyyyy hh:mm:ss.ss

EURDFMYw. Reads month and year date values in the form mmmyy or mmmyyyy

JDATEYMDw. Reads Japanese kanji date values in the format yymmmdd or yyyymmmdd

JNENGOw. Reads Japanese Kanji date values in the form yymmdd

JULIANw. Reads Julian dates in the form yyddd or yyyyddd

MINGUOw.

MMDDYYw. Reads date values in the form mmddyy or mmddyyyy

MONYYw. Reads month and year date values in the form mmmyy or mmmyyyy

MSECw.

NENGOw. Reads Japanese date values in the form eyymmdd

PDJULGw. Reads packed Julian date values in the hexadecimal form yyyydddF for IBM

PDJULIw. Reads packed Julian dates in the hexadecimal format ccyyddd F for IBM

PDTIMEw.

RMFDURw.

RMFSTAMPw.

SHRSTAMPw.

SMFSTAMPw.

TIMEw. Reads hours, minutes, and seconds in the form hh:mm:ss.ss

TODSTAMPw.

TUw.

YYMMDDw. Reads date values in the form yymmdd or yyyymmdd

YYMMNw. Reads date values in the form yyyymm or yymm

YYQw.

BINARYw.d

BITSw.d

BZw.d

COMMAw.d

Page 25: SAS - Useful Spread Sheet

Numeric

Removes embedded characters

Reads numeric values that are stored in scientific notation and double-precision scientific notation

Converts hexadecimal positive binary values to either integer (fixed-point) or real (floating-point) binary values

Reads native integer binary (fixed-point) values, including negative values

Reads integer binary (fixed-point) values in Intel and DEC formats

Reads numeric values with a comma in place of the decimal point

Converts positive octal values to integers

Reads data that are stored in IBM packed decimal format

Reads percentages as numeric values

Reads positive integer binary (fixed-point) values

Reads positive integer binary (fixed-point) values in Intel and DEC formats

Reads unsigned packed decimal data

Reads numeric data that are stored in real binary (floating-point) notation

Reads EBCDIC numeric data

Reads integer binary (fixed-point) values, including negative values, in IBM mainframe format

Reads unsigned integer binary (fixed-point) values in IBM mainframe format

Reads packed data in IBM mainframe format

Reads unsigned packed decimal data in IBM mainframe format

Reads positive integer binary (fixed-point) values in IBM mainframe format

Reads real binary (floating-point) data in IBM mainframe format

Reads zoned decimal data in IBM mainframe format

Reads zoned decimal leading-sign data in IBM mainframe format

Reads zoned decimal separate leading-sign data in IBM mainframe format

Reads zoned decimal separate trailing-sign data in IBM mainframe format

Reads unsigned zoned decimal data in IBM mainframe format

Reads real binary (floating-point) data in VMS format

Reads standard numeric data

Removes embedded yen signs, commas, and decimal points

Reads zoned decimal data

Reads zoned decimal data in which zeros have been left blank

Reads and validates zoned decimal data

COMMAXw.d

Ew.d

FLOATw.d Reads a native single-precision, floating-point value and divides it by 10 raised to the dth power

HEXw.

IBw.d

IBRw.d

IEEEw.d Reads an IEEE floating-point value and divides it by 10 raised to the d th power

NUMXw.d

OCTALw.d

PDw.d

PERCENTw.d

PIBw.d

PIBRw.d

PKw.d

RBw.d

S370FFw.d

S370FIBw.d

S370FIBUw.d

S370FPDw.d

S370FPDUw.d

S370FPIBw.d

S370FRBw.d

S370FZDw.d

S370FZDLw.d

S370FZDSw.d

S370FZDTw.d

S370FZDUw.d

VAXRBw.d

w.d

YENw.d

ZDw.d

ZDBw.d

ZDVw.d

Page 26: SAS - Useful Spread Sheet

Categories and Descriptions of DATA Step Statements

Category Statement Description

Action Stops executing the current DATA step, SAS job, or SAS session

Evaluates an expression and stores the result in a variable

Invokes or calls a SAS CALL routine

Stops processing the current observation

Retrieves source code from a stored compiled DATA step program or a DATA step view

Sets _ERROR_ to 1 and, optionally, writes a message to the SAS log

Executes a stored compiled DATA step program

Continues processing only those observations that meet the condition

Writes to the SAS log the input data records for the observation that is being processed

Signals the end of data lines; acts as a placeholder

Writes the current observation to a SAS data set

Points to different input or output SAS data sets when you execute a stored program

Deletes an observation from a SAS data set

Replaces an observation in the same location

Stops execution of the current DATA step

Adds the result of an expression to an accumulator variable

Selects observations from SAS data sets that meet a particular condition

Control Stops processing the current DO-loop iteration and resumes with the next iteration

Designates a group of statements to be executed as a unit

Executes statements between DO and END repetitively based on the value of an index variable

Executes statements in a DO loop repetitively until a condition is true

Executes statements repetitively while a condition is true

Ends a DO group or a SELECT group

Moves execution immediately to the statement label that is specified

Executes a SAS statement for observations that meet specific conditions

Identifies a statement that is referred to by another statement

Stops processing the current loop and resumes with the next statement in sequence

Jumps to a statement label

Stops executing statements at the current point in the DATA step and returns to a predetermined point in the step

Executes one of several statements or groups of statements

File-handling

Indicates that data lines follow

Indicates that data lines that contain semicolons follow

Begins a DATA step and provides names for any output SAS data sets

Indicates that data lines follow

Indicates that data lines that contain semicolons follow

Specifies the current output file for PUT statements

Identifies an external file to read with an INPUT statement

Describes the arrangement of values in the input data record and assigns input values to the corresponding SAS variables

Reads input values from specified columns and assigns them to the corresponding SAS variables

Reads input values with specified informats and assigns them to the corresponding SAS variables

Scans the input data record for input values and assigns them to the corresponding SAS variables

Joins observations from two or more SAS data sets into single observations

Replaces, deletes, and appends observations in an existing SAS data set in place; does not create an additional copy

Writes variable values in the specified columns in the output line

Writes variable values with the specified format in the output line

Writes variable values and the specified character strings in the output line

ABORT

Assignment

CALL

DELETE

DESCRIBE

ERROR

EXECUTE

IF, Subsetting

LIST

LOSTCARD Resynchronizes the input data when SAS encounters a missing or invalid record in data that have multiple records per observation

Null

OUTPUT

REDIRECT

REMOVE

REPLACE

STOP

Sum

WHERE

CONTINUE

DO

DO, Iterative

DO UNTIL

DO WHILE

END

GO TO

IF-THEN/ELSE

Labels, Statement

LEAVE

LINK

RETURN

SELECT

BY Controls the operation of a SET, MERGE, MODIFY, or UPDATE statement in the DATA step and sets up special grouping variables

CARDS

CARDS4

DATA

DATALINES

DATALINES4

FILE

FILE, ODS Defines the structure of the data component that holds the results of the DATA step and binds that component to a template to produce an output object. ODS sends this object to all open ODS destinations, each of which formats the object appropriately. Also controls what happens when the PUT statement tries to write past the end of a line.INFILE

INPUT

INPUT, Column

INPUT, Formatted

INPUT, List

INPUT, Named Reads data values that appear after a variable name that is followed by an equal sign and assigns them to corresponding SAS variables

MERGE

MODIFY

PUT Writes lines to the SAS log, to the SAS procedure output file, or to an external file that is specified in the most recent FILE statement

PUT, Column

PUT, Formatted

PUT, List

Page 27: SAS - Useful Spread Sheet

Writes variable values after the variable name and an equal sign

Reads an observation from one or more SAS data sets

Updates a master file by applying transactions

Information Defines elements of an array

Describes the elements in an array to be processed

Associates a format, informat, label, and/or length with one or more variables

Excludes variables from output SAS data sets

Associates formats with variables

Associates informats with variables

Includes variables in output SAS data sets

Assigns descriptive labels to variables

Specifies the number of bytes for storing variables

Assigns characters in your input data to represent special missing values for numeric data

Specifies new names for variables in output SAS data sets

PUT, Named

PUT, _ODS_ Writes data values to a special buffer from which they can be written to the data component, and formatted by ODS destinations

SET

UPDATE

ARRAY

Array Reference

ATTRIB

DROP

FORMAT

INFORMAT

KEEP

LABEL

LENGTH

MISSING

RENAME

RETAIN Causes a variable that is created by an INPUT or assignment statement to retain its value from one iteration of the DATA step to the next

Page 28: SAS - Useful Spread Sheet

Categories and Descriptions of Global Statements

Category Statement Description

Data Access

References a SAS catalog as an external file

Allows you to access remote files using the FTP protocol

Allows you to read from or write to a TCP/IP socket

Allows you to access remote files using the URL access method

Associates a SAS libref with a database management system (DBMS) database, schema, server, or group of tables or views

Log Control Documents the purpose of the statement or program

Skips to a new page in the SAS log

Creates a blank line in the SAS log

Issues an operating-environment command from within a SAS session

Output Control Prints up to ten lines of text at the bottom of the procedure or DATA step output

Specifies output objects to exclude from ODS destinations

Opens, manages, or closes the Listing destination

Creates a SAS data set from an output object and manages the selection and exclusion lists for the Output destination

Specifies output objects for ODS destinations

Writes to the SAS log the specified selection or exclusion list

Writes to the SAS log a record of each output object that is created, or suppresses the writing of this record

Prints or suppresses a warning that a style definition or a table definition that is used is not supplied by SAS Institute

Specifies title lines for SAS output

Program Control Submits SAS Program Editor, Log, Procedure Output or text editor commands as SAS statements

Terminates a SAS job or session after the current DATA or PROC step executes

Brings a SAS programming statement, data lines, or both, into a current SAS program

Displays lines that are entered in the current session

Changes the value of one or more SAS system options

Executes the previously entered SAS statements

Ends source statements following a %INCLUDE * statement

Window Display Displays a window that is created with the WINDOW statement

Creates customized windows for your applications

CATNAME Logically combines two or more catalogs into one by associating them with a catref (a shortcut name); clears one or all catrefs; lists the concatenated catalogs in one concatenation or in all concatenations

FILENAME Associates a SAS fileref with an external file or an output device; disassociates a fileref and external file; lists attributes of external files

FILENAME, CATALOG Access Method

FILENAME, FTP Access Method

FILENAME, SOCKET Access Method

FILENAME, URL Access Method

LIBNAME Associates or disassociates a SAS data library with a libref (a shortcut name); clears one or all librefs; lists the characteristics of a SAS data library; concatenates SAS data libraries; implicitly concatenates SAS catalogs.

LIBNAME, SAS/ACCESS

Comment

PAGE

SKIP

Operating Environment

X

FOOTNOTE

ODS EXCLUDE

ODS HTML Opens, manages, or closes the HTML destination. If the destination is open, you can create HTML output (output that is written in Hypertext Markup Language).

ODS LISTING

ODS OUTPUT

ODS PATH Specifies which locations to search for definitions that were created by PROC EMPLATE, as well as the order in which to search for them

ODS PRINTER Opens, manages, or closes the Printer destination. If the destination is open, you can create Printer output (output that is formatted for a high-resolution printer)

ODS SELECT

ODS SHOW

ODS TRACE

ODS VERIFY

TITLE

DM

ENDSAS

%INCLUDE

%LIST

OPTIONS

RUN

%RUN

DISPLAY

WINDOW

Page 29: SAS - Useful Spread Sheet

Report-Writing Procedures by TaskTo Produce Use this Procedure Which

Details Reports PRINT

REPORT

SQL

Summary Reports PRINT produces only one summary report: can sum the BY variables.

REPORT

TABULATE

SQL

MEANS or SUMMARY

Miscellaneoous bhighy formatted reports

Calendars CALENDER

Labels, Forms FORMS

Name/address listings FORMS produces multicolumn name and address listings.

REPORT produces multipanel reports.

Low-resolution graphical reports

CHART

PLOT produces scatter diagrams that plot one variable against another.

TIMEPLOT produces plots of one or more variables over time intervals.

produces data listings quickly; can supply titles, footnotes, and column sums.

offers more control and customization than PROC PRINT; can produce both column and row sums; has DATA step computation abilities.combines Structured Query Language and SAS features such as formats; can manipulate data and create a SAS data set in the same step that creates the report; can produce column and row statistics; does not offer as much control over output as PROC PRINT and

combines features of the PRINT, MEANS, and TABULATE procedures with features of the DATA step in a single report writing tool that can produce a variety of reports; can also create an output data set.displays descriptive statistics in tabular form. The value in each table cell is calculated from the variables and statistics that define the pages, rows, and columns of the table. The statistic associated with each cell is calculated on values from all observations in that category. You can output the results to a SAS data set.

computes descriptive statistics for one or more SAS data sets or DBMS tables; can produce a printed report or create a SAS data set.

computes descriptive statistics for numeric variables; can produce a printed report and create an output data set.

displays data from a SAS data set in a monthly calendar format. PROC CALENDAR can display holidays in the month, schedule tasks, and process data for multiple calendars with work schedules that vary.

produces labels for envelopes, mailing labels, external tape labels, file cards, and other printer forms that have a regular pattern.

Multipanel reports (telephone book listing)

produces vertical and horizontal bar charts (also called histograms), block charts, pie charts, and star charts. These charts provide a quick visual representation of the values of a single variable or several variables. PROC CHART can also display a statistic associated with the values.

Page 30: SAS - Useful Spread Sheet

Elementary Statistical Procedures by Task

Descriptive Statistics CORR

MEANS or SUMMARY

REPORT

SQL

TABULATE

UNIVARIATE

FREQ

TABULATE

UNIVARIATE produces one-way frequency tables.

Correlation analysis CORR

Distribution analysis UNIVARIATE computes tests for location and tests for normality.

FREQ

Robust estimation UNIVARIATE

Data transformation

Computing ranks RANK

Standardizing data STANDARD

Low-resolution graphical reports

computes Pearson product-moment and weighted product-moment correlation coefficients between variables and descriptive statistics for these variables. In addition, PROC CORR can compute three nonparametric measures of association (Spearman's rank-order correlation, Kendall's tau-b, and Hoeffding's measure of dependence, D), partial correlations (Pearson's partial correlation, Spearman's partial rank-order correlation, and Kendall's partial tau-b), and Cronbach's coefficient alpha.

computes descriptive statistics for numeric variables across all observations and within groups of observations. You can also create an output data set that contains specific statistics and identifies minimum and maximum values for groups of observations.

computes most of the same statistics as PROC TABULATE; allows customization of format.

computes descriptive statistics for data in one or more DBMS tables; can produce a printed report or create a SAS data set.

produces tabular reports for descriptive statistics; can create an output data set.

computes the broadest set of descriptive statistics; can create an output data set.

Frequecy and cross-tabulation tables

produces one-way to n-way tables; reports frequency counts; computes chi-square tests; computes tests and measures of association and agreement for two-way to n-way cross-tabulation tables; can compute exact tests and asymptotic tests; can create output data sets.

produces one-way and two-way cross-tabulation tables; can create an output data set.

computes Pearson's, Spearman's, and Kendall's correlations and partial correlations; also computes Hoeffding's D and Cronbach's coefficient alpha.

computes a test for the binomial proportion for one-way tables; computes a goodness-of-fit test for one-way tables; computes a chi-square test of equal distribution for two-way tables.computes robust estimates of scale, trimmed means, and Winsorized means.

computes ranks for one or more numeric variables across the observations of a SAS data set and creates an output data set; can produce normal scores or other rank scores.creates an output data set that contains variables that are standardized to a given mean and standard deviation.

Page 31: SAS - Useful Spread Sheet

CHART

UNIVARIATE

Utility Procedures by Task

Supply information COMPARE

CONTENTS

OPTIONS lists the current values of all SAS system options.

SQL

Affect printing EXPLODE

FORMAT creates user-defined formats to display and print data.

PTINTTO

FLIST

SQL

Transform data FORMAT

SORT sorts SAS data sets by one or more variables.

SQL sorts SAS data sets by one or more variables.

TRANSPOSE

TRANTAB creates, edits, and displays customized translation tables.

Manage SAS files APPEND

BMDP invokes a BMDP program to analyze data in a SAS data set.

CATALOG manages SAS catalog entries.

CIMPORT

CONVERT

produces a graphical report that can show one of the following statistics for the chart variable: frequency counts, percentages, cumulative frequencies, cumulative percentages, totals, or averages.produces descriptive plots such as stem and leaf, box plot, and normal probability plot.

compares the contents of two SAS data sets. You can also use PROC COMPARE to compare the values of different variables within a single data set. PROC COMPARE produces a variety of reports on the comparisons that it performs.

prints descriptions of the contents of one or more files in a SAS data library.

supplies information through dictionary tables on an individual SAS data set as well as all SAS files active in the current SAS session. Dictionary tables can also provide information about macros, titles, indexes, external files, or SAS system options.produces oversized text on printed output; can produce displays such as posters, flip charts, and header pages.

routes procedure output to a file, a SAS catalog entry, or a printer; can also redirect the SAS log to a file.

Create, browse, and edit data

browses external files such as files that contain SAS source lines or SAS procedure output.

creates SAS data sets using Structured Query Language and SAS features.

creates user-defined informats and formats for character or numeric variables. PROC FORMAT also prints the contents of a format library, creates a control data set to write other informats or formats, and reads a control data set to create informats or formats.

transforms SAS data sets so that observations become variables and variables become observations.

adds observations from one SAS data set to the end of another SAS data set

restores a transport file created by the CPORT procedure to its original form (a SAS data library, catalog, or data set) in the format appropriate to the operating environment. Coupled with the CPORT procedure, PROC CIMPORT enables you to move SAS data libraries, catalogs, and data sets from one operating environment to another.

converts BMDP system files, OSIRIS system files, and SPSS portable files to SAS data sets.

Page 32: SAS - Useful Spread Sheet

COPY

CPORT

DATASETS

EXPORT

IMPORT

PDS lists, deletes, and renames the members of a partitioned data set.

PDSCOPY

REGISTRY imports registry information to the USER portion of the SAS Registry.

RELEASE

SOURCE

SQL concatenates SAS data sets.

TAPECOPY

TAPELABEL

PMENU creates customized pull-down menus for SAS applications.

copies an entire SAS data library or specific members of the library. You can limit processing to specific types of library members.

converts a SAS catalog, a SAS data set, or a SAS library to a transport sequential file that PROC CIMPORT can restore (usually under another operating environment) to its original form.lists, copies, renames, and deletes SAS files and SAS generation groups, manages indexes, and appends SAS data sets in a SAS data library. The procedure provides all the capabilities of the APPEND, CONTENTS, and COPY procedures. You can also modify variables within data sets, manage data set attributes, such as labels and passwords, or create and delete integrity constraints.

reads data from a SAS data set and writes them to an external data source.

reads data from an external data source and writes them to a SAS data set.

copies partitioned data sets from disk to tape, disk to disk, tape to tape, or tape to disk.

releases unused space at the end of a disk data set under the OS/390 environment.

provides an easy way to back up and process source library data sets.

copies an entire tape volume or files from one or more tape volumes to one output tape volume.

lists the label information of an IBM standard-labeled tape volume under the OS/390 environment.

Page 33: SAS - Useful Spread Sheet

Report-Writing Procedures by TaskExample

PROC CHART DATA=SASdataset options; VBAR variable / options; HBAR variable / options; options: MIDPOINTS= GROUP= SUMVAR=

PROC PLOT DATA=SASdataset options; options: HPERCENT= VPERCENT= PLOT yvariable * xvariable = symbol / options; PLOT (yvariables) * (xvariables) = symbol / options ; PLOT options: BOX OVERLAY VREF= HREF= BY variable(s) ;

Page 34: SAS - Useful Spread Sheet

Elementary Statistical Procedures by Task

PROC MEANS DATA=SASdataset options; options:N MEAN STD MIN MAX SUM VAR CSS USS VAR variable(s); BY variable(s); OUTPUT OUT=SASdataset keyword=variablename ... ;

PROC UNIVARIATE DATA=SASdataset options; options:PLOT VAR variable(s); BY variable(s); OUTPUT OUT=SASdataset keyword=variablename ... ;

PROC FREQ DATA=SASdataset; TABLES variable(s) / options; options:NOCOL NOROW NOPERCENT OUTPUT OUT=SASdataset;

Page 35: SAS - Useful Spread Sheet

Utility Procedures by Task

Page 36: SAS - Useful Spread Sheet
Page 37: SAS - Useful Spread Sheet

Categories and Descriptions of SAS System Options

Category Statement Description

Specifies the remote session ID that is used for SAS/CONNECT software

Specifies whether or not to display the SAS/CONNECT transfer status window

Encrypts all network communications

Specifies the algorithm(s) available for the encryption of data that are passed over the network

Specifies the key size to use for the encryption of data that are passed over the network

Used by the SIGNON portion of SAS/CONNECT to invoke a remote or server SAS session

Contains the fileref that is generated by the SASSCRIPT system option

Specifies one or more storage locations of SAS/CONNECT script files

Specifies the buffer size to use when you transmit data with SAS/CONNECT or SAS/SHARE software

Specifies the first TCP/IP port for SAS/CONNECT software

Specifies the last TCP/IP port for SAS/CONNECT software

Specifies the default form that is used for windowing output

Specifies how to handle an out-of-resource condition

Controls how SAS responds when a SAS data set is not found

Specifies how SAS responds to errors

Controls error handling in batch processing

Controls the maximum number of observations for which complete error messages are printed

Controls how SAS responds when a _NULL_ data set is used

Specifies the location of Java applets

Specifies the base location of SAS online documentation

Controls the order in which format catalogs are searched

Specifies the location of the text and index files for the facility that is used to view SAS help

Specifies a file that contains messages to be written to the SAS log

Specifies a parameter string that is passed to an external program

Specifies the file reference to use as the PARMCARDS file

Specifies the location of the repository manager for common metadata

Controls access to the SASUSER library

Specifies the autocall macro library

Specifies the location of the SASHELP library

Specifies the name of the SASUSER library

Specifies a character string that can be passed to SAS programs

Specifies the base location of SAS online training courses

Specifies the default permanent SAS data library

Specifies the WORK data library

Initializes the WORK data library

Communications: Networking and

encryption

CONNECTREMOTE=

CONNECTSTATUS

CONNECTWAIT Specifies whether or not to wait for a SAS/CONNECT remote submit statement (rsubmit) to complete before control returns to the local session

NETENCRYPT

NETENCRYPTALGORITHM=

NETENCRYPTKEYLEN=

NETMAC Controls whether SAS uses Message Authentication Codes (MACs) to detect message corruption across a network

SASCMD

SASFRSCR

SASSCRIPT=

TBUFSIZE=

TCPPORTFIRST=

TCPPORTLAST=

Environment control: Display

CHARCODE Determines whether character combinations are substituted for special characters that are not on the keyboard

FORMS=

SOLUTIONS Specifies whether the SOLUTIONS menu choice appears in all SAS windows and whether the SOLUTIONS folder appears in the SAS Explorer window

Environment control: Error handling

BYERR Controls whether SAS generates an error message and sets the error flag when a _NULL_ data set is used in the SORT procedure

CLEANUP

DSNFERR

ERRORABEND

ERRORCHECK=

ERRORS=

FMTERR Determines whether or not SAS generates an error message when a format of a variable cannot be found

VNFERR

Environment control: Files

APPLETLOC=

DOCLOC=

FMTSEARCH=

HELPLOC=

NEWS=

PARM=

PARMCARDS=

REP_MGRLOC=

RSASUSER

SASAUTOS=

SASHELP=

SASUSER=

SYSPARM=

TRAINLOC=

USER=

WORK=

WORKINIT

Page 38: SAS - Useful Spread Sheet

Controls whether SAS erases WORK files at the termination of a SAS session

Controls the ability to invoke a remote SAS session so that you can run SAS/CONNECT software

Invokes the SAS windowing environment

Invokes SAS with the Explorer, program editor, log, output, and results windows

Controls whether or not you invoke SAS with only the Explorer window

Suppresses the Log, Output, and Program Editor windows when you enter a SAS/AF application

Specifies whether or not to put the SAS session into DCOM/CORBA server mode

Determines whether SAS evaluates the execution mode and, if needed, resets the option

Specifies language for international date informats and formats

Specifies the translation tables that are used by various parts of SAS

Files: External files Allows previous library references (librefs) to persist in a new SAS session

Specifies whether synchronous I/O is enabled

Files: SAS files Specifies whether asynchronous I/O is enabled

Specifies the number of buffers to use for SAS data sets

Specifies the permanent buffer size for output SAS data sets

Specifies the number of SAS catalogs to keep open

Controls the number of extra page buffers to allocate for each open SAS catalog

Controls the compression of observations in output SAS data sets

Prevents certain errors by controlling the SAS keywords that are allowed in the DATA statement

Specifies the default access method for SAS data libraries

Causes SAS to begin reading at a specified observation or record

Specifies the most recently created data set

Specifies which observation SAS processes last

Controls whether you can replace permanently stored SAS data sets

Controls the type of SAS variable names that can be created and processed during a SAS session

Specifies a terminal device driver for SAS/GRAPH software

Specifies the location of the SAS data library that contains SAS/GIS-supplied US Census Tract maps

Specifies the list of locations to search for maps

Processes SAS source and data lines as 80-byte cards

Specifies the value SAS is to assign to a variable when invalid numeric data are encountered

Enables a PROC statement to invoke external programs

Specifies the length of secondary source statements

Specifies the length of the numeric portion of the sequence field in input source lines or datalines

Environment control: Files

WORKTERM

Environment control: Initialization and

operation

BATCH Specifies whether batch settings for LINESIZE, OVP, PAGESIZE, and SOURCE are in effect when SAS executes

DMR

DMS

DMSEXP

EXPLORER

INITCMD

INITSTMT= Specifies a SAS statement to be executed after any statements in the autoexec file and before any statements from the SYSIN= file

MULTENVAPPL Controls whether SAS/AF, SAS/FSP, and base windowing applications use a default on an operating environment specific font selector window

Environment control: Initialization and

operation

OBJECTSERVER

TERMINAL

Environment control: Language control

DFLANG=

TRANTAB=

STARTLIB

SYNCHIO

ASYNCHIO

BUFNO=

BUFSIZE=

CATCACHE=

CBUFNO=

COMPRESS=

DATASTMTCHK=

DKRICOND= Controls the level of error detection for input data sets during processing of DROP=, KEEP=, and RENAME= data set options

DKROCOND= Controls the level of error detection for output data sets during the processing of DROP=, KEEP=, and RENAME= data set options and the corresponding DATA step statements

DLDMGACTION= Specifies what type of action to take when a SAS catalog or a SAS data set in a SAS data library is detected as damaged

ENGINE=

FIRSTOBS=

_LAST_=

MERGENOBY Controls whether a message is issued when MERGE processing occurs without an associated BY statement

OBS=

REPLACE

REUSE= Specifies whether or not SAS reuses space when observations are added to a compressed SAS data set

VALIDVARNAME=

Graphics: Driver settings

DEVICE=

GISMAPS=

GWINDOW Controls whether SAS displays SAS/GRAPH output in the GRAPH window of the windowing environment

MAPS=

Input control: Data processing

CARDIMAGE

INVALIDDATA=

PROC

S= Specifies the length of statements on each line of a source statement and the length of data on lines that follow a DATALINES statement

S2=

SEQ=

Page 39: SAS - Useful Spread Sheet

Controls whether SAS writes SAS statements to a utility data set in the WORK data library

Indicates whether to translate input to uppercase

Specifies a character to delimit page breaks in SAS output

Initializes the SAS print file

Overprints output lines

Controls whether SAS writes source statements to the SAS log

Writes secondary source statements from included files to the SAS log

Specifies the binding edge for the ODS printer destination

Specifies the size of the margin at the bottom of the page for the ODS printer destination

Specifies the collation of multiple copies for output for the ODS printer destination

Specifies color printing, if it is supported, for the ODS printer destination

Specifies the number of copies to make when printing to the ODS printer destination

Specifies duplexing controls for the ODS printer destination

Specifies the size of the margin on the left side of the page for the ODS printer destination

Specifies the paper orientation to use when printing to the ODS printer destination

Specifies a printer for SAS print jobs directed to the ODS printer destination

Controls whether BY lines are printed above each BY group

Controls alignment of SAS procedure output

Specifies the default output formatting characters

Determines whether SAS procedures can use labels with variables

Resets the page number

Specifies the number of lines to skip at the top of each page of SAS output

Specifies the location of the console log

Specifies whether hardware information is written to the SAS log

Controls the printing of page numbers

Prints the date and time that the SAS session was initialized

Specifies whether to include additional information when files are listed in a SAS data library

Specifies the line size of SAS procedure output

Specifies the character to print for missing numeric values

Specifies the number of lines that compose a page of SAS output

Controls whether autoexec code in an input file is echoed to the log

Controls the level of detail in messages that are written to the SAS log

Writes notes to the SAS log

Macro: SAS macro Determines whether the macro processor recognizes a command-style macro invocation

Controls whether SAS allows statement-style macro calls

Specifies whether the SAS macro language is available

Determines whether the macro autocall feature is available

Specifies whether MPRINT output is directed to an external file

Controls whether SAS traces execution of the macro language processor

Displays SAS statements that are generated by macro execution

Input control: Data processing

SPOOL

Input control: Data processing

CAPS

YEARCUTOFF= Specifies the first year of a 100-year span that will be used by date informats and functions to read a two-digit year

Log and procedure output control:

Procedure output

FORMDLIM=

PRINTINIT

Log and procedure output control: SAS

log

OVP

SOURCE

SOURCE2

Log and procedure output control: ODS

printing

BINDING=

BOTTOMMARGIN=

COLLATE

COLORPRINTING

COPIES=

DUPLEX

LEFTMARGIN=

ORIENTATION=

PRINTERPATH=

Log and procedure output control:

Procedure output

BYLINE

CENTER

FORMCHAR=

LABEL

PAGENO=

PROBSIG= Specifies the number of significant digits in p-values for some statistical procedures

SKIP=

Log and procedure output control: SAS

log

CONSOLELOG=

CPUID

Log and procedure output control: SAS log and procedure output

NUMBER

Log and procedure output control: SAS log and procedure

output

DATE

DETAILS

LINESIZE=

MISSING=

PAGESIZE=

Log and procedure output control: SAS

log

ECHOAUTO

MSGLEVEL=

NOTES

CMDMAC

IMPLMAC

MACRO

MAUTOSOURCE

MERROR Controls whether SAS issues a warning message when a macro-like name does not match a macro keyword

MFILE

MLOGIC

MPRINT

Page 40: SAS - Useful Spread Sheet

Macro: SAS macro

Determines whether the macro facility searches a specific catalog for a stored, compiled macro

Specifies the maximum amount of memory that is available to macro variable symbol tables

Specifies the maximum size for macro variables that are stored in memory

Specifies the libref of a SAS data library that contains a catalog of stored, compiled SAS macros

Controls whether the results of resolving macro variable references are written to the SAS log

Specifies the bin to receive printed output for the ODS printer destination

Specifies the paper size to use when printing to the ODS printer destination

Specifies the paper bin to use for printing to the ODS printer destination

Specifies the type of paper to use for printing to the ODS printer destination

Specifies the size of the margin at the top of the page for the ODS printer destination

Controls the printing of extended lists of messages to the SAS log

Controls the SORT procedure's application of the NODUP option to physical or logical records

Specifies which collating sequence the SORT procedure is to use

Specifies the amount of memory that is available to the SORT procedure

Controls whether site license information can be altered

Controls whether SAS language compiler optimization is in effect

MRECALL Controls whether SAS searches the autocall libraries for a file that was not found during an earlier search

MSTORED

MSYMTABMAX=

MVARSIZE=

SASMSTORE=

SERROR Controls whether SAS issues a warning message when a defined macro variable reference does not match a macro variable

SYMBOLGEN

SAS log and procedure output

control: ODS printing

PAPERDEST=

PAPERSIZE=

PAPERSOURCE=

PAPERTYPE=

RIGHTMARGIN= Specifies the size of the margin at the right side of the page for printed output directed to the ODS printer destination

TOPMARGIN=

SAS log and procedure output: SAS log

PRINTMSGLIST

Sort: Procedure options

SORTDUP=

SORTSEQ=

SORTSIZE=

System administration: Installation

SETINIT

System administration: Memory

SUMSIZE= Specifies a limit on the amount of memory that is available for data summarization procedures when class variables are active

System administration: Performance

CMPOPT