msgbartop
List for SAS fans and programmer
msgbarbottom

22 11月 10 最全的SAS9.2函数列表二


第二类 函数  windows环境下函数;

CALL SOUND Generates a sound with a specific frequency and duration.
MCIPISLP Causes SAS to wait for a piece of multimedia equipment to become active.
MCIPISTR Submits an MCI string command to a piece of multimedia equipment.
MODULE Calls a specific routine or module that resides in an external dynamic link library (DLL).
WAKEUP Specifies the time a SAS DATA step begins execution.

第三类,OpenVMS虚拟内存环境下函数;

ASCEBC Converts an input character string from ASCII to EBCDIC.
CALL FINDEND Releases resources that are associated with a directory search.
DELETE Deletes a file.
EBCASC Converts an input character string from EBCDIC to ASCII.
FILEATTR Returns the attribute information for a specified file.
FINDFILE Searches a directory for a file.
GETDVI Returns a specified item of information from a device.
GETJPI Retrieves job-process informations.
GETLOG Returns information about a DCL logical name.
GETMSG Translates an OpenVMS error code into text.
GETQUOTA Retrieves disk quota information.
GETSYM Returns the value of a DCL symbol.
GETTERM Returns the characteristics of your terminal device.
MODULE Calls a specific routine or module that resides in a sharable image.
NODENAME Returlns the name of the current node.
PUTLOG Creates an OpenVMS logical-name in your process-level logical name table.
PUTSYM Creates a DCL symbol in the parent SAS process.
SETTERM Modifies a characteristic of your terminal device.
TERMIN Allows simple input from SYS$INPUT.
TERMOUT Allows simple output to SYS$OUTPUT.
TTCLOSE Closes a channel that was previously assigned by TTOPEN.
TTCONTRL Modifies the characteristics of a channel that was previously assigned by TTOPEN.
TTOPEN Assigns an I/O channel to a terminal.
TTREAD Reads characters from the channel assigned by TTOPEN.
TTWRITE Writes characters to the channel assigned by TTOPEN.
VMS Spawns a subprocess and executes a DCL command.

第四类,z/OS操作环境下函数,

CALL TSO Issues a TSO command or invokes a CLIST or a REXX exec during a SAS session.
CALL WTO Sends a message to the system console.
TSO Issues a TSO command or invokes a CLIST or a REXX exec during a SAS session.
WTO Sends a message to the system console.

第五类,宏语言函数;

%BQUOTE, %NRBQUOTE Masks special characters and mnemonic operators in a resolved value at macro execution.
%EVAL Evaluates arithmetic and logical expressions using integer arithmetic.
%INDEX Returns the position of the first character of a string.
%LENGTH Returns the length of a string.
%QUOTE, %NRQUOTE Masks special characters and mnemonic operators in a resolved value at macro execution.
%SCAN, %QSCAN Searches for a word that is specified by its position in a string.
%STR, %NRSTR Masks special characters and mnemonic operators in constant text at macro compilation.
%SUBSTR, %QSUBSTR Produces a substring of a character string.
%SUPERQ Masks all special characters and mnemonic operators at macro execution but prevents further resolution of the value.
%SYMEXIST Returns an indication of the existence of a macro variable.
%SYMGLOBL Returns an indication as to whether a macro variable is global in scope.
%SYMLOCAL Returns an indication as to whether a macro variable is local in scope,
%SYSEVALF Evaluates arithmetic and logical expressions using floating-point arithmetic.
%SYSFUNC, %QSYSFUNC Executes SAS functions or user-written functions.
%SYSGET Returns the value of the specified operating environment variable.
%SYSPROD Reports whether a SAS software product is licenses at the site.
%UNQUOTE During macro execution, unmasks all special characters and mnemonic operators for a value.
%UPCASE, %QUPCASE Converts values to uppercase.

第六类,多国语言函数,

EUROCURR Converts one European currency to another.
GETPXLANGUAGE Returns the current two letter language code.
GETPXLOCALE Returns the POSIX locale value for a SAS locale.
GETPXREGION Returns the current two letter region code.
KCOMPARE Returns the result of a comparison of character expressions.
KCOMPRESS Removes specified characters from a character expression.
KCOUNT Returns the number of double-byte characters in an expression.
KCVT Converts data from one type of encoding data toanother encoding data.
KINDEX Searches a character expression for a string of characters.
KINDEXC Searches a character expression for specified characters.
KLEFT Left-aligns a character expression by removing unnecessary leading DBCS blanks and SO/SI.
KLENGTH Returns the length of an argument.
KLOWCASE Converts all letters in an argument to lowercase.
KREVERSE Reverses a character expression.
KRIGHT Right-aligns a character expression by trimming trailing DBCS blanks and SO/SI.
KSCAN Selects a specified word from a character expression.
KSTRCAT Concatenates two or more character expressions.
KSUBSTR Extracts a substring from an argument.
KSUBSTRB Extracts a substring from an argument according to the byte position of the substring in the argument.
KTRANSLATE Replaces specific characters in a character expression.
KTRIM Removes trailing DBCS blanks and SO/SI from character expressions.
KTRUNCATE Truncates a numeric value to a specified length.
KUPCASE Converts all single-byte letters in an argument to uppercase.
KUPDATE Inserts, deletes, and replaces character value contents.
KUPDATEB Inserts, deletes, and replaces the contents of the character value according to the byte position of the character value in the argument.
KVERIFY Returns the position of the first character that is unique to an expression.
NLDATE Converts the SAS date value to the date value of the specified locale by using the date format descriptors.
NLDATM Converts the SAS datetime value to the time value of the specified locale by using the datetime- format descriptors.
NLTIME Converts the SAS time or the datetime value to the time value of the specified locale by using the NLTIME descriptors.
SORTKEY Creates a linguistic sort key.
TRANTAB Transcodes data by using the specified translation table.
VARTRANSCODE Returns the transcode attribute of a SAS data set variable.
VTRANSCODE Returns a value that indicates whether transcoding is enabled for the specified character variable.
VTRANSCODEX Returns a value that indicates whether transcoding is enabled for the specified argument.
UNICODELEN Specifies the length of the character unit for the Unicode data.
UNICODEWIDTH Specifies the length of a display unit for the Unicode data.

第七类,其他函数  以下是其他函数的不完全情况:

1,有模块有自己的专用函数,如IML模块里面的函数。

2,现在模块中出现,如果用得很多的话,就变成了常规函数,如有些函数是从其他版本中其他模块转过来的,如SAS/ETS的INTCINDEX,INTCYCLE等等; SAS High-Performance Forecasting的HOLIDAY和NWKDOM函数等等就是这样。

3,还有一类函数是SAS文档中没有记录的,比如说PROC SQL语句中的 MONOTONIC( ) 函数,但是可以使用的,半官方的解释就是不成熟,处于试用中的函数,这种函数有些地方确实能起到惊艳的作用,但需要小心使用,多测试,防止意外发生。

4,有些函数文档里一些情况也没叙述完全,可能在调试中。比如说函数indexw(),具体见说明见mysas圈

5,也许还有其他的情况,待考。

