SAS 打印到文件
我有一个这样创建的 SAS 文件句柄:
filename filehandle "report.htm";
我有几个文件(打包的 Javascript 文件),它们的行很长(长度> 32K)。 我想要一种将它们的内容附加到上面的文件中的方法。
我知道如果我这样做:
data _null_;
file filehandle;
put "very long string here";
run;
有时,很长的字符串会插入换行符,我不希望这样做,因为它可能会破坏 Javascript 代码。
理想情况下,类似:
x "cat packed.js >> report.htm";
效果很好,但我只有文件句柄,而不是原始文件路径。
哪些例程可以帮助我有效地完成工作? 有没有办法读取打包的 JS 文件并使用 put 将它们逐行或逐个字符地写出来?
谢谢!
I have a SAS file handle created as such:
filename filehandle "report.htm";
I have several files (packed Javascript files) which have very long lines (>32K in length). I would like a way to append their contents to the file above.
I know that if I do:
data _null_;
file filehandle;
put "very long string here";
run;
Sometimes, the very long string has line breaks inserted, which I don't want since it could break the Javascript code.
Ideally, something like:
x "cat packed.js >> report.htm";
would work well but I only have the file handle, not the original file path.
What routines could help me accomplish the job efficiently? Is there some way to read the packed JS file and write them out using put, either line by line or character by character?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用路径名函数从文件句柄中检索完整路径,然后根据需要使用 x 命令。
例如:
You can retrieve the full path from the file handle using the pathname function then use the x command as you wanted to.
For example: