开发者

Export variable with trailing spaces and quotes

How can I export a character variable WITH trailing spaces and quotes?

eg:

开发者_C百科data x;
format x $quote17.;
x='ruby';
put x=;
run;

(log extract)
x="ruby"

What is the most efficient way to get the following result?

x="ruby             "


data x;
  Format x $17. q$1.;
  x='Ruby';
  q='"';
  qxq=cat(q,x,q);
  Put qxq=;
run;


found a way..

data x;
format x $19.;
x='ruby';
x=quote(subpad(x,1,17));
put x=;
run;

not sure if this is the most efficient though!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