另附SAS9.2中新增和变动的函数列表(中文):
以下为新增的函数和 CALL 例程:
ALLCOMB
以最小更改顺序一次从 n 个变量中任选 k 个值时生成的所有组合。
ALLPERM
以最小更改顺序生成若干变量的值的所有排列。
ARCOSH
返回反双曲余弦。
ARSINH
返回反双曲正弦。
ARTANH
返回反双曲正切。
CALL ALLCOMB
以最小更改顺序一次从 n 个变量中任选 k 个值时生成的所有组合。
CALL ALLCOMBI
以最小更改顺序一次从 n 个对象中任选 k 个指数时生成的所有组合。
CALL GRAYCODE
以最小更改顺序生成 n 个项的所有子集。
CALL ISO8601_CONVERT
将 ISO 8601 时间间隔转换为日期时间值和持续时间值,或将日期时间值和持续时间值转换为 ISO 8601 时间间隔。
CALL LEXCOMB
以字典顺序一次从 n 个变量中任选 k 个非缺失值时生成的所有非重复组合。
CALL LEXCOMBI
以字典顺序一次从 n 个对象中任选 k 个指数时生成的所有组合。
CALL LEXPERK
以字典顺序一次从 n 个变量中任选 k 个非缺失值时生成的所有非重复排列。
CALL LEXPERM
以字典顺序生成若干变量的非缺失值的所有非重复排列。
CALL SORTC
对字符参数的值进行排序。
CALL SORTN
对数值参数的值进行排序。
CATQ
使用分隔符分隔各个项,并将含该分隔符的字符串用引号引起来,以此连接字符或数值。
CHAR
从字符串的指定位置返回单个字符。
CMISS
统计缺失参数的数量。
COUNTW
统计字符表达式中的字词数。
DIVIDE
返回用于处理 ODS 输出的特殊缺失值的除法结果。
ENVLEN
返回环境变量的长度。
EUCLID
返回非缺失参数的欧氏范数。
FINANCE
执行财务计算,如折旧、到期时间、应计利息、净现值、定期储蓄和内部收益率。
FINDW
在字符串中搜索单词。
FIRST
返回字符串的第一个字符。
GCD
返回一个或多个整数的最大公约数。
GEODIST
返回两个纬度和经度坐标之间的大地距。
GRAYCODE
以最小更改顺序生成 n 个项的所有子集。
INTFIT
返回两个日期之间的时间间隔。
INTGET
返回基于三个日期值或日期时间值的时间间隔。
INTSHIFT
返回与基时间间隔相对应的移位时间间隔。
INTTEST
若时间间隔有效,返回 1;若时间间隔无效,则返回 0。
LCM
返回能被一组数中的每个数整除的最小倍数。
LCOMB
计算 COMB 函数的对数,即一次从 n 个对象中任选 r 个的组合数的对数。
LEXCOMB
以字典顺序一次从 n 个变量中任选 k 个非缺失值时生成的所有非重复组合。
LEXCOMBI
以字典顺序一次从 n 个对象中任选 k 个指数时生成的所有组合。
LEXPERK
以字典顺序一次从 n 个变量中任选 k 个非缺失值时生成的所有非重复排列。
LEXPERM
以字典顺序生成若干变量的非缺失值的所有非重复排列。
LFACT
计算 FACT(阶乘)函数的对数。
LOG1PX
返回 1 加该参数的对数。
LPERM
计算 PERM 函数的对数,即从 n 个对象中任选 r 个元素的排列数的对数。
LPNORM
返回第二个参数和随后的非缺失参数的 Lp 范数。
MD5
返回指定的字符串的消息摘要的结果。
MSPLINT
返回保单调插值样条的纵坐标。
RENAME
重命名 SAS 逻辑库的成员、外部文件或目录。
SUMABS
返回非缺失参数的绝对值的总和。
TRANSTRN
若一个字符串中的某个子串的值大于零,则在该字符串中替换找到的所有该子串。
WHICHC
搜索与第一个参数相等的字符值,并返回第一个匹配值的索引。
WHICHN
搜索与第一个参数相等的数值,并返回第一个匹配值的索引。
ZIPCITYDISTANCE
返回两个邮政编码位置之间的大地距。
改进了以下函数中的参数说明:
DOPEN
打开目录,并返回一个目录标识符值。
EXIST
验证 SAS 逻辑库成员是否存在。
FOPEN
打开外部文件并返回一个文件标识符值。
FEXIST
验证与文件引用名相关的外部文件是否存在。
FILENAME
为外部文件、目录或输出设备分配或取消分配文件引用名。
FILEREF
验证是否已将文件引用名分配给当前 SAS 会话。
LIBNAME
为 SAS 逻辑库分配或取消分配逻辑库引用名。
LIBREF
验证是否已分配逻辑库引用名。
MOPEN
根据目录 ID 和成员名称打开文件,并返回文件标识符或 0。
PATHNAME
返回 SAS 逻辑库或外部文件的物理名称,或返回一个空格。
以下函数以前包含在 Risk Dimensions 中,现已成为 Base SAS 的一部分:
BLACKCLPRC
根据 Black 模型计算欧式期货期权的买权价格。
BLACKPTPRC
根据 Black 模型计算欧式期货期权的卖权价格。
BLKSHCLPRT
根据 Black-Scholes 模型计算欧式期权的买权价格。
BLKSHPTPRT
根据 Black-Scholes 模型计算欧式期权的卖权价格。
GARKHCLPRC
根据 Garman-Kohlhagen 模型计算欧式股票期权的买权价格。
GARKHPTPRC
根据 Garman-Kohlhagen 模型计算欧式股票期权的卖权价格。
MARGRCLPRC
根据 Margrabe 模型计算欧式股票期权的买权价格。
MARGRPTPRC
根据 Margrabe 模型计算欧式股票期权的卖权价格。
以下函数以前包含在 SAS/ETS 中,现已成为 Base SAS 的一部分:
INTCINDEX
按给定日期、时间或日期时间值,返回周期指数。
INTCYCLE
按给定日期、时间或日期时间间隔,返回下一较高季节周期的日期、时间或日期时间间隔。
INTFMT
按给定日期、时间或日期时间间隔,返回推荐的格式。
INTINDEX
按给定日期、时间或日期时间间隔和值,返回季节指数。
INTSEAS
按给定日期、时间或日期时间间隔,返回季节周期的长度。
以下函数以前包含在 SAS High-Performance Forecasting 中,现已成为 Base SAS 的一部分:
HOLIDAY
返回指定年中指定假日的日期。
NWKDOM
返回指定年的指定月中某个星期几第 n 次出现时的日期。
以下函数已由 SAS 语言参考:字典转移到 SAS/IML 文档:
MODULEIC
调用外部例程,并返回一个字符值(仅在 IML 环境下)。
MODULEIN
调用外部例程,并返回一个数值(仅在 IML 环境下)。
CALL MODULEI
调用外部例程,但不返回任何代码(仅在 IML 环境下)。
以下函数和 CALL 例程已增强:
CALL POKE
现在可以直接将浮点数写入基于 32 位平台的内存。
CALL POKELONG
现在可以直接将浮点数写入基于 32 位平台和 64 位平台的内存。
CALL SCAN
返回字符表达式中给定单词的位置和长度。
DATDIF
已将“ACT/360”和“ACT/365”这两个值添加到 basis 参数,并在美国证券业协会出版的文档中添加了一条参考信息。
FSEP
为十六进制字符分隔符添加了一个可选参数。
INDEX
添加了说明如何处理开头空格和结尾空格的示例。
LAG
添加了关于 LAG 函数内存限制的信息。
SCAN
返回字符表达式中的第 n 个单词。
ZIPSTATE
在文档中添加了关于美国陆军邮局 (Army Post Office, APO) 和美国海军邮局 (Fleet Post Office, FPO) 的信息。
RX 函数集和 CALL 例程已从文档中删除,取而代之的是一组 PRX 函数和 CALL 例程。这些 PRX 函数和 CALL 例程在 SAS 以前的版本中已可以使用,可以提供强大的功能。
以下为已删除的 RX 函数和 CALL 例程:
RXMATCH 函数
RXPARSE 函数
RXCHANGE CALL 例程
RXFREE CALL 例程
RXSUBSTR CALL 例程
SCANQ 函数和 CALL SCANQ 例程已从文档中删除,由功能强大的 SCAN 函数和 CALL SCAN 例程取代。

以上参考文献来源主要为: SAS9.2随机帮助  美国SAS研究所  2009

原创文章: ”最全的SAS9.2函数列表二“,转载请注明: 转自SAS资源资讯列表

本文链接地址: http://saslist.net/archives/98


22 11月 10 最全的SAS9.2函数列表一


SAS提供了大量的内置函数,并且在数量和内容上不断的发展改进,从版本9.2开始还提供了自定义函数功能。使用合适的函数,将会使你的工作效率加倍。2008年我在SASor论坛上贴了一个SAS9.2新增函数的列表,具体见论坛帖子;2009年我曾经在技术博客上对SAS函数做了比较深入的讨论,对SAS函数从版本6到版本9.2进行了细致的综述,详见SAS函数&CALL例程介绍与实例精选,并在SAS爱好者上海聚会分享了这一内容,当时的PPT见“SAS函数和CALL 例程的发展”。

