【问题标题】:Writing binary files using SAS?使用 SAS 编写二进制文件?
【发布时间】:2010-12-02 08:30:21
【问题描述】:

我们目前使用 SAS 导入二进制文件并对其数据运行查询。为此,我们使用 SAS website.

上显示的技术

例如,我们是这样读取数据的:

data work.binary_data; 
infile "&ifName" lrecl=8 recfm=f;
input @1 a PIB1.
      @2 b PIB1.
      @3 c PIB1.
      @4 d PIB1.
      @5 e PIB1.
      @6 f PIB1.
      @7 g PIB1.
      @8 h PIB1.
run;

我们需要将数据集发送给客户端,以便他们在 SAS 中进行操作。然后他们会将其发回,我需要将其转换回内部程序所需的二进制格式。数据集的大小可能会超过 10GB,所以我不确定先转换为文本文件,然后再从文本文件写入二进制文件(使用 c++ 或其他东西)

有谁知道如何使用 SAS 写入二进制格式,意思是,与我们最初读入的文件格式相同?

【问题讨论】:

    标签: binary sas


    【解决方案1】:

    我不再可以使用 SAS 进行测试,但我相信您可以将上面的逻辑颠倒过来:

    data _null_; 
      set data; 
      file 'c:\fileout.dat'; 
      put @1 a PIB1. 
          @2 b PIB1.
          @3 c PIB1.
          @4 d PIB1.
          @5 e PIB1.
          @6 f PIB1.
          @7 g PIB1.
          @8 h PIB1.
      ;
    run;
    

    其中 PIB1 代表您的binary format

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-31
      • 2015-11-29
      • 2017-10-20
      相关资源
      最近更新 更多