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';

[in]inref=(0) Fileref to the CSV
[out]outds=(0) Output ds (lib.ds format)
[in]view=(NO) Set to YES or NO to determine whether the output should be a view or not. Default is NO (not a view).
[in]baseds=(0) 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