当时所关注的函数其实仅仅集中于SAS常规函数,尽管如此,SAS9.2 的常规函数已达到499个。庞大的函数库确实给SASor们带来了非常多的方便,但是仓库式的SAS builted in帮助太杂乱,常常让人有一种“不识庐山真面目,只缘身在此山中”的感觉。有时,需要的函数找不到,找到的函数又不合适。其实SAS很体贴地不断增加高效的函数来精简你的代码和提高编程速度,可惜很多函数,SASor们并不知晓,常常看到别人使用的时候,才惊叹“原来SAS已经提供了这样的函数,我编了半天小算法”,或者“白费这么大劲,编了个宏”等等。这里按类列出SAS9.2版本的函数,供大家参考。

按不同的使用环境,SAS一共有七大类函数:

一,常规函数 ;二,windows环境下函数;三,OpenVMS虚拟内存环境下函数;四,z/OS操作环境下函数,五,宏语言函数;六,多国语言函数,七,其他函数

第一类函数常规函数最常用,数量也最多,这里依次列出所有的常规函数。

Character 字符函数


函数名称 功能
ANYALNUM Function Searches a character string for an alphanumeric character, and returns the first position at which the character is found.
ANYALPHA Function Searches a character string for an alphabetic character, and returns the first position at which the character is found.
ANYCNTRL Function Searches a character string for a control character, and returns the first position at which that character is found.
ANYDIGIT Function Searches a character string for a digit, and returns the first position at which the digit is found.
ANYFIRST Function Searches a character string for a character that is valid as the first character in a SAS variable name under VALIDVARNAME=V7, and returns the first position at which that character is found.
ANYGRAPH Function Searches a character string for a graphical character, and returns the first position at which that character is found.
ANYLOWER Function Searches a character string for a lowercase letter, and returns the first position at which the letter is found.
ANYNAME Function Searches a character string for a character that is valid in a SAS variable name under VALIDVARNAME=V7, and returns the first position at which that character is found.
ANYPRINT Function Searches a character string for a printable character, and returns the first position at which that character is found.
ANYPUNCT Function Searches a character string for a punctuation character, and returns the first position at which that character is found.
ANYSPACE Function Searches a character string for a white-space character (blank, horizontal and vertical tab, carriage return, line feed, and form feed), and returns the first position at which that character is found.
ANYUPPER Function Searches a character string for an uppercase letter, and returns the first position at which the letter is found.
ANYXDIGIT Function Searches a character string for a hexadecimal character that represents a digit, and returns the first position at which that character is found.
BYTE Function Returns one character in the ASCII or the EBCDIC collating sequence.
CALL CATS Routine Removes leading and trailing blanks, and returns a concatenated character string.
CALL CATT Routine Removes trailing blanks, and returns a concatenated character string.
CALL CATX Routine Removes leading and trailing blanks, inserts delimiters, and returns a concatenated character string.
CALL COMPCOST Routine Sets the costs of operations for later use by the COMPGED function
CALL MISSING Routine Assigns missing values to the specified character or numeric variables.
CALL SCAN Routine Returns the position and length of the nth word from a character string.
CAT Function Does not remove leading or trailing blanks, and returns a concatenated character string.
CATQ Function Concatenates character or numeric values by using a delimiter to separate items and by adding quotation marks to strings that contain the delimiter.
CATS Function Removes leading and trailing blanks, and returns a concatenated character string.
CATT Function Removes trailing blanks, and returns a concatenated character string.
CATX Function Removes leading and trailing blanks, inserts delimiters, and returns a character string.
CHAR Function Returns a single character from a specified position in a character string.
CHOOSEC Function Returns a character value that represents the results of choosing from a list of arguments.
CHOOSEN Function Returns a numeric value that represents the results of choosing from a list of arguments.
COALESCEC Function Returns the first non-missing value from a list of character arguments.
COLLATE Function Returns a character string in ASCII or EBCDIC collating sequence.
COMPARE Function Returns the position of the leftmost character by which two strings differ, or returns 0 if there is no difference.
COMPBL Function Removes multiple blanks from a character string.
COMPGED Function Returns the generalized edit distance between two strings.
COMPLEV Function Returns the Levenshtein edit distance between two strings.
COMPRESS Function Returns a character string with specified characters removed from the original string.
COUNT Function Counts the number of times that a specified substring appears within a character string.
COUNTC Function Counts the number of characters in a string that appear or do not appear in a list of characters.
COUNTW Function Counts the number of words in a character string.
DEQUOTE Function Removes matching quotation marks from a character string that begins with a quotation mark, and deletes all characters to the right of the closing quotation mark.
FIND Function Searches for a specific substring of characters within a character string.
FINDC Function Searches a string for any character in a list of characters.
FINDW Function Returns the character position of a word in a string, or returns the number of the word in a string.
FIRST Function Returns the first character in a character string.
IFC Function Returns a character value based on whether an expression is true, false, or missing.
INDEX Function Searches a character expression for a string of characters, and returns the position of the string’s first character for the first occurrence of the string.
INDEXC Function Searches a character expression for any of the specified characters, and returns the position of that character.
INDEXW Function Searches a character expression for a string that is specified as a word, and returns the position of the first character in the word.
LEFT Function Left-aligns a character string.
LENGTH Function Returns the length of a non-blank character string, excluding trailing blanks, and returns 1 for a blank character string.
LENGTHC Function Returns the length of a character string, including trailing blanks.
LENGTHM Function Returns the amount of memory (in bytes) that is allocated for a character string.
LENGTHN Function Returns the length of a character string, excluding trailing blanks.
LOWCASE Function Converts all letters in an argument to lowercase.
MD5 Function Returns the result of the message digest of a specified string.
MISSING Function Returns a numeric result that indicates whether the argument contains a missing value.
NLITERAL Function Converts a character string that you specify to a SAS name literal.
NOTALNUM Function Searches a character string for a non-alphanumeric character, and returns the first position at which the character is found.
NOTALPHA Function Searches a character string for a nonalphabetic character, and returns the first position at which the character is found.
NOTCNTRL Function Searches a character string for a character that is not a control character, and returns the first position at which that character is found.
NOTDIGIT Function Searches a character string for any character that is not a digit, and returns the first position at which that character is found.
NOTFIRST Function Searches a character string for an invalid first character in a SAS variable name under VALIDVARNAME=V7, and returns the first position at which that character is found.
NOTGRAPH Function Searches a character string for a non-graphical character, and returns the first position at which that character is found.
NOTLOWER Function Searches a character string for a character that is not a lowercase letter, and returns the first position at which that character is found.
NOTNAME Function Searches a character string for an invalid character in a SAS variable name under VALIDVARNAME=V7, and returns the first position at which that character is found.
NOTPRINT Function Searches a character string for a nonprintable character, and returns the first position at which that character is found.
NOTPUNCT Function Searches a character string for a character that is not a punctuation character, and returns the first position at which that character is found.
NOTSPACE Function Searches a character string for a character that is not a white-space character (blank, horizontal and vertical tab, carriage return, line feed, and form feed), and returns the first position at which that character is found.
NOTUPPER Function Searches a character string for a character that is not an uppercase letter, and returns the first position at which that character is found.
NOTXDIGIT Function Searches a character string for a character that is not a hexadecimal character, and returns the first position at which that character is found.
NVALID Function Checks the validity of a character string for use as a SAS variable name.
PROPCASE Function Converts all words in an argument to proper case.
QUOTE Function Adds double quotation marks to a character value.
RANK Function Returns the position of a character in the ASCII or EBCDIC collating sequence.
REPEAT Function Returns a character value that consists of the first argument repeated n+1 times.
REVERSE Function Reverses a character string.
RIGHT Function Right aligns a character expression.
SCAN Function Returns the nth word from a character string.
SOUNDEX Function Encodes a string to facilitate searching.
SPEDIS Function Determines the likelihood of two words matching, expressed as the asymmetric spelling distance between the two words.
STRIP Function Returns a character string with all leading and trailing blanks removed.
SUBPAD Function Returns a substring that has a length you specify, using blank padding if necessary.
SUBSTR (left of =) Function Replaces character value contents.
SUBSTR (right of =) Function Extracts a substring from an argument.
SUBSTRN Function Returns a substring, allowing a result with a length of zero.
TRANSLATE Function Replaces specific characters in a character string.
TRANSTRN Function Replaces all occurrences of a substring found in a character string, allowing a zero-length replacement string.
TRANWRD Function Replaces or removes all occurrences of a substring in a character string.
TRIM Function Removes trailing blanks from a character string, and returns one blank if the string is missing.
TRIMN Function Removes trailing blanks from character expressions, and returns a string with a length of zero if the expression is missing.
UPCASE Function Converts all letters in an argument to uppercase.
VERIFY Function Returns the position of the first character in a string that is not in any of several other strings.

