全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
954 4
2017-03-26
悬赏 5 个论坛币 已解决
QQ截图20170326192540.png
怎么将图片中带有“x”的改为可以计算的数值型,比如将8.02 x 10^4 变成 80200 的数值型

最佳答案

wwang111 查看完整内容

data test; input hbvdna $20.; cards; 8.02×10^4 1.82×10^5
二维码

扫码加我 拉你入群

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

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

全部回复
2017-3-26 19:30:13
data test;
input hbvdna $20.;
cards;
8.02×10^4
1.82×10^5
<500
;

data _null_;
  set test end=last;
  hbvdna=tranwrd(hbvdna,"×","*");
  hbvdna=tranwrd(hbvdna,"^","**");
  if _n_=1 then call execute("data wanted;");
  if index(hbvdna,"*") then call execute("hbvdna="||quote(strip(hbvdna))||';num_hbvdna='||strip(hbvdna)||';output;');
  else call execute("hbvdna="||quote(strip(hbvdna))||';num_hbvdna=.;output;');
  if last then call execute("run;");
run;
二维码

扫码加我 拉你入群

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

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

2017-3-27 12:07:48
wwang111 发表于 2017-3-26 19:30
data test;
input hbvdna $20.;
cards;
厉害
二维码

扫码加我 拉你入群

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

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

2017-3-27 16:59:10
data a;
input x $20.;
cards;
8.02×10^4
1.82×10^5
<500

1.8232×10^7
;
run;

data b;
set a;
if index(x,'×') and index(x,'^') then do;
   a=input(scan(x,1,'×'),best.);
   b=10**input(scan(x,2,'^'),best.);
   c=a*b;
end;
run;
二维码

扫码加我 拉你入群

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

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

2017-3-27 20:39:23
lovexialulu 发表于 2017-3-27 16:59
data a;
input x $20.;
cards;
你这个更简便
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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