UNPKG

@sasjs/cli

Version:

Command line interface for SASjs

275 lines (274 loc) 13.1 kB
{ "folders": [ { "folderName": "sasjs", "files": [], "subFolders": [ { "folderName": "db", "files": [], "subFolders": [ { "folderName": "LIBREF1", "files": [ { "fileName": "table1.ddl", "content": "/**\n\nDDL files provide the structure of a table and should be written as SQL\nstatements WITHOUT the `proc sql;` prefix. This is to prevent subsequent\ntables being created unnecessarily if there are any errors.\n\nThis comment can / should be removed.\n\nThe LIBREF (folder name) is passed in as a macro variable named `CURLIB`.\n\n**/\n\ncreate table &curlib..dim_product(\n tx_from num not null format=datetime19.3,\n tx_to num not null format=datetime19.3,\n product_cd char(40) not null,\n product_desc char(100) not null,\n constraint pk\n primary key(tx_from, product_cd));\n" }, { "fileName": "table1.sas", "content": "/**\nSAS files are provided here to enable initial values to be loaded to tables.\nThis is not the place for TEST data - that should be added as part of\na test suite.\n\nSAS Datalines provide a very concise and controlled way to load data. Such\nprograms can be generated using the following utility:\n\nhttps://github.com/sasjs/core/blob/main/base/mp_ds2cards.sas\n\nTables should first be created in WORK then proc appended to the target (CURLIB)\nlibrary.\n\nThis comment can / should be deleted.\n\n**/\n\ndata dim_product(index=(pk=(tx_from product_cd)/unique));\n retain tx_from 0;\n retain tx_to '31DEC9999:23:59:59'dt;\ninfile cards dsd;\ninput product_cd:$40. product_desc:$100.;\ncards4;\n001,some product\n002,some other product\n003,you get the picture\n;;;;\nrun;\n\nproc append base=&curlib..dim_product data=dim_product;\nrun;\n" } ] } ] }, { "folderName": "build", "files": [ { "fileName": "serviceinit.sas", "content": "/**\n @file serviceinit.sas\n @brief this file is called with every service\n @details This file is included in *every* service, *after* the macros and *before* the service code.\n\n <h4> SAS Macros </h4>\n @li mf_abort.sas\n\n**/\n\noptions \n DATASTMTCHK=ALLKEYWORDS /* some sites have this enabled */\n PS=MAX /* reduce log size slightly */\n;\n%put service is starting!!;" }, { "fileName": "buildinit.sas", "content": "/**\n @file buildinit.sas\n @brief this executed as part of the generation of the any build script\n @details This file is inserted *after* the build macros and *before* the service code.\n\n**/\n\n%put this is common buildinit!;\n" }, { "fileName": "buildinitviya.sas", "content": "/**\n @file buildinitviya.sas\n @brief this executed as part of the generation of the Viya build script\n @details This file is inserted *after* the build macros and *before* the service code.\n\n For an explanation of this part, see: https://sasjs.io/sasjs/sasjs-cli/#viya-deployment-script\n\n <h4> SAS Macros </h4>\n\n**/\n\n%put buildinit script;\n\n" }, { "fileName": "buildterm.sas", "content": "/**\n @file buildterm.sas\n @brief this executed as part of the generation of the any build script\n @details This file is included at the *end* of deployscript.\n\n**/\n\n%put this message came from buildterm.sas;" }, { "fileName": "serviceterm.sas", "content": "/**\n @file serviceterm.sas\n @brief this file is called at the end of every service\n @details This file is included at the *end* of every service.\n\n <h4> SAS Macros </h4>\n @li mf_abort.sas\n @li mf_existds.sas\n\n**/\n\n%put service is finishing. Thanks, SASjs!;" }, { "fileName": "servicetermother.sas", "content": "/**\n @file servicetermother.sas\n @brief this file is called at the end of every service\n @details This file is included at the *end* of every service.\n\n**/\n\n%put this is the servicetermother.sas program;" }, { "fileName": "deployscript.sh", "content": "echo 'shell script for deployscript'" }, { "fileName": "deploysas9.sh", "content": "echo 'shell script for deploysas9'" } ] }, { "folderName": "macros", "files": [ { "fileName": "examplemacro.sas", "content": "/**\n @file examplemacro.sas\n @brief an example of a macro to be used in a service\n @details This macro is great. Yadda yadda yadda. Usage:\n\n * code formatting applies when indented by 4 spaces;\n %examplemacro()\n\n <h4> SAS Macros </h4>\n @li doesnothing.sas\n\n @author Allan Bowe\n**/\n\n%macro examplemacro();\n\nproc sql;\ncreate table areas\n as select area\nfrom sashelp.springs;\n\n%doesnothing()\n\n%mend;\n" }, { "fileName": "yetanothermacro.sas", "content": "/**\n @file yetanothermacro.sas\n @brief Yet another example of a macro to be used in a service\n @details This macro is also great. Yadda yadda yadda. \n\n <h4> SAS Macros </h4>\n @li doesnothing.sas\n\n**/\n\n%macro yetanothermacro();\n\nproc sort data= areas nodupkey;\n by area;\nrun;\n%doesnothing()\n\n%mend;\n" }, { "fileName": "doesnothing.sas", "content": "%macro doesnothing();\n%put check this, nothing happened!; \n%mend;\n" } ] }, { "folderName": "services", "files": [], "subFolders": [ { "folderName": "admin", "files": [ { "fileName": "dostuff.sas", "content": "/**\n @file dostuff.sas\n @brief example file\n @details This service does stuff. Like - ya know - stuff.\n\n <h4> SAS Macros </h4>\n @li mv_createfolder.sas\n @li mm_getauthinfo.sas\n\n**/\n\ndata stuff;set sashelp.class;run;\n%webout(OPEN)\n%webout(OBJ,stuff)\n%webout(CLOSE)\n" } ] }, { "folderName": "common", "files": [ { "fileName": "appinit.sas", "content": "/**\n @file appinit.sas\n @brief Initialisation service - runs on app startup\n @details This is always the first service called when the app is opened.\n\n <h4> SAS Macros </h4>\n\n**/\n\nproc sql;\ncreate table areas as select distinct area\n from sashelp.springs;\n%webout(OPEN)\n%webout(OBJ,areas)\n%webout(CLOSE)\n" }, { "fileName": "getdata.sas", "content": "/**\n @file getdata.sas\n @brief Get Data service - runs on app startup\n @details This is always the first service called when the app is opened.\n\n <h4> SAS Macros </h4>\n\n**/\n\nproc sql;\ncreate table springs as select * from sashelp.springs\n where area in (select area from areas);\n\n%webout(OPEN)\n%webout(OBJ,springs)\n%webout(CLOSE)\n" }, { "fileName": "example.sas", "content": "/**\n @file example.sas\n @brief example service - for example \n @details This is a longer description.\n\n <h4> SAS Macros </h4>\n @li mf_nobs.sas\n @li examplemacro.sas\n @li yetanothermacro.sas\n\n**/\n\n%put %mf_nobs(sashelp.class);\n\n%examplemacro()\n%yetanothermacro()\n\n%webout(OPEN)\n%webout(OBJ,areas)\n%webout(CLOSE)\n" } ] } ] }, { "folderName": "programs", "files": [ { "fileName": "exampleprogram.sas", "content": "%put 'this is sas!';" } ], "subFolders": [] }, { "folderName": "targets", "files": [], "subFolders": [ { "folderName": "sas9", "files": [], "subFolders": [ { "folderName": "macros", "files": [ { "fileName": "examplemacro.sas", "content": "%macro genericmacro();\n %put this is sas9!;\n%mend;" } ] }, { "folderName": "services", "files": [], "subFolders": [ { "folderName": "admin", "files": [ { "fileName": "dostuff.sas", "content": "%put this came from sasjs/targets/sas9/services/admin/dostuff.sas;\n" } ] } ] } ] }, { "folderName": "viya", "files": [ { "fileName": "viyabuildterm.sas", "content": "/**\n @file viyabuildterm.sas\n @brief this executed as part of the generation of the any build script\n @details This file is included at the *end* of deployscript.\n\n**/\n\n%put this message came from viyabuildterm.sas;" } ], "subFolders": [ { "folderName": "macros", "files": [ { "fileName": "examplemacro.sas", "content": "%macro genericmacro();\n %put this is SAS Viya!;\n%mend;" } ] }, { "folderName": "services", "files": [], "subFolders": [ { "folderName": "admin", "files": [ { "fileName": "dostuff.sas", "content": "%put this came from sasjs/targets/viya/services/admin/dostuff.sas;\n" } ] } ] } ] } ] } ] } ], "config": { "$schema": "https://cli.sasjs.io/sasjsconfig-schema.json", "buildConfig": { "initProgram": "sasjs/build/buildinit.sas", "termProgram": "sasjs/build/buildterm.sas", "macroVars": { "name": "value", "numvar": "42" } }, "deployConfig": { "deployScripts": ["sasjs/build/deployscript.sh"] }, "serviceConfig": { "serviceFolders": ["sasjs/services/common", "sasjs/services/admin"], "initProgram": "sasjs/build/serviceinit.sas", "termProgram": "sasjs/build/serviceterm.sas", "macroVars": { "name": "value", "numvar": "42" } }, "macroFolders": ["sasjs/macros"], "programFolders": ["sasjs/programs"], "binaryFolders": ["sasjs/binaries"], "defaultTarget": "viya", "targets": [ { "name": "viya", "serverType": "SASVIYA", "serverUrl": "", "appLoc": "/Public/app", "contextName": "SAS Job Execution compute context", "buildConfig": { "buildOutputFileName": "myviyadeploy.sas", "initProgram": "sasjs/build/buildinitviya.sas", "termProgram": "sasjs/targets/viya/viyabuildterm.sas", "macroVars": { "name": "viyavalue", "extravar": "this too" } }, "serviceConfig": { "serviceFolders": ["sasjs/targets/viya/services/admin"], "initProgram": "sasjs/build/serviceinit.sas", "termProgram": "sasjs/build/serviceinit.sas", "macroVars": { "name": "viyavalue", "extravar": "this too" } }, "macroFolders": ["sasjs/targets/viya/macros"] }, { "name": "sas9", "serverType": "SAS9", "serverUrl": "", "appLoc": "/User Folders/&sysuserid/My Folder", "serverName": "Foundation", "repositoryName": "SASApp", "deployConfig": { "deployScripts": ["sasjs/build/deploysas9.sh"], "deployServicePack": false }, "serviceConfig": { "serviceFolders": ["sasjs/targets/sas9/services/admin"], "termProgram": "sasjs/build/servicetermother.sas" }, "macroFolders": ["sasjs/targets/sas9/macros"] }, { "name": "sasjs", "serverType": "SASJS", "serverUrl": "", "appLoc": "/Public/app" } ] } }