1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-01 15:00:04 +00:00

Compare commits

..

7 Commits

Author SHA1 Message Date
Allan Bowe
de2f32da36 Merge pull request #248 from sasjs/mm_createdataset_update
fix: cater for case of zero cols in mm_createdataset.sas
2022-05-31 14:02:13 +03:00
Allan Bowe
6fa0fc5dc6 fix: cater for case of zero cols in mm_createdataset.sas 2022-05-31 11:01:06 +00:00
Allan Bowe
73e3d9d419 Merge pull request #247 from sasjs/allanbowe/mp-abort-on-sasjs-server-246
fix: ensuring webout on abort, closes #246
2022-05-30 15:42:47 +03:00
Allan Bowe
5f2229e3d5 fix: ensuring webout on abort, closes #246 2022-05-30 12:38:34 +00:00
Allan Bowe
d19c4a517c chore: updated document header 2022-05-20 19:01:47 +00:00
munja
c47480f60c fix: space in dependencies 2022-05-20 12:55:39 +01:00
munja
295211bb72 fix: doc config and test-folders 2022-05-20 11:30:38 +01:00
15 changed files with 97 additions and 54 deletions

54
all.sas
View File

@@ -2269,8 +2269,8 @@ Usage:
%end;
%end;
/* Stored Process Server web app context */
%if %symexist(_METAFOLDER)
/* Web App Context */
%if %symexist(_PROGRAM)
or "&SYSPROCESSNAME "="Compute Server "
or &mode=INCLUDE
%then %do;
@@ -13801,24 +13801,23 @@ run;
%mend mm_createapplication;/**
@file mm_createdataset.sas
@brief Create a dataset from a metadata definition
@file
@brief Create an empty dataset from a metadata definition
@details This macro was built to support viewing empty tables in
https://datacontroller.io - a free evaluation copy is available by
contacting the author (Allan Bowe).
https://datacontroller.io
The table can be retrieved using LIBRARY.DATASET reference, or directly
using the metadata URI.
The table can be retrieved using LIBRARY.DATASET reference, or directly
using the metadata URI.
The dataset is written to the WORK library.
The dataset is written to the WORK library.
usage:
Usage:
%mm_createdataset(libds=metlib.some_dataset)
%mm_createdataset(libds=metlib.some_dataset)
or
or
%mm_createdataset(tableuri=G5X8AFW1.BE00015Y)
%mm_createdataset(tableuri=G5X8AFW1.BE00015Y)
<h4> SAS Macros </h4>
@li mm_getlibs.sas
@@ -13828,9 +13827,9 @@ run;
@param libds= library.dataset metadata source. Note - table names in metadata
can be longer than 32 chars (just fyi, not an issue here)
@param tableuri= Metadata URI of the table to be created
@param outds= The dataset to create, default is `work.mm_createdataset`.
The table name needs to be 32 chars or less as per SAS naming rules.
@param mdebug= set DBG to 1 to disable DEBUG messages
@param outds= (work.mm_createdataset) The dataset to create. The table name
needs to be 32 chars or less as per SAS naming rules.
@param mdebug= (0) Set to 1 to enable DEBUG messages
@version 9.4
@author Allan Bowe
@@ -13856,14 +13855,23 @@ run;
%mm_gettables(uri=&liburi,outds=&tempds2)
data _null_;
set &tempds2;
if upcase(tablename)="%upcase(%scan(&libds,2,.))";
where upcase(tablename)="%upcase(%scan(&libds,2,.))";
&dbg putlog tableuri=;
call symputx('tableuri',tableuri);
run;
%end;
data;run;%let tempds3=&syslast;
data;run;
%let tempds3=&syslast;
%mm_getcols(tableuri=&tableuri,outds=&tempds3)
%if %mf_nobs(&tempds3)=0 %then %do;
%put &libds (&tableuri) has no columns defined!!;
data &outds;
run;
%return;
%end;
data _null_;
set &tempds3 end=last;
if _n_=1 then call execute('data &outds;');
@@ -26841,7 +26849,8 @@ endsub;
@file mx_createwebservice.sas
@brief Create a web service in SAS 9, Viya or SASjs
@details Creates a SASJS ready Stored Process in SAS 9, a Job Execution
Service in SAS Viya, and a Stored Program on SASjs Server
Service in SAS Viya, or a Stored Program on SASjs Server - depending on the
executing environment.
Usage:
@@ -26863,7 +26872,9 @@ Usage:
%webout(OBJ,example2) * Object format, easier to work with ;
%webout(CLOSE)
;;;;
%mp_createwebservice(path=/Public/app/common,name=appInit,replace=YES)
%* create the service (including webout macro and dependencies);
%mx_createwebservice(path=/Public/app/common,name=appInit,replace=YES)
<h4> SAS Macros </h4>
@li mf_getplatform.sas
@@ -26882,7 +26893,6 @@ Usage:
location
@param [in] mDebug= (0) set to 1 to show debug messages in the log
@version 9.2
@author Allan Bowe
**/
@@ -26950,7 +26960,7 @@ Usage:
@param [out] outref= (0) The fileref to create, which will contain the source
code.
<h4> SAS Macros </h4>
<h4> SAS Macros </h4>
@li mf_getplatform.sas
@li mm_getstpcode.sas
@li ms_getfile.sas

View File

