diff --git a/base/mp_getddl.sas b/base/mp_getddl.sas index 3975015d..b9425b42 100644 --- a/base/mp_getddl.sas +++ b/base/mp_getddl.sas @@ -217,7 +217,72 @@ run; run; %end; %end; +%else %if &flavour=PGSQL %then %do; + /* if schema does not exist, set to be same as libref */ + %local schemaactual; + proc sql noprint; + select sysvalue into: schemaactual + from dictionary.libnames + where libname="&libref" and engine='POSTGRES'; + %let schema=%sysfunc(coalescec(&schemaactual,&schema,&libref)); + %do x=1 %to %sysfunc(countw(&dsnlist)); + %let curds=%scan(&dsnlist,&x); + data _null_; + file &fref mod; + put "/* Postgres Flavour DDL for &schema..&curds */"; + data _null_; + file &fref mod; + set &colinfo (where=(upcase(memname)="&curds")) end=last; + length fmt $32; + if _n_=1 then do; + if memtype='DATA' then do; + put "CREATE TABLE &schema..&curds ("; + end; + else do; + put "CREATE VIEW &schema..&curds ("; + end; + put " "@@; + end; + else put " ,"@@; + format=upcase(format); + if 1=0 then; /* dummy if */ + %if &applydttm=YES %then %do; + else if format=:'DATETIME' then fmt=' TIMESTAMP '; + %end; + else if type='num' then fmt=' DOUBLE PRECISION'; + else fmt='VARCHAR('!!cats(length)!!')'; + if notnull='yes' then notnul=' NOT NULL'; + put name fmt notnul; + run; + data _null_; + length ds $128; + set &idxinfo (where=(memname="&curds")); + file &fref mod; + by idxusage indxname; + if unique='yes' then uniq=' unique'; + ds=cats(libname,'.',memname); + if first.indxname then do; + if unique='yes' and nomiss='yes' then do; + put ' ,PRIMARY KEY '; + end; + else if unique='yes' then do; + /* add nonclustered in case of multiple unique indexes */ + put ' ,UNIQUE '; + end; + put ' (' name ; + end; + else put ' ,' name ; + if last.indxname then do; + put ' )'; + end; + run; + data _null_; + file &fref mod; + put ');'; + run; + %end; +%end; %if &showlog=YES %then %do; options ps=max; data _null_; diff --git a/doxy/build.sh b/doxy/build.sh index 875254b6..3ac02c4f 100755 --- a/doxy/build.sh +++ b/doxy/build.sh @@ -30,7 +30,7 @@ doxygen Doxyfile # refresh github pages site git clone git@github.com:sasjs/core.github.io.git cd core.github.io -git rm -r * +rm -r * mv $BUILD_FOLDER/out/doxy/* . echo 'core.sasjs.io' > CNAME git add * diff --git a/meta/mm_adduser2group.sas b/meta/mm_adduser2group.sas index aa2d2df6..6a2becef 100644 --- a/meta/mm_adduser2group.sas +++ b/meta/mm_adduser2group.sas @@ -1,17 +1,18 @@ /** - @file + @file mm_adduser2group.sas @brief Adds a user to a group @details Adds a user to a metadata group. The macro first checks whether the user is in that group, and if not, the user is added. Usage: - %mm_adduser2group(user=sasdemo - ,group=someGroup) + %mm_adduser2group(user=sasdemo + ,group=someGroup) @param user= the user name (not displayname) @param group= the group to which to add the user + @param mdebug= set to 1 to show debug info in log @warning the macro does not check inherited group memberships - it looks at direct members only