Convert SAS dataset to Text file

/ Published in: SAS
Save to your folder(s)

This SAS macro will convert a dataset to a text file

Copy this code and paste it in your HTML
  1. libname BC "C:\file\path";
  3. %macro filecreate;
  4. %do x=1 %to 700;
  5. filename lb18 "C:\folder\lb&x..txt" LRECL=8006;
  6. data _null_;
  7. set BC.some_data (firstobs=&x obs=&x);
  8. file lb18 dsd dlm='09'x;
  9. put var1;
  10. run;
  11. %end;
  12. %mend;
  14. %filecreate;


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.