Macros for SAS Application Developers
https://github.com/sasjs/core
mp_ds2ddl.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Fetches DDL for a specific table
4  @details Uses mp_getddl under the hood
5 
6  @param [in] libds library.dataset to create ddl for
7  @param [in] fref= (getddl) the fileref to which to _append_ the DDL. If it
8  does not exist, it will be created.
9  @param [in] flavour= (SAS) The type of DDL to create. Options:
10  @li SAS
11  @li TSQL
12 
13  @param [in]showlog= (NO) Set to YES to show the DDL in the log
14  @param [in] schema= () Choose a preferred schema name (default is to use
15  actual schema, else libref)
16  @param [in] applydttm= (NO) For non SAS DDL, choose if columns are created with
17  native datetime2 format or regular decimal type
18 
19  <h4> SAS Macros </h4>
20  @li mp_getddl.sas
21 
22 **/
23 
24 %macro mp_ds2ddl(libds,fref=getddl,flavour=SAS,showlog=YES,schema=
25  ,applydttm=NO
26 )/*/STORE SOURCE*/;
27 
28 %local libref;
29 %let libds=%upcase(&libds);
30 %let libref=%scan(&libds,1,.);
31 %if &libref=&libds %then %let libds=WORK.&libds;
32 
33 %mp_getddl(%scan(&libds,1,.)
34  ,%scan(&libds,2,.)
35  ,fref=&fref
36  ,flavour=SAS
37  ,showlog=&showlog
38  ,schema=&schema
39  ,applydttm=&applydttm
40 )
41 
42 %mend mp_ds2ddl;