@@ -84,8 +84,8 @@
%end;
%end;
/* Stored Process Server web app context */
%if %symexist(_METAFOLDER)
/* Web App Context */
%if %symexist(_PROGRAM)
or "&SYSPROCESSNAME "="Compute Server "
or &mode=INCLUDE
%then %do;

View File

@@ -18,7 +18,17 @@
statements. Those starting `mp_` are macro _procedures_, which generate
SAS statements, and must therefore be applied accordingly.
*/
*/
/*! \dir ddl
* \brief Data Definition Language files
* \details Provides templates for commonly used tables in sasjs/core.
Attributes:
* OS independent
* No X command
* Prefixes: _mddl_
*/
/*! \dir fcmp
* \brief Macros for generating FCMP functions
@@ -94,15 +104,28 @@
*/
/*! \dir ddl
* \brief Data Definition Language files
* \details Provides templates for commonly used tables in sasjs/core.
Attributes:
/*! \dir tests/base
* \brief Tests for Base macros
*/
* OS independent
* No X command
* Prefixes: _mddl_
/*! \dir tests/ddlonly
* \brief Tests for DDL macros
*/
/*! \dir tests/sas9only
* \brief Tests for SAS Metadata macros
*/
/*! \dir tests/serveronly
* \brief Tests for SASjs Server macros
*/
/*! \dir tests/viyaonly
* \brief Tests for Viya macros
*/
/*! \dir tests/x-platform
* \brief Tests for cross-platform macros
*/
/*! \dir xplatform

View File

@@ -1,22 +1,21 @@
/**
@file mm_createdataset.sas
@brief Create a dataset from a metadata definition
@file
@brief Create an empty dataset from a metadata definition
@details This macro was built to support viewing empty tables in
https://datacontroller.io - a free evaluation copy is available by
contacting the author (Allan Bowe).
https://datacontroller.io
The table can be retrieved using LIBRARY.DATASET reference, or directly
using the metadata URI.
The table can be retrieved using LIBRARY.DATASET reference, or directly
using the metadata URI.
The dataset is written to the WORK library.
The dataset is written to the WORK library.
usage:
Usage:
%mm_createdataset(libds=metlib.some_dataset)
%mm_createdataset(libds=metlib.some_dataset)
or
or
%mm_createdataset(tableuri=G5X8AFW1.BE00015Y)
%mm_createdataset(tableuri=G5X8AFW1.BE00015Y)
<h4> SAS Macros </h4>
@li mm_getlibs.sas
@@ -26,9 +25,9 @@
@param libds= library.dataset metadata source. Note - table names in metadata
can be longer than 32 chars (just fyi, not an issue here)
@param tableuri= Metadata URI of the table to be created
@param outds= The dataset to create, default is `work.mm_createdataset`.
The table name needs to be 32 chars or less as per SAS naming rules.
@param mdebug= set DBG to 1 to disable DEBUG messages
@param outds= (work.mm_createdataset) The dataset to create. The table name
needs to be 32 chars or less as per SAS naming rules.
@param mdebug= (0) Set to 1 to enable DEBUG messages
@version 9.4
@author Allan Bowe
@@ -54,14 +53,23 @@
%mm_gettables(uri=&liburi,outds=&tempds2)
data _null_;
set &tempds2;
if upcase(tablename)="%upcase(%scan(&libds,2,.))";
where upcase(tablename)="%upcase(%scan(&libds,2,.))";
&dbg putlog tableuri=;
call symputx('tableuri',tableuri);
run;
%end;
data;run;%let tempds3=&syslast;
data;run;
%let tempds3=&syslast;
%mm_getcols(tableuri=&tableuri,outds=&tempds3)
%if %mf_nobs(&tempds3)=0 %then %do;
%put &libds (&tableuri) has no columns defined!!;
data &outds;
run;
%return;
%end;
data _null_;
set &tempds3 end=last;
if _n_=1 then call execute('data &outds;');

View File

@@ -8,8 +8,8 @@
"server",
"xplatform",
"tests/base",
"tests/ddl",
"tests/xplatform"
"tests/ddlonly",
"tests/x-platform"
],
"docConfig": {
"displayMacroCore": false,

View File

@@ -2,7 +2,8 @@
@file mx_createwebservice.sas
@brief Create a web service in SAS 9, Viya or SASjs
@details Creates a SASJS ready Stored Process in SAS 9, a Job Execution
Service in SAS Viya, and a Stored Program on SASjs Server
Service in SAS Viya, or a Stored Program on SASjs Server - depending on the
executing environment.
Usage:
@@ -24,7 +25,9 @@ Usage:
%webout(OBJ,example2) * Object format, easier to work with ;
%webout(CLOSE)
;;;;
%mp_createwebservice(path=/Public/app/common,name=appInit,replace=YES)
%* create the service (including webout macro and dependencies);
%mx_createwebservice(path=/Public/app/common,name=appInit,replace=YES)
<h4> SAS Macros </h4>
@li mf_getplatform.sas
@@ -43,7 +46,6 @@ Usage:
location
@param [in] mDebug= (0) set to 1 to show debug messages in the log
@version 9.2
@author Allan Bowe
**/

View File

@@ -15,7 +15,7 @@
@param [out] outref= (0) The fileref to create, which will contain the source
code.
<h4> SAS Macros </h4>
<h4> SAS Macros </h4>
@li mf_getplatform.sas
@li mm_getstpcode.sas
@li ms_getfile.sas