SAS中文论坛

标题: 好心人帮我解释2句话什么意思 [打印本页]

作者: shiyiming    时间: 2010-2-24 09:01
标题: 好心人帮我解释2句话什么意思
year2=input(compress(year(last_month)||'0101'),yymmdd10.);
        interval=intck('month',year2,last_month)+1;
作者: shiyiming    时间: 2010-2-24 09:57
标题: Re: 好心人帮我解释2句话什么意思
year(last_month ) 返回年分,再将年连上0101, 随后将年0101, 变成numeric

第二条计算year2 和last_month之间有几个月 (+1)
作者: shiyiming    时间: 2010-2-24 10:14
标题: Re: 好心人帮我解释2句话什么意思
compress什么作用
作者: shiyiming    时间: 2010-2-24 10:17
标题: Re: 好心人帮我解释2句话什么意思
it is equivalent to

[code:l31sjgh3]interval = month(last_month);[/code:l31sjgh3]

isn't it?

****
作者: shiyiming    时间: 2010-2-24 10:50
标题: Re: 好心人帮我解释2句话什么意思
Function compress() is to squeeze out blank spaces, in particular the leading ones, in the character.
That is why works on the following functions also: left(), strip(), scan(character, 1) and so on.




欢迎光临 SAS中文论坛 (https://mysas.net/forum/) Powered by Discuz! X3.2