日期和时间函数  Date and Time

CALL IS8601_CONVERT Routine Converts an ISO 8601 interval to datetime and duration values, or converts datetime and duration values to an ISO 8601 interval.
DATDIF Function Returns the number of days between two dates.
DATE Function Returns the current date as a SAS date value.
DATEJUL Function Converts a Julian date to a SAS date value.
DATEPART Function Extracts the date from a SAS datetime value.
DATETIME Function Returns the current date and time of day as a SAS datetime value.
DAY Function Returns the day of the month from a SAS date value.
DHMS Function Returns a SAS datetime value from date, hour, minute, and second values.
HMS Function Returns a SAS time value from hour, minute, and second values.
HOLIDAY Function Returns a SAS date value of a specified holiday for a specified year.
HOUR Function Returns the hour from a SAS time or datetime value.
INTCINDEX Function Returns the cycle index when a date, time, or datetime interval and value are specified.
INTCK Function Returns the count of the number of interval boundaries between two dates, two times, or two datetime values.
INTCYCLE Function Returns the date, time, or datetime interval at the next higher seasonal cycle when a date, time, or datetime interval is specified.
INTFIT Function Returns a time interval that is aligned between two dates.
INTFMT Function Returns a recommended SAS format when a date, time, or datetime interval is specified.
INTGET Function Returns a time interval based on three date or datetime values.
INTINDEX Function Returns the seasonal index when a date, time, or datetime interval and value are specified.
INTNX Function Increments a date, time, or datetime value by a given time interval, and returns a date, time, or datetime value.
INTSEAS Function Returns the length of the seasonal cycle when a date, time, or datetime interval is specified.
INTSHIFT Function Returns the shift interval that corresponds to the base interval.
INTTEST Function Returns 1 if a time interval is valid, and returns 0 if a time interval is invalid.
JULDATE Function Returns the Julian date from a SAS date value.
JULDATE7 Function Returns a seven-digit Julian date from a SAS date value.
MDY Function Returns a SAS date value from month, day, and year values.
MINUTE Function Returns the minute from a SAS time or datetime value.
MONTH Function Returns the month from a SAS date value.
NWKDOM Function Returns the date for the nth occurrence of a weekday for the specified month and year.
QTR Function Returns the quarter of the year from a SAS date value.
SECOND Function Returns the second from a SAS time or datetime value.
TIME Function Returns the current time of day as a numeric SAS time value.
TIMEPART Function Extracts a time value from a SAS datetime value.
TODAY Function Returns the current date as a numeric SAS date value.
WEEK Function Returns the week-number value.
WEEKDAY Function From a SAS date value, returns an integer that corresponds to the day of the week.
YEAR Function Returns the year from a SAS date value.
YRDIF Function Returns the difference in years between two dates.
YYQ Function Returns a SAS date value from year and quarter year values.

描述统计函数 Descriptive Statistics

CMISS Function Counts the number of missing arguments.
CSS Function Returns the corrected sum of squares.
CV Function Returns the coefficient of variation.
EUCLID Function Returns the Euclidean norm of the non-missing arguments.
GEOMEAN Function Returns the geometric mean.
GEOMEANZ Function Returns the geometric mean, using zero fuzzing.
HARMEAN Function Returns the harmonic mean.
HARMEANZ Function Returns the harmonic mean, using zero fuzzing.
IQR Function Returns the interquartile range.
KURTOSIS Function Returns the kurtosis.
LARGEST Function Returns the kth largest non-missing value.
LPNORM Function Returns the Lp norm of the second argument and subsequent non-missing arguments.
MAD Function Returns the median absolute deviation from the median.
MAX Function Returns the largest value.
MEAN Function Returns the arithmetic mean (average).
MEDIAN Function Returns the median value.
MIN Function Returns the smallest value.
MISSING Function Returns a numeric result that indicates whether the argument contains a missing value.
N Function Returns the number of non-missing numeric values.
NMISS Function Returns the number of missing numeric values.
ORDINAL Function Returns the kth smallest of the missing and nonmissing values.
PCTL Function Returns the percentile that corresponds to the percentage.
RANGE Function Returns the range of the nonmissing values.
RMS Function Returns the root mean square of the nonmissing arguments.
SKEWNESS Function Returns the skewness of the nonmissing arguments.
SMALLEST Function Returns the kth smallest nonmissing value.
STD Function Returns the standard deviation of the nonmissing arguments.
STDERR Function Returns the standard error of the mean of the nonmissing arguments.
SUM Function Returns the sum of the nonmissing arguments.
SUMABS Function Returns the sum of the absolute values of the non-missing arguments.
USS Function Returns the uncorrected sum of squares of the nonmissing arguments.
VAR Function Returns the variance of the nonmissing arguments.

数学函数 Mathematical

ABS Function Returns the absolute value.
AIRY Function Returns the value of the Airy function.
BETA Function Returns the value of the beta function.
CALL LOGISTIC Routine Applies the logistic function to each argument.
CALL SOFTMAX Routine Returns the softmax value.
CALL STDIZE Routine Standardizes the values of one or more variables.
CALL TANH Routine Returns the hyperbolic tangent.
CNONCT Function Returns the noncentrality parameter from a chi-square distribution.
COALESCE Function Returns the first non-missing value from a list of numeric arguments.
CONSTANT Function Computes machine and mathematical constants.
DAIRY Function Returns the derivative of the AIRY function.
DEVIANCE Function Returns the deviance based on a probability distribution.
DIGAMMA Function Returns the value of the digamma function.
ERF Function Returns the value of the (normal) error function.
ERFC Function Returns the value of the complementary (normal) error function.
EXP Function Returns the value of the exponential function.
FACT Function Computes a factorial.
FNONCT Function Returns the value of the noncentrality parameter of an F distribution.
GAMMA Function Returns the value of the gamma function.
GCD Function Returns the greatest common divisor for one or more integers.
IBESSEL Function Returns the value of the modified Bessel function.
JBESSEL Function Returns the value of the Bessel function.
LCM Function Returns the least common multiple.
LGAMMA Function Returns the natural logarithm of the Gamma function.
LOG Function Returns the natural (base e) logarithm.
LOG1PX Function Returns the log of 1 plus the argument.
LOG10 Function Returns the logarithm to the base 10.
LOG2 Function Returns the logarithm to the base 2.
LOGBETA Function Returns the logarithm of the beta function.
MOD Function Returns the remainder from the division of the first argument by the second argument, fuzzed to avoid most unexpected floating-point results.
MODZ Function Returns the remainder from the division of the first argument by the second argument, using zero fuzzing.
MSPLINT Function Returns the ordinate of a monotonicity-preserving interpolating spline.
SIGN Function Returns the sign of a value.
SQRT Function Returns the square root of a value.
TNONCT Function Returns the value of the noncentrality parameter from the Student’s t distribution.
TRIGAMMA Function Returns the value of the trigamma function.

分布密度函数、分布函数 Probability

CDF Function Returns a value from a cumulative probability distribution.
LOGCDF Function Returns the logarithm of a left cumulative distribution function.
LOGPDF Function Returns the logarithm of a probability density (mass) function.
LOGSDF Function Returns the logarithm of a survival function.
PDF Function Returns a value from a probability density (mass) distribution.
POISSON Function Returns the probability from a Poisson distribution.
PROBBETA Function Returns the probability from a beta distribution.
PROBBNML Function Returns the probability from a binomial distribution.
PROBBNRM Function Returns a probability from a bivariate normal distribution.
PROBCHI Function Returns the probability from a chi-square distribution.
PROBF Function Returns the probability from an F distribution.
PROBGAM Function Returns the probability from a gamma distribution.
PROBHYPR Function Returns the probability from a hypergeometric distribution.
PROBMC Function Returns a probability or a quantile from various distributions for multiple comparisons of means.
PROBNEGB Function Returns the probability from a negative binomial distribution.
PROBNORM Function Returns the probability from the standard normal distribution.
PROBT Function Returns the probability from a t distribution.
SDF Function Returns a survival function.

