全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3701 5
2014-09-07
悬赏 5 个论坛币 已解决
rt,显谢谢

最佳答案

teihohou 查看完整内容

proc format; value typefmt 1='$groupx' 2='$groupy' 3='$groupz'; value $groupx 'positive'='agree' 'negative'='disagree' 'neutral'='notsure '; value $groupy 'positive'='accept' 'negative'='reject' 'neutral'='possible'; value $groupz 'positive'='pass ' 'n ...
二维码

扫码加我 拉你入群

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

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

全部回复
2014-9-7 20:51:56
proc format;
   value typefmt 1='$groupx'
                 2='$groupy'
                 3='$groupz';
   value $groupx 'positive'='agree'
                 'negative'='disagree'
                 'neutral'='notsure ';
   value $groupy 'positive'='accept'
                 'negative'='reject'
                 'neutral'='possible';

   value $groupz 'positive'='pass    '
                 'negative'='fail'
                 'neutral'='retest';
run;

data answers;
   length word $ 8;
   input type response $;
   respfmt = put(type, typefmt.);
   word = putc(response, respfmt);
   datalines;
1 positive
1 negative
1 neutral
2 positive
2 negative
2 neutral
3 positive
3 negative
3 neutral
;
二维码

扫码加我 拉你入群

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

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

2014-9-7 21:49:24
原本有一个数值型的变量,我copy成字符型的,想规定它的长度
二维码

扫码加我 拉你入群

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

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

2014-9-8 03:44:52
put(source,format)
二维码

扫码加我 拉你入群

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

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

2014-9-8 09:12:28
teihohou 发表于 2014-9-8 03:44
put(source,format)
format具体填写什么,比如我生成的字符型变量长度是14
二维码

扫码加我 拉你入群

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

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

2014-9-8 09:59:05
In this example, the first statement converts the values of CC, a numeric variable, into the four-character hexadecimal format, and the second writes the same value that the PUT function returns.
cchex=put(cc,hex4.);
put cc hex4.;
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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