解释put语句的用法

时间:2016-03-23 21:31:47

标签: sas

  data _null_;
   %let _EFIRR_=0;
    %let _EFIREC_=0;

  file '/home/abc/demo/sale.csv' delimiter=',' DSD;
      put country=;
       run;

我编写了这段代码,但无法在日志中找到任何内容。难道我不能在日志中获得country = xyz吗?

1 个答案:

答案 0 :(得分:1)

FILE语句用于写出文件。我相信您试图从文件中读取国家/地区值

您需要INFILE声明:

data _null_;
  %let _EFIRR_=0;
  %let _EFIREC_=0;

  /* infile statement points to the file which is being read */
  infile '/home/abc/demo/sale.csv' delimiter=',' DSD;

  /* Input statement specifies which columns to populate from the file */
  input country $;

  /* A put statement in a data step without an associated */
  /* file statement will output lines in the log */
  put country=;
run;