将 SAS 数据集作为文本文件导出到 UNIX....带有分隔符 '~|~' [英] Exporting SAS DataSet on to UNIX as a text file....with delimiter '~|~'

查看:50
本文介绍了将 SAS 数据集作为文本文件导出到 UNIX....带有分隔符 '~|~'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 SAS 数据集作为文本文件导出到 UNIX 文件夹,分隔符为~|~".

I'm trying to export a SAS data set on to UNIX folder as a text file with delimiter as '~|~'.

Here is the code I'm using....
PROC EXPORT DATA=Exp_TXT
         OUTFILE="/fbrms01/dev/projects/tadis003/Export_txt_OF_New.txt"
         DBMS=DLM REPLACE;
     DELIMITER="~|~";
     PUTNAMES=YES;
RUN;

这是我在 UNIX 上得到的输出..... 数据中缺少部分分隔符但在变量名称中获取整个分隔符....

Here is the output I'm getting on UNIX.....Missing part of delimiter in the data but getting whole delimiter in variable names....

Num~|~Name~|~Age
1~A~10
2~B~11
3~C~12

知道为什么我只在数据中获取分隔符的一部分吗????

Any idea why I'm getting part of delimiter in the data only????

谢谢,山姆.

推荐答案

我的猜测是 PROC EXPORT 不支持使用多个字符分隔符.通常,列分隔符只是一个字符.因此,您可能需要编写自己的代码来执行此操作.

My guess is that PROC EXPORT does not support using multiple character delimiters. Normally, column delimiters are just a single character. So, you will probably need to write your own code to do this.

PROC EXPORT 用于分隔文件生成普通的旧 SAS 代码,然后执行.您应该会在 SAS 日志中看到代码,您可以从中获取并根据需要进行更改.

PROC EXPORT for delimited files generates plain old SAS code that is then executed. You should see the code in the SAS log, from where you can grab it and alter it as needed.

请参阅我对其他问题的回答,了解可能对您有帮助的 SAS 宏.您不能完全按照书面使用它,但它应该可以帮助您创建满足您需求的版本.

Please see my answer to this other question for a SAS macro that might help you. You cannot use it exactly as written, but it should help you create a version that meets your needs.

这篇关于将 SAS 数据集作为文本文件导出到 UNIX....带有分隔符 '~|~'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