Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mp_lib2inserts.sas File Reference

Convert all data in a library to SQL insert statements. More...

Go to the source code of this file.

Detailed Description

Gets list of members then calls the mp_ds2inserts() macro. Usage:

%mp_getddl(sashelp, schema=work, fref=tempref)

%mp_lib2inserts(sashelp, schema=work, outref=tempref)

%inc tempref;

The output will be one file in the outref fileref.

SAS Macros

Parameters
[in]libLibrary in which to convert all datasets to inserts
[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]maxobs=(max) The max number of observations (per table) to create
[out]outref=Output fileref in which to create the insert statements. If it exists, it will be appended to, otherwise it will be created.
[out]schema=(0) The schema of the target database, or the libref.
[in]applydttm=(YES) If YES, any columns using datetime formats will be converted to native DB datetime literals
Version
9.2
Author
Allan Bowe

Definition in file mp_lib2inserts.sas.