二进制逻辑操作符 Bitwise Logical Operations

BAND Function Returns the bitwise logical AND of two arguments.
BLSHIFT Function Returns the bitwise logical left shift of two arguments.
BNOT Function Returns the bitwise logical NOT of an argument.
BOR Function Returns the bitwise logical OR of two arguments.
BRSHIFT Function Returns the bitwise logical right shift of two arguments.
BXOR Function Returns the bitwise logical EXCLUSIVE OR of two arguments.

数组函数  Array

DIM Function Returns the number of elements in an array.
HBOUND Function Returns the upper bound of an array.
LBOUND Function Returns the lower bound of an array.

字符串配对函数 Character String Matching

CALL PRXCHANGE Routine Performs a pattern-matching replacement.
CALL PRXDEBUG Routine Enables Perl regular expressions in a DATA step to send debugging output to the SAS log.
CALL PRXFREE Routine Frees memory that was allocated for a Perl regular expression.
CALL PRXNEXT Routine Returns the position and length of a substring that matches a pattern, and iterates over multiple matches within one string.
CALL PRXPOSN Routine Returns the start position and length for a capture buffer.
CALL PRXSUBSTR Routine Returns the position and length of a substring that matches a pattern.
PRXCHANGE Function Performs a pattern-matching replacement.
PRXMATCH Function Searches for a pattern match and returns the position at which the pattern is found.
PRXPAREN Function Returns the last bracket match for which there is a match in a pattern.
PRXPARSE Function Compiles a Perl regular expression (PRX) that can be used for pattern matching of a character value.
PRXPOSN Function Returns a character string that contains the value for a capture buffer.

组合函数 Combinatorial

ALLCOMB Function Generates all combinations of the values of n variables taken k at a time in a minimal change order.
ALLPERM Function Generates all permutations of the values of several variables in a minimal change order.
CALL ALLCOMB Routine Generates all combinations of the values of n variables taken k at a time in a minimal change order.
CALL ALLCOMBI Routine Generates all combinations of the indices of n objects taken k at a time in a minimal change order.
CALL ALLPERM Routine Generates all permutations of the values of several variables in a minimal change order.
CALL GRAYCODE Routine Generates all subsets of n items in a minimal change order.
CALL LEXCOMB Routine Generates all distinct combinations of the non-missing values of n variables taken k at a time in lexicographic order.
CALL LEXCOMBI Routine Generates all combinations of the indices of n objects taken k at a time in lexicographic order.
CALL LEXPERK Routine Generates all distinct permutations of the non-missing values of n variables taken k at a time in lexicographic order.
CALL LEXPERM Routine Generates all distinct permutations of the non-missing values of several variables in lexicographic order.
CALL RANPERK Routine Randomly permutes the values of the arguments, and returns a permutation of k out of n values.
CALL RANPERM Routine Randomly permutes the values of the arguments.
COMB Function Computes the number of combinations of n elements taken r at a time.
GRAYCODE Function Generates all subsets of n items in a minimal change order.
LCOMB Function Computes the logarithm of the COMB function; that is, the logarithm of the number of combinations of n objects taken r at a time.
LEXCOMB Function Generates all distinct combinations of the non-missing values of n variables taken k at a time in lexicographic order.
LEXCOMBI Function Generates all combinations of the indices of n objects taken k at a time in lexicographic order.
LEXPERK Function Generates all distinct permutations of the non-missing values of n variables taken k at a time in lexicographic order.
LEXPERM Function Generates all distinct permutations of the non-missing values of several variables in lexicographic order.
LFACT Function Computes the logarithm of the FACT (factorial) function.
LPERM Function Computes the logarithm of the PERM function; that is, the logarithm of the number of permutations of n objects, with the option of including r number of elements.
PERM Function Computes the number of permutations of n items that are taken r at a time.

双曲线函数 Hyperbolic

ARCOSH Function Returns the inverse hyperbolic cosine.
ARSINH Function Returns the inverse hyperbolic sine.
ARTANH Function Returns the inverse hyperbolic tangent.
COSH Function Returns the hyperbolic cosine.
SINH Function Returns the hyperbolic sine.
TANH Function Returns the hyperbolic tangent.

宏函数 Macro

CALL EXECUTE Routine Resolves the argument, and issues the resolved value for execution at the next step boundary.
CALL SYMPUT Routine Assigns DATA step information to a macro variable.
CALL SYMPUTX Routine Assigns a value to a macro variable, and removes both leading and trailing blanks.
RESOLVE Function Returns the resolved value of the argument after it has been processed by the macro facility.
SYMEXIST Function Returns an indication of the existence of a macro variable.
SYMGET Function Returns the value of a macro variable during DATA step execution.
SYMGLOBL Function Returns an indication of whether a macro variable is in global scope to the DATA step during DATA step execution.
SYMLOCAL Function Returns an indication of whether a macro variable is in local scope to the DATA step during DATA step execution.

分位数函数 Quantile

BETAINV Function Returns a quantile from the beta distribution.
CINV Function Returns a quantile from the chi-square distribution.
FINV Function Returns a quantile from the F distribution.
GAMINV Function Returns a quantile from the gamma distribution.
PROBIT Function Returns a quantile from the standard normal distribution.
QUANTILE Function Returns the quantile from a distribution that you specify.
TINV Function Returns a quantile from the t distribution.

搜索函数 Search

WHICHC Function Searches for a character value that is equal to the first argument, and returns the index of the first matching value.
WHICHN Function Searches for a numeric value that is equal to the first argument, and returns the index of the first matching value.

排序函数Sort

CALL SORTC Routine Sorts the values of character arguments.
CALL SORTN Routine Sorts the values of numeric arguments.

外部例程 External Routines

CALL MODULE Routine Calls an external routine without any return code.
MODULEC Function Calls an external routine and returns a character value.
MODULEN Function Calls an external routine and returns a numeric value.

三角函数Trigonometric

ARCOS Function Returns the arccosine.
ARSIN Function Returns the arcsine.
ATAN Function Returns the arc tangent.
ATAN2 Function Returns the arc tangent of the ratio of two numeric variables.
COS Function Returns the cosine.
SIN Function Returns the sine.
TAN Function Returns the tangent.

截断函数 Truncation

CEIL Function Returns the smallest integer that is greater than or equal to the argument, fuzzed to avoid unexpected floating-point results.
CEILZ Function Returns the smallest integer that is greater than or equal to the argument, using zero fuzzing.
FLOOR Function Returns the largest integer that is less than or equal to the argument, fuzzed to avoid unexpected floating-point results.
FLOORZ Function Returns the largest integer that is less than or equal to the argument, using zero fuzzing.
FUZZ Function Returns the nearest integer if the argument is within 1E-12 of that integer.
INT Function Returns the integer value, fuzzed to avoid unexpected floating-point results.
INTZ Function Returns the integer portion of the argument, using zero fuzzing.
ROUND Function Rounds the first argument to the nearest multiple of the second argument, or to the nearest integer when the second argument is omitted.
ROUNDE Function Rounds the first argument to the nearest multiple of the second argument, and returns an even multiple when the first argument is halfway between the two nearest multiples.
ROUNDZ Function Rounds the first argument to the nearest multiple of the second argument, using zero fuzzing.
TRUNC Function Truncates a numeric value to a specified number of bytes.

变量控制函数Variable Control

CALL LABEL Routine Assigns a variable label to a specified character variable.
CALL SET Routine Links SAS data set variables to DATA step or macro variables that have the same name and data type.
CALL VNAME Routine Assigns a variable name as the value of a specified variable.

算术函数 Arithmetic

DIVIDE Returns the result of a division that handles special missing values for ODS output.

返回数值函数 Numeric

IFN Function Returns a numeric value based on whether an expression is true, false, or missing.

网络工具函数Web Tools

HTMLDECODE Function Decodes a string that contains HTML numeric character references or HTML character entity references, and returns the decoded string.
HTMLENCODE Function Encodes characters using HTML character entity references, and returns the encoded string.
URLDECODE Function Returns a string that was decoded using the URL escape syntax.
URLENCODE Function Returns a string that was encoded using the URL escape syntax.

