Macros for SAS Application Developers File Reference

Efficient import of arbitrary CSV using a dataset as template. More...

Go to the source code of this file.

Detailed Description

Used to import relevant columns from a large CSV using a dataset to provide the types and lengths. Assumes that a header row is provided, and datarows start on line 2. Extra columns in both the CSV and base dataset are ignored.


filename mycsv temp;
data _null_;
  file mycsv;
  put 'name,age,nickname';
  put 'John,48,Jonny';
  put 'Jennifer,23,Jen';

inref=fileref to the CSV
outds=output ds (lib.ds format)
view=Set to YES or NO to determine whether the output should be a view or not. Default is NO (not a view).
baseds=Template dataset on which to create the input statement. Is used to determine types, lengths, and any informats.
Allan Bowe

SAS Macros

Definition in file