楼主: zhou.wen
1876 2

[学习分享] [Z]Differences between scan and Call scan [推广有奖]

已卖:4460份资源

教授

9%

还不是VIP/贵宾

-

TA的文库  其他...

SAS Technology

威望
0
论坛币
31987 个
通用积分
6.2141
学术水平
283 点
热心指数
262 点
信用等级
257 点
经验
56058 点
帖子
396
精华
4
在线时间
1328 小时
注册时间
2010-10-12
最后登录
2018-3-9

初级学术勋章 初级热心勋章 中级学术勋章 中级热心勋章

楼主
zhou.wen 发表于 2013-5-24 12:12:48 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

A Brief Discussion of SAS Functions and Call Routines

If you have written any SAS program, you probably used several functions and have an intuitive idea of what functions do. SAS functions perform a computation or manipulation of a value and return a single value. For example, the MONTH function computes the month of the year from a SAS date; the ROUND function can round numeric values; the TODAY function returns the current date.


SAS functions take the form of a function name, followed by a set of parentheses. In these parentheses are usually one or more arguments. (Certain functions such as TODAY take no arguments, but you need to follow the function name with an opening parenthesis and a closing parenthesis anyway to tell SAS that you are referring to the TODAY function, not to a variable called TODAY.) These arguments provide information that the function needs to return a result. For example, the statement DAY_OF_WEEK = WEEKDAY (DATE); computes the day of the week from a SAS date and assigns it to the variable DAY_OF_WEEK. This function, as with all other SAS functions, returns a single value that is either assigned to a variable or used in a SAS expression.

Finally, the arguments to most SAS functions can be variable names, constants (if a character argument is needed, the constant must be in single or double quotation marks), or expressions (that may also contain other functions).


CALL routines have some similarity to SAS functions because they often perform similar operations. However, there are some important differences. CALL routines are not used in assignment statements. Instead, they stand alone as SAS statements. Multiple arguments in a CALL routine can be assigned new values by the routine. For example, the statement CALL SCAN (string, n, position, length); returns the position and the length of the nth "word" in the string. The SCAN function, on the other hand, returns only a single value—the nth word in the string. Indeed, the main reason for using a CALL routine instead of a function is to obtain more than one value in a single statement.




补充内容 (2013-11-3 17:16):
原文转自:http://my.safaribooksonline.com/ ... brief_discussion_of
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:differences difference call scan Between erence single set function current example

已有 1 人评分学术水平 热心指数 信用等级 收起 理由
zll_zh + 1 + 1 + 1 精彩帖子

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

本帖被以下文库推荐

Practice Is The Best Teacher!

沙发
zll_zh 发表于 2013-5-24 13:01:37
good post!

藤椅
boe 发表于 2013-5-24 13:10:50
学习了
Gorgeous girl , I love !

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-1 00:50