外部文件函数 External Files

DCLOSE Function Closes a directory that was opened by the DOPEN function.
DCREATE Function Returns the complete pathname of a new, external directory.
DINFO Function Returns information about a directory.
DNUM Function Returns the number of members in a directory.
DOPEN Function Opens a directory, and returns a directory identifier value.
DOPTNAME Function Returns directory attribute information.
DOPTNUM Function Returns the number of information items that are available for a directory.
DREAD Function Returns the name of a directory member.
DROPNOTE Function Deletes a note marker from a SAS data set or an external file.
FAPPEND Function Appends the current record to the end of an external file.
FCLOSE Function Closes an external file, directory, or directory member.
FCOL Function Returns the current column position in the File Data Buffer (FDB).
FDELETE Function Deletes an external file or an empty directory.
FEXIST Function Verifies the existence of an external file that is associated with a fileref.
FGET Function Copies data from the File Data Buffer (FDB) into a variable.
FILEEXIST Function Verifies the existence of an external file by its physical name.
FILENAME Function Assigns or deassigns a fileref to an external file, directory, or output device.
FILEREF Function Verifies whether a fileref has been assigned for the current SAS session.
FINFO Function Returns the value of a file information item.
FNOTE Function Identifies the last record that was read, and returns a value that the FPOINT function can use.
FOPEN Function Opens an external file and returns a file identifier value.
FOPTNAME Function Returns the name of an item of information about a file.
FOPTNUM Function Returns the number of information items that are available for an external file.
FPOINT Function Positions the read pointer on the next record to be read.
FPOS Function Sets the position of the column pointer in the File Data Buffer (FDB).
FPUT Function Moves data to the File Data Buffer (FDB) of an external file, starting at the FDB’s current column position.
FREAD Function Reads a record from an external file into the File Data Buffer (FDB).
FREWIND Function Positions the file pointer to the start of the file.
FRLEN Function Returns the size of the last record that was read, or, if the file is opened for output, returns the current record size.
FSEP Function Sets the token delimiters for the FGET function.
FWRITE Function Writes a record to an external file.
MOPEN Function Opens a file by directory ID and member name, and returns either the file identifier or a 0.
PATHNAME Function Returns the physical name of an external file or a SAS library, or returns a blank.
RENAME Function Renames a member of a SAS library, an entry in a SAS catalog, an external file, or a directory.
SYSMSG Function Returns error or warning message text from processing the last data set or external file function.
SYSRC Function Returns a system error number.

金融函数Financial

BLACKCLPRC Function Calculates call prices for European options on futures, based on the Black model.
BLACKPTPRC Function Calculates put prices for European options on futures, based on the Black model.
BLKSHCLPRC Function Calculates call prices for European options on stocks, based on the Black-Scholes model.
BLKSHPTPRC Function Calculates put prices for European options on stocks, based on the Black-Scholes model.
COMPOUND Function Returns compound interest parameters.
CONVX Function Returns the convexity for an enumerated cash flow.
CONVXP Function Returns the convexity for a periodic cash flow stream, such as a bond.
DACCDB Function Returns the accumulated declining balance depreciation.
DACCDBSL Function Returns the accumulated declining balance with conversion to a straight-line depreciation.
DACCSL Function Returns the accumulated straight-line depreciation.
DACCSYD Function Returns the accumulated sum-of-years-digits depreciation.
DACCTAB Function Returns the accumulated depreciation from specified tables.
DEPDB Function Returns the declining balance depreciation.
DEPDBSL Function Returns the declining balance with conversion to a straight-line depreciation.
DEPSL Function Returns the straight-line depreciation.
DEPSYD Function Returns the sum-of-years-digits depreciation.
DEPTAB Function Returns the depreciation from specified tables.
DUR Function Returns the modified duration for an enumerated cash flow.
DURP Function Returns the modified duration for a periodic cash flow stream, such as a bond.
FINANCE Function Computes financial calculations such as depreciation, maturation, accrued interest, net present value, periodic savings, and internal rates of return.
GARKHCLPRC Function Calculates call prices for European options on stocks, based on the Garman-Kohlhagen model.
GARKHPTPRC Function Calculates put prices for European options on stocks, based on the Garman-Kohlhagen model.
INTRR Function Returns the internal rate of return as a fraction.
IRR Function Returns the internal rate of return as a percentage.
MARGRCLPRC Function Calculates call prices for European options on stocks, based on the Margrabe model.
MARGRPTPRC Function Calculates put prices for European options on stocks, based on the Margrabe model.
MORT Function Returns amortization parameters.
NETPV Function Returns the net present value as a fraction.
NPV Function Returns the net present value with the rate expressed as a percentage.
PVP Function Returns the present value for a periodic cash flow stream (such as a bond), with repayment of principal at maturity.
SAVING Function Returns the future value of a periodic saving.
YIELDP Function Returns the yield-to-maturity for a periodic cash flow stream, such as a bond.

产生随机数函数 Random Number

CALL RANBIN Routine Returns a random variate from a binomial distribution.
CALL RANCAU Routine Returns a random variate from a Cauchy distribution.
CALL RANEXP Routine Returns a random variate from an exponential distribution.
CALL RANGAM Routine Returns a random variate from a gamma distribution.
CALL RANNOR Routine Returns a random variate from a normal distribution.
CALL RANPOI Routine Returns a random variate from a Poisson distribution.
CALL RANTBL Routine Returns a random variate from a tabled probability distribution.
CALL RANTRI Routine Returns a random variate from a triangular distribution.
CALL RANUNI Routine Returns a random variate from a uniform distribution.
CALL STREAMINIT Routine Specifies a seed value to use for subsequent random number generation by the RAND function.
NORMAL Function Returns a random variate from a normal, or Gaussian, distribution.
RANBIN Function Returns a random variate from a binomial distribution.
RANCAU Function Returns a random variate from a Cauchy distribution.
RAND Function Generates random numbers from a distribution that you specify.
RANEXP Function Returns a random variate from an exponential distribution.
RANGAM Function Returns a random variate from a gamma distribution.
RANNOR Function Returns a random variate from a normal distribution.
RANPOI Function Returns a random variate from a Poisson distribution.
RANTBL Function Returns a random variate from a tabled probability distribution.
RANTRI Function Returns a random variate from a triangular distribution.
RANUNI Function Returns a random variate from a uniform distribution.
UNIFORM Function Returns a random variate from a uniform distribution.

SAS文件IO函数 SAS File I/O

ATTRC Function Returns the value of a character attribute for a SAS data set.
ATTRN Function Returns the value of a numeric attribute for a SAS data set.
CEXIST Function Verifies the existence of a SAS catalog or SAS catalog entry.
CLOSE Function Closes a SAS data set.
CUROBS Function Returns the observation number of the current observation.
DROPNOTE Function Deletes a note marker from a SAS data set or an external file.
DSNAME Function Returns the SAS data set name that is associated with a data set identifier.
ENVLEN Function Returns the length of an environment variable.
EXIST Function Verifies the existence of a SAS library member.
FETCH Function Reads the next non-deleted observation from a SAS data set into the Data Set Data Vector (DDV).
FETCHOBS Function Reads a specified observation from a SAS data set into the Data Set Data Vector (DDV).
GETVARC Function Returns the value of a SAS data set character variable.
GETVARN Function Returns the value of a SAS data set numeric variable.
IORCMSG Function Returns a formatted error message for _IORC_.
LIBNAME Function Assigns or deassigns a libref for a SAS library.
LIBREF Function Verifies that a libref has been assigned.
NOTE Function Returns an observation ID for the current observation of a SAS data set.
OPEN Function Opens a SAS data set.
PATHNAME Function Returns the physical name of an external file or a SAS library, or returns a blank.
POINT Function Locates an observation that is identified by the NOTE function.
RENAME Function Renames a member of a SAS library, an entry in a SAS catalog, an external file, or a directory.
REWIND Function Positions the data set pointer at the beginning of a SAS data set.
SYSMSG Function Returns error or warning message text from processing the last data set or external file function.
SYSRC Function Returns a system error number.
VARFMT Function Returns the format that is assigned to a SAS data set variable.
VARINFMT Function Returns the informat that is assigned to a SAS data set variable.
VARLABEL Function Returns the label that is assigned to a SAS data set variable.
VARLEN Function Returns the length of a SAS data set variable.
VARNAME Function Returns the name of a SAS data set variable.
VARNUM Function Returns the number of a variable’s position in a SAS data set.
VARTYPE Function Returns the data type of a SAS data set variable.

