Express “PUT all variables” in a data step to export SAS data

前端 未结 4 1234
星月不相逢
星月不相逢 2021-01-20 18:52

Goal: export an entire SAS dataset to a tab-delimited text file using a data step.

Problem: In every example that I can find, such as this one, one must specify ev

4条回答
  •  醉话见心
    2021-01-20 19:23

    In a datastep I find when I just want to get a list of the values using

    put (_all_)(=/); 
    

    For example:

    data a; 
      ref=today();
      monday = intnx('week1.2',ref,-1,'Begin');
      sunday = intnx('week1.2',ref,-1,'End');
      week_end_Friday=intnx('day',(intnx('weeks',ref,0,'end')),-1);
      week_end_cur=intnx('weeks',ref,0,'end');
      format _all_ weekdate.; 
      put (_all_)(=/);
    run; 
    

    /* or to look at a few records or modify for specific conditions */

    data test;
      set test;
      if _n_ < 5 then do;
        PUT (_ALL_)(=/);  
      end;
    run;
    

提交回复
热议问题