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

Extract DDL in various formats, by table or library. More...

Go to the source code of this file.

Detailed Description

Data Definition Language relates to a set of SQL instructions used to create tables in SAS or a database. The macro can be used at table or library level. The default behaviour is to create DDL in SAS format.

Note - views are not currently supported.

Usage:

data test(index=(pk=(x y)/unique /nomiss));
  x=1;
  y='blah';
  label x='blah';
run;
proc sql; describe table &syslast;
%mp_getddl(work,test,flavour=tsql,showlog=YES)

SAS Macros

Parameters
[in]librefLibref of the library to create DDL for. Should already be assigned.
[in]dsdataset to create ddl for (optional)
[in]fref=(getddl) the fileref to which to append the DDL. If it does not exist, it will be created.
[in]flavour=(SAS) The type of DDL to create. Options:
  • SAS
  • TSQL
[in]

= (NO) Set to YES to show the DDL in the log

Parameters
[in]schema=() Choose a preferred schema name (default is to use actual schema, else libref)
[in]applydttm=(NO) For non SAS DDL, choose if columns are created with native datetime2 format or regular decimal type
Version
9.3
Author
Allan Bowe

Definition in file mp_getddl.sas.