特殊函数 Special

ADDR Function Returns the memory address of a variable on a 32-bit platform.
ADDRLONG Function Returns the memory address of a variable on 32-bit and 64-bit platforms.
CALL POKE Routine Writes a value directly into memory on a 32-bit platform.
CALL POKELONG Routine Writes a value directly into memory on 32-bit and 64-bit platforms.
CALL SLEEP Routine For a specified period of time, suspends the execution of a program that invokes this CALL routine.
CALL SYSTEM Routine Submits an operating environment command for execution.
DIF Function Returns differences between an argument and its nth lag.
GETOPTION Function Returns the value of a SAS system or graphics option.
INPUT Function Returns the value that is produced when SAS converts an expression using the specified informat.
INPUTC Function Enables you to specify a character informat at run time.
INPUTN Function Enables you to specify a numeric informat at run time.
LAG Function Returns values from a queue.
PEEK Function Stores the contents of a memory address in a numeric variable on a 32-bit platform.
PEEKC Function Stores the contents of a memory address in a character variable on a 32-bit platform.
PEEKCLONG Function Stores the contents of a memory address in a character variable on 32-bit and 64-bit platforms.
PEEKLONG Function Stores the contents of a memory address in a numeric variable on 32-bit and 64-bit platforms.
PTRLONGADD Function Returns the pointer address as a character variable on 32-bit and 64-bit platforms.
PUT Function Returns a value using a specified format.
PUTC Function Enables you to specify a character format at run time.
PUTN Function Enables you to specify a numeric format at run time.
SLEEP Function For a specified period of time, suspends the execution of a program that invokes this function.
SYSGET Function Returns the value of the specified operating environment variable.
SYSPARM Function Returns the system parameter string.
SYSPROCESSID Function Returns the process ID of the current process.
SYSPROCESSNAME Function Returns the process name that is associated with a given process ID, or returns the name of the current process.
SYSPROD Function Determines whether a product is licensed.
SYSTEM Function Issues an operating environment command during a SAS session, and returns the system return code.
UUIDGEN Function Returns the short or binary form of a Universal Unique Identifier (UUID).

变量信息函数 Variable Information

CALL VNEXT Routine Returns the name, type, and length of a variable that is used in a DATA step.
VARRAY Function Returns a value that indicates whether the specified name is an array.
VARRAYX Function Returns a value that indicates whether the value of the specified argument is an array.
VFORMAT Function Returns the format that is associated with the specified variable.
VFORMATD Function Returns the decimal value of the format that is associated with the specified variable.
VFORMATDX Function Returns the decimal value of the format that is associated with the value of the specified argument.
VFORMATN Function Returns the format name that is associated with the specified variable.
VFORMATNX Function Returns the format name that is associated with the value of the specified argument.
VFORMATW Function Returns the format width that is associated with the specified variable.
VFORMATWX Function Returns the format width that is associated with the value of the specified argument.
VFORMATX Function Returns the format that is associated with the value of the specified argument.
VINARRAY Function Returns a value that indicates whether the specified variable is a member of an array.
VINARRAYX Function Returns a value that indicates whether the value of the specified argument is a member of an array.
VINFORMAT Function Returns the informat that is associated with the specified variable.
VINFORMATD Function Returns the decimal value of the informat that is associated with the specified variable.
VINFORMATDX Function Returns the decimal value of the informat that is associated with the value of the specified variable.
VINFORMATN Function Returns the informat name that is associated with the specified variable.
VINFORMATNX Function Returns the informat name that is associated with the value of the specified argument.
VINFORMATW Function Returns the informat width that is associated with the specified variable.
VINFORMATWX Function Returns the informat width that is associated with the value of the specified argument.
VINFORMATX Function Returns the informat that is associated with the value of the specified argument.
VLABEL Function Returns the label that is associated with the specified variable.
VLABELX Function Returns the label that is associated with the value of the specified argument.
VLENGTH Function Returns the compile-time (allocated) size of the specified variable.
VLENGTHX Function Returns the compile-time (allocated) size for the variable that has a name that is the same as the value of the argument.
VNAME Function Returns the name of the specified variable.
VNAMEX Function Validates the value of the specified argument as a variable name.
VTYPE Function Returns the type (character or numeric) of the specified variable.
VTYPEX Function Returns the type (character or numeric) for the value of the specified argument.
VVALUE Function Returns the formatted value that is associated with the variable that you specify.
VVALUEX Function Returns the formatted value that is associated with the argument that you specify.

美国人专用函数 与地理位置有关的一些函数 美国人对美国人真好

函数名 作用
Distance

距离函数

GEODIST Function Returns the geodetic distance between two latitude and longitude coordinates.
ZIPCITYDISTANCE Function Returns the geodetic distance between two zip code locations.
State and Zip Code

州和邮政编码

FIPNAME Function Converts two-digit FIPS codes to uppercase state names.
FIPNAMEL Function Converts two-digit FIPS codes to mixed case state names.
FIPSTATE Function Converts two-digit FIPS codes to two-character state postal codes.
STFIPS Function Converts state postal codes to FIPS state codes.
STNAME Function Converts state postal codes to uppercase state names.
STNAMEL Function Converts state postal codes to mixed case state names.
ZIPCITY Function Returns a city name and the two-character postal code that corresponds to a zip code.
ZIPCITYDISTANCE Function Returns the geodetic distance between two zip code locations.
ZIPFIPS Function Converts zip codes to two-digit FIPS codes.
ZIPNAME Function Converts zip codes to uppercase state names.
ZIPNAMEL Function Converts zip codes to mixed case state names.
ZIPSTATE Function Converts zip codes to two-character state postal codes.

原创文章: ”最全的SAS9.2函数列表一“,转载请注明: 转自SAS资源资讯列表

本文链接地址: http://saslist.net/archives/97


20 11月 10 最全的SAS系统快捷键列表


几乎每个软件都有自己的快捷键(又叫快速键或热键)。使用快捷键有时候为了方便、减少鼠标点击,有时候可以加快操作速度。国外有个有趣的网站,专门收集各类通用软件的快捷键,由于SAS不够大众,没有收录SAS的快捷键。当然SAS也有许多自己的快捷键。其中我最常用的键有F3(运行代码)、F6(查看log信息)、Ctrl + / (注释代码)、Ctrl + Shift + / (取消代码注释)等等,用的不是非常多,多了记不住,但是少了又觉得缺少些什么。当然不同的人有不同的使用习惯,想必大家都有自己偏好的快捷键,这里就列出SAS9.2全部的快捷键,一共有4类,大家可以根据自己的需要来查找合适自己的快捷键。

查找的时候需要说明的有许多都是和微软系统通用的快捷方式,因此很多微软系统中熟悉的快捷键可以试试。下面红色加粗部分的快捷键,是我或SAS公司认为最有用的快捷键。大家可以选择性的看看。

SAS系统一共下面有4类快捷键,其中部分有重复, 第一类可自定义。

一,微软系统下默认的设定

Default Key Definitions under Windows

这个可以点F9快捷键或者命令框敲keys都可以跳出这个快捷键窗口。作用部分为空的是未定义,可以自己定义这些空白的作用。

