data a;
input x$6.;
cards;
2
34
098
;
run;
proc sql;
update a
set x=repeat('0',5-length(compress(x)))||x where length(x) lt 6;
quit;
|
楼主: sun_man
|
6639
19
1转换为000001,怎么写程序呀?在线等。。。 |
|
已卖:2329份资源 学术权威 37%
-
|
10论坛币
最佳答案data a;
input x$6.;
cards;
2
34
098
;
run;
proc sql;
update a
set x=repeat('0',5-length(compress(x)))||x where length(x) lt 6;
quit;
回帖推荐SAS has a format zw.d w, d are integers. See example below.
Zw.d Format
--------------------------------------------------------------------------------
Writes standard numeric data with leading 0s Category: Numeric
Alignment: right
1 data _null_;
2 do i= 1 to 5;
3 put i= i= z6.;
4 end;
5 run;
i=1 i=000001
i=2 i=000002
i=3 i=000003
i=4 ...
xiaosanmao 发表于2楼 查看完整内容 data a;
input x$6.;
cards;
2
34
098
;
run;
proc sql;
update a
set x=repeat('0',5-length(compress(x)))||x where length(x) lt 6;
quit;
本帖被以下文库推荐
| ||||||||||||||||||||
|
小剑一把 混迹经管之家 呵呵
|
|||||||||||||||||||||
|
|
| ||
| ||
加好友,备注cda京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明


