全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2397 1
2020-08-27
以下两段代码,为什么输出结果是一样的,两段代码的区别是一个加了:,一个没加。加冒号的作用我是知道的,这两段代码中是因为有&才使得结果一样吗?那&在其中所起的作用是?

data fengefu;
input name &$50. city &$50.;/*用&符号告诉sas不以变量中的一个空格数作为分隔,*/
cards;
peter parker  山东省 蓬莱市  /*为区分变量中的空格,在parker和山东省中间使用了2个空格数作为变量的分隔符*/
ross geller  山东省 青岛市 市南区
;
proc print;
run;

data fengefu;
input name &:$50. city &:$50.;/*用&符号告诉sas不以变量中的一个空格数作为分隔*/
cards;
peter parker  山东省 蓬莱市  /*为区分变量中的空格,在parker和山东省中间使用了2个空格数作为变量的分隔符*/
ross geller  山东省 青岛市 市南区
;
proc print;
run;


二维码

扫码加我 拉你入群

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

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

全部回复
2020-9-14 17:27:47
&
indicates that a character value can have one or more single embedded blanks. This
format modifier reads the value from the next non-blank column until the pointer
reaches two consecutive blanks, the defined length of the variable, or the end of the
input line, whichever comes first.
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群