快捷键 作用 快捷键 作用
F1 Help 跳出帮助文件 Alt + F1
F2 reshow Alt + F2
F3 End 运行代码 Alt + F3
F4 Recall 调回提交的代码,非增强型编辑器有效。 Alt + F11
F5 Wpgm Alt + F12
F6 Log 日志窗口 Ctrl + B libref 显示数据逻辑库的目录
F7 Output 结果窗口 Ctrl + D Dir 显示数据逻辑库的目录
F8 zoom off; submit Ctrl + E Clear 清除当前窗口如output,log
F9 keys 默认快捷键 Ctrl + G
F11 command focus Ctrl + H Help    帮助
F12 Ctrl + I Options SAS系统选项设置
Shift + F1 Subtop Ctrl + J
Shift + F2 Ctrl + K cut (Program Editor only)
Shift + F6 Ctrl + L Log 日志窗口
Shift + F7 Left Ctrl + M Mark 标记,增强型编辑器不支持
Shift + F8 Right Ctrl + Q Filename 当前文件
Shift + F9 Ctrl + R Rfind 查找
Shift + F10 Wpopup  鼠标右键 Ctrl + T Title 标题内容
Shift + F11 Ctrl + U unmark
Shift + F12 dmcopylsv Ctrl + W access Explorer window 资源管理器
Ctrl + F1 Ctrl + Y
Ctrl + F2 RMB Wpopup 鼠标右键
Ctrl + F3 Shift + RMB
Ctrl + F11 Ctrl + RMB
Ctrl + F12 MMB 鼠标中键,未定义
Shift+ MMB
Ctrl + MMB

二 打印预览快捷键

Keyboard Shortcuts within Print Preview

快捷键 作用
Alt + N Next page or Page Down    翻后页
Alt + P Previous page or Page Up   翻前页
Alt + Z Zoom                   缩小
Alt + H Help                    帮助文件
Alt + R Print                    打印
Alt + C or 

Alt + F4

Close the window         关闭窗口

三 增强型编辑器中的快捷键

Keyboard Shortcuts within the Enhanced Editor

红色加粗为SAS公司认为最有用的快捷键

类别 快捷键 作用
缩写Abbreviation 

这个东东很少见,目前还不知道怎么用。

Ctrl + Shift + A Add a new abbreviation
Alt + F1 + No Selection Bring up word tip
Esc Hide the current word tip
代码 

Code Folding

Alt + Ctrl + Number pad – Collapse all folding blocks收缩代码块
Alt + Number pad – Collapse current line
Alt + Ctrl + Number pad + Expand all folding blocks 扩展代码块
Alt + Number pad + Expand current line
Alt + Number pad * Toggle expand current line
命令/宏支持 

Command/Macro Support

Ctrl + Shift + M Add or change macros
Ctrl + F1 Execute the last recorded macro执行最后一个记录中的宏
Alt + F8 Play a command/macro
Alt + Shift + R Start/Complete macro
编辑 

Edit

Ctrl + C Copy selection 复制
Ctrl + X Cut selection 剪切
Delete Delete current character 删除
Backspace or Shift + Backspace Delete previous character
Ctrl + Delete Delete to next word start
Ctrl + Backspace Delete to previous word start
Enter Insert a carriage return
Ctrl + V Paste from clipboard 粘贴
Ctrl + Y 

Alt + Shift + Backspace

Redo
Ctrl + Z 

Alt + Backspace

Undo
帮助 

Help

place the insertion point within a procedure name and press F1 Get Help for a SAS procedure 

查找对应帮助主题

F1 Context Help 帮助文件
行标记 

Line Markers

F2 Go to the next marked line
Shift + F2 Go to the previous marked line
Ctrl + F2 Toggle marker on the current line
导航 

Navigation

Ctrl + G Go to line (interactive)
Ctrl + Page Up 

Ctrl + Home

Move cursor to the top of the file
Ctrl + Page Down 

Ctrl + End

Move cursor to the bottom of the file
Down Move cursor down
Page Down Move cursor down a page
Left Move cursor left
Right Move cursor right
Home Move cursor to beginning of line
End Move cursor to end of line
Ctrl + [  

Ctrl + ]

Move cursor to matching brace/parentheses移动光标匹配 括号
Alt + [  

Alt + ]

Move cursor to matching DO/END keyword 移动光标匹配DO/END
Alt + Right Move cursor to next case change移动光标到下一个大小写转换处
Ctrl + Right Move cursor to next word start
Alt + Left Move cursor to previous case change移动光标到上一个大小写转换处
Ctrl + Left Move cursor to previous word start
Up Move cursor up
Page Up Move cursor up a page
Alt + Up Move cursor to the first visible line
Alt + Down Move cursor to the last visible line
Ctrl + Up Scroll screen down
Ctrl + Down Scroll screen up
Option Setting Insert Toggle insert/overwrite mode
选择 

Selection

Shift + Left Extend selection character left
Shift + Right Extend selection character right
Shift + Down Extend selection down
Shift + Page Down Extend selection down a page
Ctrl + Shift + Home 

Ctrl + Shift + Page Up

Extend selection to beginning of document
Shift + Home Extend selection to beginning of line
Ctrl + Shift + End 

Ctrl + Shift + Page Down

Extend selection to end of document
Shift + End Extend selection to end of line
Alt + Shift + Right Extend selection to next case change
Alt + Shift + Left Extend selection to previous case change
Shift + Up Extend selection up
Shift + Page Up Extend selection up a page
Ctrl + Shift + Left Extend selection to previous word start
Ctrl + Shift + Right Extend selection to the next word start
Ctrl + A Select all 选择全部
选择操作 

Selection Operations

Ctrl + Shift + W Clean up whitespace 清除空白
Ctrl + / Comment the selection with line comments   给选定代码加注释符号/**/
Ctrl + Shift + L 选定字母文本变小写
Ctrl + Shift + U 选定字母文本变大写
Tab + Selection Tab selection
Ctrl + Shift + / Undo the Comment   去除注释/**/
Shift + Tab + Selection Left Tab selection

四  SAS主要窗口的键盘快捷键

Keyboard Shortcuts within the SAS Main Window

类别 快捷键 作用
对话框和入口Dialog boxes and Entry Fields Tab move to next field
Shift + Tab move to previous field
文本导航 

Navigate around Text

Ctrl + -> (right arrow) move to next word
Ctrl + <- (left arrow) move to previous word
Home move to beginning of line
End move to end of line
Ctrl + Home move to top 光标移到代码最前
Ctrl + End move to bottom光标移到代码最后
Page Up page up
Page Down page down
Ctrl + Page Up move to top
Ctrl + Page Down move to bottom
Ctrl + Tab navigate to the next open SAS window (NEXTWIND command)
Ctrl + Shift + Tab navigate to the previous open SAS window (PREVWIND command)
标记文本 

Mark Text

Shift + -> (right arrow) mark while going to the right
Shift + <- (left arrow) mark while going to the left
Shift + Home mark to beginning of line
Shift + End mark to end of line
Shift + Ctrl + Home mark to top
Shift + Ctrl + End mark to bottom
Shift + Page Up page up and mark
Shift + Page Down page down and mark
Shift + Ctrl + Page Up mark to top
Shift + Ctrl + Page Down mark to bottom
Shift + MB1 extend the current marked text selection to the click position
剪切,复制,粘贴 

Cut, Copy, and Paste

Delete delete the next character (or marked text)
Ctrl + Delete delete from the insertion point position to the end of the current word
Ctrl + Backspace delete from the insertion point position to the start of the current word
Ctrl + MB1 selects the entire line (clicked line)
Ctrl + Z undo previous action
Ctrl + X cut selected text 剪切代码
Ctrl + C copy selected text to paste buffer复制
Ctrl + V paste text  粘贴
窗口控制 

Window Control

Alt switch focus to or from the main menu bar
Shift + F5 cascade the windows
Shift + F4 tile the windows vertically
Shift + F3 tile the windows horizontally
Ctrl + F6 next window 激活下一个窗口
Alt + F4 exit SAS 离开SAS系统
Ctrl + F4 close the active window
Shift + F10 open context menu
Resizing the Docking View Alt + W + S start docking view resizing
-> (right arrow) move the split bar a small amount to the right
<- (left arrow) move the split bar a small amount to the right
Ctrl + -> (right arrow) move the split bar a larger amount to the right
Ctrl + <- (left arrow) move the split bar a larger amount to the left
Home move the split bar all the way to the left
End move the split bar all the way to the right
Return accept the current size of the docking view and exit docking view resizing
Esc end docking view resizing without resizing the docking view
杂项 

Miscellaneous

Alt + Enter open the Properties dialog box for a selected object. This command is valid only in a Tree view or a List view.
Esc + letter (or number) color or highlighting attributes in NOTEPAD window

原创文章: ”最全的SAS系统快捷键列表“,转载请注明: 转自SAS资源资讯列表

本文链接地址: http://saslist.net/archives/93