开发者

Export variable with trailing spaces and quotes

开发者 https://www.devze.com 2023-01-14 02:39 出处:网络
How can I export a character variable WITH trailing spaces and quotes? eg: 开发者_C百科data x; format x $quote17.;

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

精彩评论

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

关注公众号