Production Ready Macros for SAS Application Developers File Reference

Export a dataset to SQL insert statements. More...

Go to the source code of this file.

Detailed Description

Converts dataset values to SQL insert statements for use across multiple database types.


data class;
  set sashelp.class;
proc sql;
%inc myref;
[in]dsThe dataset to be exported
[in]maxobs=(max) The max number of inserts to create
[out]outref=(0) The output fileref. If it does not exist, it is created. If it does exist, new records are APPENDED.
[out]schema=(0) The library (or schema) in which the target table is located. If not provided, is ignored.
[out]outds=(0) The output table to load. If not provided, will default to the table in the &ds parameter.
[in]flavour=(SAS) The SQL flavour to be applied to the output. Valid options:
  • SAS (default) - suitable for regular proc sql
  • PGSQL - Used for Postgres databases
[in]applydttm=(YES) If YES, any columns using datetime formats will be converted to native DB datetime literals

SAS Macros

Allan Bowe (credit mjsq)

Definition in file