导出带有尾随空格和引号的变量

发布于 2024-09-16 03:32:16 字数 212 浏览 2 评论 0原文

如何导出带有尾随空格和引号的字符变量?

例如:

data x;
format x $quote17.;
x='ruby';
put x=;
run;

(log extract)
x="ruby"

获得以下结果的最有效方法是什么?

x="ruby             "

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

eg:

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             "

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

青瓷清茶倾城歌 2024-09-23 03:32:16
data x;
  Format x $17. q$1.;
  x='Ruby';
  q='"';
  qxq=cat(q,x,q);
  Put qxq=;
run;
data x;
  Format x $17. q$1.;
  x='Ruby';
  q='"';
  qxq=cat(q,x,q);
  Put qxq=;
run;
心如狂蝶 2024-09-23 03:32:16

找到了一种方法..

data x;
format x $19.;
x='ruby';
x=quote(subpad(x,1,17));
put x=;
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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文