SASjs Config File

Type: object Default: {}

The SASjs Config file provides the settings and structure for your SASjs project.


Example:

{
    "macroFolders": [
        "macros"
    ],
    "programFolders": [
        "programs"
    ],
    "binaryFolders": [
        "binaries"
    ],
    "defaultTarget": "viya",
    "targets": [
        {
            "name": "viya",
            "serverType": "SASVIYA",
            "serverUrl": "https://sas.sasjs.com",
            "appLoc": "/Public/app",
            "contextName": "SAS Job Execution compute context",
            "deployConfig": {
                "deployServicePack": true,
                "deployScripts": [
                    "sasjsbuild/myviyadeploy.sas"
                ]
            },
            "serviceConfig": {
                "serviceFolders": [
                    "targets/viya/services/admin"
                ],
                "initProgram": "build/serviceinit.sas",
                "termProgram": "build/serviceinit.sas",
                "macroVars": {
                    "name": "viyavalue",
                    "extravar": "this too"
                }
            },
            "jobConfig": {
                "jobFolders": [],
                "initProgram": "",
                "termProgram": "",
                "macroVars": {}
            },
            "streamConfig": {
                "assetPaths": [],
                "streamWeb": false,
                "streamWebFolder": "webv",
                "webSourcePath": "dist"
            },
            "testConfig": {
                "initProgram": "sasjs/tests/testinit.sas",
                "termProgram": "sasjs/tests/testterm.sas",
                "macroVars": {
                    "testVar": "testValue"
                },
                "testSetUp": "sasjs/tests/testsetup.sas",
                "testTearDown": "sasjs/tests/testteardown.sas"
            },
            "macroFolders": [
                "targets/viya/macros"
            ],
            "programFolders": [],
            "binaryFolders": [
                "binaries"
            ]
        },
        {
            "name": "sas9",
            "serverType": "SAS9",
            "serverUrl": "https://sas.sasjs.com:7980",
            "appLoc": "/User Folders/&sysuserid/My Folder",
            "serverName": "Foundation",
            "repositoryName": "SASApp",
            "buildConfig": {
                "buildOutputFileName": "mysas9deploy.sas",
                "initProgram": "",
                "termProgram": "",
                "macroVars": {}
            },
            "deployConfig": {
                "deployScripts": [
                    "build/deploysas9.sh"
                ],
                "deployServicePack": false
            },
            "serviceConfig": {
                "serviceFolders": [
                    "targets/sas9/services/admin"
                ],
                "initProgram": "",
                "termProgram": "build/servicetermother.sas",
                "macroVars": {}
            },
            "streamConfig": {
                "assetPaths": [],
                "streamWeb": false,
                "streamWebFolder": "web9",
                "webSourcePath": "dist"
            },
            "testConfig": {
                "initProgram": "sasjs/tests/testinit.sas",
                "termProgram": "sasjs/tests/testterm.sas",
                "macroVars": {
                    "testVar": "testValue"
                },
                "testSetUp": "sasjs/tests/testsetup.sas",
                "testTearDown": "sasjs/tests/testteardown.sas"
            },
            "macroFolders": [
                "targets/sas9/macros"
            ],
            "programFolders": [],
            "binaryFolders": [
                "binaries"
            ]
        }
    ]
}

Type: array

These local folders are searched for Binary Files when running sasjs compile. Folders are relative to the sasjs/sasjsconfig.json file.

No Additional Items
Example:

[
    "binaries",
    "../../more_binaries"
]

Type: string Default: "sasjsbuild"

The name of the folder containing the compiled output. The sasjs build command will take all of the subfolders here as inputs to create the build pack. By default this will be named sasjsbuild. In global, the default is ~/.sasjsbuild.


Examples:

"sasjsbuild"
".sasjsbuild"

Type: string Default: "sasjsresults"

The name of the folder containing the output (eg logs, ODS output) from sasjs run. By default this will be named sasjsresults. In global, the default is ~/.sasjsresults.


Examples:

"sasjsresults"
".sasjsresults"

Type: string Default: "viya"

If a target is not specified, this target is used by default. The default target must exist in the (local) targets array.


Example:

"viya"

Type: object Default: {"dataControllerUrl": "https://mysasserver.com/web/datacontroller/#", "enableLineage": true, "doxyContent": {"readMe": "../../README.md"}}

SASjs uses doxygen to auto-generate HTML documentation using the headers in your SAS programs, macros, services & jobs. For more info, see https://cli.sasjs.io/doc. Some properties are taken from package.json (such as the project Name).


Example:

{
    "displayMacroCore": true,
    "outDirectory": "/some/output/directory",
    "dataControllerUrl": "https://mysasserver.com/web/datacontroller/#",
    "enableLineage": true,
    "doxyContent": {
        "readMe": "../../my/custom/homepage.md",
        "path": "my/custom/doxy/folder"
    }
}

Type: boolean Default: true

The CLI will autocompile macro dependencies that exist in the SASjs Macro Core library. These will also show in the documentation under 'node_modules'. If you'd prefer not to show these in the rendered docs, set this value to false.


Example:

true

Type: string Default: "sasjsbuild/doc"

The location to which the generated HTML SAS documentation is written. If missing, or left blank, the files will be written to the sasjsbuild/doc directory (default behaviour).


Example:

"/my/preferred/docs/directory"

Type: string Default: ""

Provide the full URL to Data Controller so that sasjs doc can link the lineage diagram directly to the table viewer in Data Controller.
If left blank, or undefined, no links will be generated.


Example:

"https://yourserver.co.uk/dcviya/#"

Type: boolean Default: true

If true, sasjs doc will generate and display Data Lineage from Jobs and Services.

Type: object Default: {}

Configuration of the Doxyfile variables


Example:

{
    "favIcon": "favicon.ico",
    "footer": "new_footer.html",
    "header": "new_header.html",
    "layout": "DoxygenLayout.xml",
    "logo": "logo.png",
    "readMe": "../../README.md",
    "stylesheet": "new_stylesheet.css",
    "path": "sasjs/doxy"
}

Type: string Default: "favicon.ico"

The favicon used in the doxygen documentation

Type: string Default: "new_header.html"

The header HTML file used in the doxygen documentation

Type: string Default: "DoxygenLayout.xml"

The layout XML file used to build the doxygen documentation

Type: string Default: "../../README.md"

The file used to generate the doxygen homepage (defaults to the readme.md)

Type: string Default: "new_stylesheet.css"

The CSS file used to extend Doxygen

Type: string Default: "sasjs/doxy"

The path to the Doxygen configuration files (relative to sasjs/sasjsconfig.json)

Type: object

Configure https agent by setting all supported attribute such as key, cert, ca, rejectUnauthorized and requestCert


Example:

{
    "allowInsecureRequests": false,
    "caPath": "path/to/caFile",
    "keyPath": "path/to/keyFile",
    "certPath": "path/to/certFile",
    "requestCert": false,
    "rejectUnauthorized": true
}

Type: boolean Default: false

If you are having certificate errors connecting to SAS, that cannot be properly resolved, try setting this value to true. This option only has an effect if rejectUnauthorized is not present.


Examples:

true
false

Type: string

Optionally override the trusted CA certificates. Default is to trust the well-known CAs curated by Mozilla. Mozilla's CAs are completely replaced when CAs are explicitly specified using this option.


Example:

"path/to/caFile"

Type: string

Private keys in PEM format. PEM allows the option of private keys being encrypted. Encrypted keys will be decrypted with options.passphrase. Multiple keys using different algorithms can be provided either as an array of unencrypted key strings or buffers, or an array of objects in the form {pem: [, passphrase: ]}. The object form can only occur in an array. object.passphrase is optional. Encrypted keys will be decrypted with object.passphrase if provided, or options.passphrase if it is not.


Example:

"path/to/keyFile"

Type: string

Cert chains in PEM format. One cert chain should be provided per private key. Each cert chain should consist of the PEM formatted certificate for a provided private key, followed by the PEM formatted intermediate certificates (if any), in order, and not including the root CA (the root CA must be pre-known to the peer, see ca). When providing multiple cert chains, they do not have to be in the same order as their private keys in key. If the intermediate certificates are not provided, the peer will not be able to validate the certificate, and the handshake will fail.


Example:

"path/to/certFile"

Type: boolean Default: false

If true the server will request a certificate from clients that connect and attempt to verify that certificate. Defaults to false.


Examples:

true
false

Type: boolean Default: true

If true the server will reject any connection which is not authorized with the list of supplied CAs. This option only has an effect if requestCert is true.


Examples:

true
false

Type: object

Dictates which files get compiled into the build program (.sas), used to deploy services into SAS 9 or Viya environments (without a client/secret). You may use this config to include build specific macros, programs or macro variables - which is run a single time, on deployment - for things like database creation, or exporting a SAS 9 SPK after service creation.


Example:

{
    "initProgram": "build/buildinit.sas",
    "termProgram": "build/buildterm.sas",
    "macroVars": {
        "name": "value",
        "numvar": "42"
    },
    "buildOutputFileName": "buildpack.sas"
}

Type: string

The name of the generated .sas program, which can be used to deploy the app using only SAS Studio. By default, this will be the name of the target.


Examples:

"viya.sas"
"sas9.sas"

Type: string Default: "sasjs/buildinit.sas"

The path to a .sas program that will be inserted at the start of the build .sas program (created when running sasjs build).

Type: string Default: "sasjs/buildterm.sas"

The path to a .sas program that will be inserted at the end of the build .sas program (created when running sasjs build).

Type: object Default: {}

A series of name value pairs that will be turned into SAS macro variables in the build .sas program (generated when running sasjs build). The example provided will generate sas code as follows:

%let name=value;
%let numvar=42;

Example:

{
    "name": "value",
    "numvar": "42"
}

Type: object Default: {}

The deployConfig object enables settings that relate to the deployment of a SAS app - be that Viya, or SAS 9, or a pure Base environment.


Examples:

{
    "deployScripts": [
        "build/deployscript.sh"
    ]
}
{
    "deployScripts": [
        "build/deployscript.sh"
    ],
    "deployServicePack": true
}

Type: array Default: []

These scripts are executed when running sasjs deploy. If the file is a .sas file, it is executed on the SAS server (Viya only). Otherwise it is executed locally. These scripts are run AFTER the deployment of the servicepack, if deployServicePack:true (Viya only).

No Additional Items
Example:

[
    "build/deployscript.sh",
    "build/myprogram.sas"
]

Type: boolean Default: false

If set to true the json pack produced by sasjs build will be auto-deployed to the appLoc of the specified target (creating all jobs and services in the SAS folder tree). Currently only Viya is supported for this flag.

Type: object Default: {}

The serviceConfig object defines how SASjs web services are compiled. Web services differ from jobs in that they include some fixed pre-code (eg the macros to stream out the result json).


Example:

{
    "serviceFolders": [
        "services/common",
        "services/admin"
    ],
    "initProgram": "build/serviceinit.sas",
    "termProgram": "build/serviceterm.sas",
    "macroVars": {
        "mac1": "value",
        "mac2": "42"
    }
}

Type: array Default: []

When running sasjs compile, all programs in the folders defined in this array are compiled and placed into same-named folders under sasjsbuild/services. They will be compiled as services (so, with the service pre-code). Folders can be absolute, or relative to the sasjs folder.

No Additional Items
Example:

[
    "services/common",
    "services/admin"
]

Type: string Default: ""

The serviceConfig initProgram is a .sas file that is inserted at the start of every SAS service (after compiled macros and any macroVars, and before the service itself).


Example:

"build/serviceinit.sas"

Type: string Default: ""

The serviceConfig termProgram is inserted at the end of every service as part of sasjs compile.


Example:

"build/serviceterm.sas"

Type: object Default: {}

This object allows sasjs compile to insert specific macro variables at the start of every service. In this case, the code generated would be:

%let mac1=value;
%let mac2=42;

Example:

{
    "mac1": "value",
    "mac2": "42"
}

Type: object Default: {}

The jobConfig object defines how SASjs Jobs are compiled.


Example:

{
    "jobFolders": [
        "jobs/extract",
        "jobs/load"
    ],
    "initProgram": "jobs/jobinit.sas",
    "termProgram": "jobs/jobterm.sas",
    "macroVars": {
        "mac1": "value",
        "mac2": "42"
    }
}

Type: array Default: []

When running sasjs compile, all programs in the local folders defined in this array are compiled and placed into same-named folders under sasjsbuild/jobs. Folders can be absolute, or relative to the local project /sasjs folder.

No Additional Items
Example:

[
    "jobs/extract",
    "jobs/transform",
    "jobs/load"
]

Type: string Default: ""

The jobConfig initProgram is a local .sas file that is inserted at the start of every SAS Job (after compiled macros and any macroVars, and before the Job itself).


Example:

"jobs/jobinit.sas"

Type: string Default: ""

The jobConfig termProgram is inserted at the end of every Job as part of sasjs compile.


Example:

"jobs/jobterm.sas"

Type: object Default: {}

This object allows sasjs compile to insert specific macro variables at the start of every Job. In this case, the code generated would be:

%let mac1=value;
%let mac2=42;

Example:

{
    "mac1": "value",
    "mac2": "42"
}

Type: object Default: {}

SASjs allows a local web app to be compiled such that all html, css, javascript, and other assets such as png or mp4 are converted into web services and streamed directly from SAS.

This approach is convenient as it bypasses the need to deploy to a web server.


Example:

{
    "assetPaths": [],
    "streamWeb": false,
    "streamWebFolder": "webv",
    "webSourcePath": "dist",
    "streamLogo": "logo.png"
}

Type: array Default: []

An array of local folders. All assets placed in these folders are converted into web services - example file types could be png, svg, mp3, mp4, excel - anything really.

No Additional Items
Example:

[
    "/myassets"
]

Type: boolean Default: false

When set to true, frontend files saved in the webSourcePath will be converted to streaming services in the streamWebFolder in SAS.


Example:

true

Type: string Default: "webv"

This is the target SAS folder (relative to the appLoc) where the compiled web assets will be created.

Type: string Default: "dist"

Active when streamConfig is true. Is the source (or build, or dist) LOCAL folder, relative to the sasjs folder, which contains the frontend to be deployed. All assets (PNG, JS, CSS, HTML etc) are taken from here and converted to streaming services in streamWebFolder. In Viya and SAS 9, any relative URLS will be modified such that the links still work and the assets still load.


Examples:

"dist"
"build"

Type: string Default: "clickme.sas"

The name of the service containing the index.html for a streaming web app. Defaults to clickme and is always deployed under the appLoc/services SAS Folder.

Type: object Default: {"initProgram": "sasjs/tests/testinit.sas", "termProgram": "sasjs/tests/testterm.sas", "macroVars": {"testVar": "testValue"}, "testSetUp": "sasjs/tests/testsetup.sas", "testTearDown": "sasjs/tests/testteardown.sas"}

Create tests for Macros, Services & Jobs by simply adding a '.test.sas' extension.

Type: string Default: ""

The testConfig initProgram is a local .sas file that is inserted at the start of every Test (after compiled macros and any macroVars, and before the Test itself).


Example:

"sasjs/tests/testinit.sas"

Type: string Default: ""

The testConfig termProgram is inserted at the end of every Test as part of sasjs compile.


Example:

"jobs/jobterm.sas"

Type: object Default: {}

This object allows sasjs compile to insert specific macro variables at the start of every Test. In this case, the code generated would be:

%let mac1=value;
%let mac2=42;

Example:

{
    "mac1": "value",
    "mac2": "42"
}

Type: string Default: "sasjs/tests/testsetup.sas"

This program is the first to execute as part of 'sasjs test'. It does not contain the testInit, testTerm or macroVariables. It IS compiled.


Example:

"sasjs/tests/testsetup.sas"

Type: string Default: "sasjs/tests/testteardown.sas"

The last program to execute as part of 'sasjs test'.


Example:

"sasjs/tests/testteardown.sas"

Type: array Default: []

These local folders are searched for SAS Macros when running sasjs compile. Folders are relative to the sasjs/sasjsconfig.json file.

No Additional Items
Example:

[
    "macros",
    "../../more_macros"
]

Type: array Default: []

These local folders are searched for SAS Programs when running sasjs compile. Folders are relative to the sasjs/sasjsconfig.json file.

No Additional Items
Example:

[
    "programs",
    "../../more_programs"
]

Type: string Default: "sasjs/static_files"

The contents of this folder are simply copied to the sasjsbuild directory AFTER the rest of the project is compiled. Useful for synchronising random / generic content with SAS logical folders.

Type: array

Maps the local filesystem to remote (SAS) physical directories.

No Additional Items
Example:

[
    {
        "local": "C:\\temp\\local\\fs1",
        "remote": "/opt/data/fs1"
    },
    {
        "local": "C:\\temp\\elsewhere",
        "remote": "/opt/somewhere"
    }
]

Type: array Default: []

A target is an alias for a deployment location, and includes at a minimum, the serverUrl, serverType and appLoc. This array allows multiple targets to be defined (eg dev / test / prod). Any properties defined here will override same-named properties in the sasjsconfig root.

No Additional Items

Each item of this array must be:


Type: object Default: {}

A target provides the configuration specific to a particular deployment, eg DEV / TEST, or SAS9 / SASVIYA.


Example:

{
    "name": "viya",
    "serverType": "SASVIYA",
    "serverUrl": "https://sas.sasjs.com",
    "appLoc": "/Public/app",
    "contextName": "SAS Job Execution compute context",
    "buildConfig": {
        "buildOutputFileName": "myviyadeploy.sas",
        "initProgram": "build/buildinitviya.sas",
        "termProgram": "targets/viya/viyabuildterm.sas",
        "macroVars": {
            "name": "viyavalue",
            "extravar": "this too"
        }
    },
    "deployConfig": {
        "deployServicePack": true,
        "deployScripts": [
            "sasjsbuild/myviyadeploy.sas"
        ]
    },
    "serviceConfig": {
        "serviceFolders": [
            "targets/viya/services/admin"
        ],
        "initProgram": "build/serviceinit.sas",
        "termProgram": "build/serviceinit.sas",
        "macroVars": {
            "name": "viyavalue",
            "extravar": "this too"
        }
    },
    "jobConfig": {
        "jobFolders": [],
        "initProgram": "",
        "termProgram": "",
        "macroVars": {}
    },
    "streamConfig": {
        "assetPaths": [],
        "streamWeb": false,
        "streamWebFolder": "webv",
        "webSourcePath": "dist"
    },
    "testConfig": {
        "initProgram": "sasjs/tests/testinit.sas",
        "termProgram": "sasjs/tests/testterm.sas",
        "macroVars": {
            "testVar": "testValue"
        },
        "testSetUp": "sasjs/tests/testsetup.sas",
        "testTearDown": "sasjs/tests/testteardown.sas"
    },
    "macroFolders": [
        "targets/viya/macros"
    ],
    "programFolders": []
}

Type: string Default: ""

A target name can only contain alphanumeric characters and dashes. It cannot contain spaces. It is used as the alias when referencing the target using the -t attribute in many of the SASjs commands.


Example:

"viya"

Type: string Default: ""

The serverType can be either SAS9, SASVIYA or SASJS.


Example:

"SASVIYA"

Type: string Default: ""

The appLoc provides the root SAS folder location under which all jobs and services are deployed and executed. The SAS folder could be metadata in SAS 9, or SAS Drive in Viya.


Example:

"/Public/app"

Type: array

These local folders are searched for Binary Files when running sasjs compile. Folders are relative to the sasjs/sasjsconfig.json file.

No Additional Items
Example:

[
    "binaries",
    "../../more_binaries"
]

Type: object

Dictates which files get compiled into the build program (.sas), used to deploy services into SAS 9 or Viya environments (without a client/secret). You may use this config to include build specific macros, programs or macro variables - which is run a single time, on deployment - for things like database creation, or exporting a SAS 9 SPK after service creation.


Example:

{
    "initProgram": "build/buildinit.sas",
    "termProgram": "build/buildterm.sas",
    "macroVars": {
        "name": "value",
        "numvar": "42"
    },
    "buildOutputFileName": "buildpack.sas"
}

Type: string

The name of the generated .sas program, which can be used to deploy the app using only SAS Studio. By default, this will be the name of the target.


Examples:

"viya.sas"
"sas9.sas"

Type: string Default: "sasjs/buildinit.sas"

The path to a .sas program that will be inserted at the start of the build .sas program (created when running sasjs build).

Type: string Default: "sasjs/buildterm.sas"

The path to a .sas program that will be inserted at the end of the build .sas program (created when running sasjs build).

Type: object Default: {}

A series of name value pairs that will be turned into SAS macro variables in the build .sas program (generated when running sasjs build). The example provided will generate sas code as follows:

%let name=value;
%let numvar=42;

Example:

{
    "name": "value",
    "numvar": "42"
}

Type: string Default: "SAS Job Execution compute context"

The name of the compute context used to execute SAS code. The context determines the way in which the SAS session is spawned (eg user credentials, autoexec code, system options etc).
Contexts can be created / modified / deleted using the sasjs context command.


Example:

"SAS Job Execution compute context"

Type: object Default: {}

The deployConfig object enables settings that relate to the deployment of a SAS app - be that Viya, or SAS 9, or a pure Base environment.


Examples:

{
    "deployScripts": [
        "build/deployscript.sh"
    ]
}
{
    "deployScripts": [
        "build/deployscript.sh"
    ],
    "deployServicePack": true
}

Type: array Default: []

These scripts are executed when running sasjs deploy. If the file is a .sas file, it is executed on the SAS server (Viya only). Otherwise it is executed locally. These scripts are run AFTER the deployment of the servicepack, if deployServicePack:true (Viya only).

No Additional Items
Example:

[
    "build/deployscript.sh",
    "build/myprogram.sas"
]

Type: boolean Default: false

If set to true the json pack produced by sasjs build will be auto-deployed to the appLoc of the specified target (creating all jobs and services in the SAS folder tree). Currently only Viya is supported for this flag.

Type: object

Configure https agent by setting all supported attribute such as key, cert, ca, rejectUnauthorized and requestCert


Example:

{
    "allowInsecureRequests": false,
    "caPath": "path/to/caFile",
    "keyPath": "path/to/keyFile",
    "certPath": "path/to/certFile",
    "requestCert": false,
    "rejectUnauthorized": true
}

Type: boolean Default: false

If you are having certificate errors connecting to SAS, that cannot be properly resolved, try setting this value to true. This option only has an effect if rejectUnauthorized is not present.


Examples:

true
false

Type: string

Optionally override the trusted CA certificates. Default is to trust the well-known CAs curated by Mozilla. Mozilla's CAs are completely replaced when CAs are explicitly specified using this option.


Example:

"path/to/caFile"

Type: string

Private keys in PEM format. PEM allows the option of private keys being encrypted. Encrypted keys will be decrypted with options.passphrase. Multiple keys using different algorithms can be provided either as an array of unencrypted key strings or buffers, or an array of objects in the form {pem: [, passphrase: ]}. The object form can only occur in an array. object.passphrase is optional. Encrypted keys will be decrypted with object.passphrase if provided, or options.passphrase if it is not.


Example:

"path/to/keyFile"

Type: string

Cert chains in PEM format. One cert chain should be provided per private key. Each cert chain should consist of the PEM formatted certificate for a provided private key, followed by the PEM formatted intermediate certificates (if any), in order, and not including the root CA (the root CA must be pre-known to the peer, see ca). When providing multiple cert chains, they do not have to be in the same order as their private keys in key. If the intermediate certificates are not provided, the peer will not be able to validate the certificate, and the handshake will fail.


Example:

"path/to/certFile"

Type: boolean Default: false

If true the server will request a certificate from clients that connect and attempt to verify that certificate. Defaults to false.


Examples:

true
false

Type: boolean Default: true

If true the server will reject any connection which is not authorized with the list of supplied CAs. This option only has an effect if requestCert is true.


Examples:

true
false

Type: string Default: ""

The serverUrl is the location to which the app is deployed, and against which any server based operations are performed. If SAS is served from a particular port, that port should also be included here.


Examples:

"https://sas.sasjs.com"
"https://sas.sasjs.com:8080"

Type: object Default: {}

The serviceConfig object defines how SASjs web services are compiled. Web services differ from jobs in that they include some fixed pre-code (eg the macros to stream out the result json).


Example:

{
    "serviceFolders": [
        "services/common",
        "services/admin"
    ],
    "initProgram": "build/serviceinit.sas",
    "termProgram": "build/serviceterm.sas",
    "macroVars": {
        "mac1": "value",
        "mac2": "42"
    }
}

Type: array Default: []

When running sasjs compile, all programs in the folders defined in this array are compiled and placed into same-named folders under sasjsbuild/services. They will be compiled as services (so, with the service pre-code). Folders can be absolute, or relative to the sasjs folder.

No Additional Items
Example:

[
    "services/common",
    "services/admin"
]

Type: string Default: ""

The serviceConfig initProgram is a .sas file that is inserted at the start of every SAS service (after compiled macros and any macroVars, and before the service itself).


Example:

"build/serviceinit.sas"

Type: string Default: ""

The serviceConfig termProgram is inserted at the end of every service as part of sasjs compile.


Example:

"build/serviceterm.sas"

Type: object Default: {}

This object allows sasjs compile to insert specific macro variables at the start of every service. In this case, the code generated would be:

%let mac1=value;
%let mac2=42;

Example:

{
    "mac1": "value",
    "mac2": "42"
}

Type: object Default: {}

The jobConfig object defines how SASjs Jobs are compiled.


Example:

{
    "jobFolders": [
        "jobs/extract",
        "jobs/load"
    ],
    "initProgram": "jobs/jobinit.sas",
    "termProgram": "jobs/jobterm.sas",
    "macroVars": {
        "mac1": "value",
        "mac2": "42"
    }
}

Type: array Default: []

When running sasjs compile, all programs in the local folders defined in this array are compiled and placed into same-named folders under sasjsbuild/jobs. Folders can be absolute, or relative to the local project /sasjs folder.

No Additional Items
Example:

[
    "jobs/extract",
    "jobs/transform",
    "jobs/load"
]

Type: string Default: ""

The jobConfig initProgram is a local .sas file that is inserted at the start of every SAS Job (after compiled macros and any macroVars, and before the Job itself).


Example:

"jobs/jobinit.sas"

Type: string Default: ""

The jobConfig termProgram is inserted at the end of every Job as part of sasjs compile.


Example:

"jobs/jobterm.sas"

Type: object Default: {}

This object allows sasjs compile to insert specific macro variables at the start of every Job. In this case, the code generated would be:

%let mac1=value;
%let mac2=42;

Example:

{
    "mac1": "value",
    "mac2": "42"
}

Type: object Default: {"dataControllerUrl": "https://mysasserver.com/web/datacontroller/#", "enableLineage": true, "doxyContent": {"readMe": "../../README.md"}}

SASjs uses doxygen to auto-generate HTML documentation using the headers in your SAS programs, macros, services & jobs. For more info, see https://cli.sasjs.io/doc. Some properties are taken from package.json (such as the project Name).


Example:

{
    "displayMacroCore": true,
    "outDirectory": "/some/output/directory",
    "dataControllerUrl": "https://mysasserver.com/web/datacontroller/#",
    "enableLineage": true,
    "doxyContent": {
        "readMe": "../../my/custom/homepage.md",
        "path": "my/custom/doxy/folder"
    }
}

Type: boolean Default: true

The CLI will autocompile macro dependencies that exist in the SASjs Macro Core library. These will also show in the documentation under 'node_modules'. If you'd prefer not to show these in the rendered docs, set this value to false.


Example:

true

Type: string Default: "sasjsbuild/doc"

The location to which the generated HTML SAS documentation is written. If missing, or left blank, the files will be written to the sasjsbuild/doc directory (default behaviour).


Example:

"/my/preferred/docs/directory"

Type: string Default: ""

Provide the full URL to Data Controller so that sasjs doc can link the lineage diagram directly to the table viewer in Data Controller.
If left blank, or undefined, no links will be generated.


Example:

"https://yourserver.co.uk/dcviya/#"

Type: boolean Default: true

If true, sasjs doc will generate and display Data Lineage from Jobs and Services.

Type: object Default: {}

Configuration of the Doxyfile variables


Example:

{
    "favIcon": "favicon.ico",
    "footer": "new_footer.html",
    "header": "new_header.html",
    "layout": "DoxygenLayout.xml",
    "logo": "logo.png",
    "readMe": "../../README.md",
    "stylesheet": "new_stylesheet.css",
    "path": "sasjs/doxy"
}

Type: string Default: "favicon.ico"

The favicon used in the doxygen documentation

Type: string Default: "new_header.html"

The header HTML file used in the doxygen documentation

Type: string Default: "DoxygenLayout.xml"

The layout XML file used to build the doxygen documentation

Type: string Default: "../../README.md"

The file used to generate the doxygen homepage (defaults to the readme.md)

Type: string Default: "new_stylesheet.css"

The CSS file used to extend Doxygen

Type: string Default: "sasjs/doxy"

The path to the Doxygen configuration files (relative to sasjs/sasjsconfig.json)

Type: object Default: {}

SASjs allows a local web app to be compiled such that all html, css, javascript, and other assets such as png or mp4 are converted into web services and streamed directly from SAS.

This approach is convenient as it bypasses the need to deploy to a web server.


Example:

{
    "assetPaths": [],
    "streamWeb": false,
    "streamWebFolder": "webv",
    "webSourcePath": "dist",
    "streamLogo": "logo.png"
}

Type: array Default: []

An array of local folders. All assets placed in these folders are converted into web services - example file types could be png, svg, mp3, mp4, excel - anything really.

No Additional Items
Example:

[
    "/myassets"
]

Type: boolean Default: false

When set to true, frontend files saved in the webSourcePath will be converted to streaming services in the streamWebFolder in SAS.


Example:

true

Type: string Default: "webv"

This is the target SAS folder (relative to the appLoc) where the compiled web assets will be created.

Type: string Default: "dist"

Active when streamConfig is true. Is the source (or build, or dist) LOCAL folder, relative to the sasjs folder, which contains the frontend to be deployed. All assets (PNG, JS, CSS, HTML etc) are taken from here and converted to streaming services in streamWebFolder. In Viya and SAS 9, any relative URLS will be modified such that the links still work and the assets still load.


Examples:

"dist"
"build"

Type: string Default: "clickme.sas"

The name of the service containing the index.html for a streaming web app. Defaults to clickme and is always deployed under the appLoc/services SAS Folder.

Type: array

Maps the local filesystem to remote (SAS) physical directories.

No Additional Items
Example:

[
    {
        "local": "C:\\temp\\local\\fs1",
        "remote": "/opt/data/fs1"
    },
    {
        "local": "C:\\temp\\elsewhere",
        "remote": "/opt/somewhere"
    }
]

Type: string Default: "sasjs/static_files"

The contents of this folder are simply copied to the sasjsbuild directory AFTER the rest of the project is compiled. Useful for synchronising random / generic content with SAS logical folders.

Type: object Default: {"initProgram": "sasjs/tests/testinit.sas", "termProgram": "sasjs/tests/testterm.sas", "macroVars": {"testVar": "testValue"}, "testSetUp": "sasjs/tests/testsetup.sas", "testTearDown": "sasjs/tests/testteardown.sas"}

Create tests for Macros, Services & Jobs by simply adding a '.test.sas' extension.

Type: string Default: ""

The testConfig initProgram is a local .sas file that is inserted at the start of every Test (after compiled macros and any macroVars, and before the Test itself).


Example:

"sasjs/tests/testinit.sas"

Type: string Default: ""

The testConfig termProgram is inserted at the end of every Test as part of sasjs compile.


Example:

"jobs/jobterm.sas"

Type: object Default: {}

This object allows sasjs compile to insert specific macro variables at the start of every Test. In this case, the code generated would be:

%let mac1=value;
%let mac2=42;

Example:

{
    "mac1": "value",
    "mac2": "42"
}

Type: string Default: "sasjs/tests/testsetup.sas"

This program is the first to execute as part of 'sasjs test'. It does not contain the testInit, testTerm or macroVariables. It IS compiled.


Example:

"sasjs/tests/testsetup.sas"

Type: string Default: "sasjs/tests/testteardown.sas"

The last program to execute as part of 'sasjs test'.


Example:

"sasjs/tests/testteardown.sas"

Type: array Default: []

These local folders are searched for SAS Macros when running sasjs compile. Folders are relative to the sasjs/sasjsconfig.json file.

No Additional Items
Example:

[
    "macros",
    "../../more_macros"
]

Type: array Default: []

These local folders are searched for SAS Programs when running sasjs compile. Folders are relative to the sasjs/sasjsconfig.json file.

No Additional Items
Example:

[
    "programs",
    "../../more_programs"
]

Type: string Default: "sasjsbuild"

The name of the folder containing the compiled output. The sasjs build command will take all of the subfolders here as inputs to create the build pack. By default this will be named sasjsbuild. In global, the default is ~/.sasjsbuild.


Examples:

"sasjsbuild"
".sasjsbuild"

Type: string Default: "sasjsresults"

The name of the folder containing the output (eg logs, ODS output) from sasjs run. By default this will be named sasjsresults. In global, the default is ~/.sasjsresults.


Examples:

"sasjsresults"
".sasjsresults"

Examples:

[
    {
        "name": "sas9target",
        "serverType": "SAS9",
        "serverUrl": "https://mysas9server",
        "appLoc": "/Shared Folders/myApp"
    }
]
[
    {
        "name": "viya",
        "serverType": "SASVIYA",
        "serverUrl": "https://sas.sasjs.com",
        "appLoc": "/Public/app",
        "contextName": "SAS Job Execution compute context",
        "buildConfig": {
            "buildOutputFileName": "myviyadeploy.sas",
            "initProgram": "build/buildinitviya.sas",
            "termProgram": "targets/viya/viyabuildterm.sas",
            "macroVars": {
                "name": "viyavalue",
                "extravar": "this too"
            }
        },
        "deployConfig": {
            "deployServicePack": true,
            "deployScripts": [
                "sasjsbuild/myviyadeploy.sas"
            ]
        },
        "serviceConfig": {
            "serviceFolders": [
                "targets/viya/services/admin"
            ],
            "initProgram": "build/serviceinit.sas",
            "termProgram": "build/serviceinit.sas",
            "macroVars": {
                "name": "viyavalue",
                "extravar": "this too"
            }
        },
        "streamConfig": {
            "assetPaths": [],
            "streamWeb": false,
            "streamWebFolder": "webv",
            "webSourcePath": "dist"
        },
        "testConfig": {
            "initProgram": "sasjs/tests/testinit.sas",
            "termProgram": "sasjs/tests/testterm.sas",
            "macroVars": {
                "testVar": "testValue"
            },
            "testSetUp": "sasjs/tests/testsetup.sas",
            "testTearDown": "sasjs/tests/testteardown.sas"
        },
        "macroFolders": [
            "targets/viya/macros"
        ]
    },
    {
        "name": "sas9",
        "serverType": "SAS9",
        "serverUrl": "https://sas.sasjs.com:7980",
        "appLoc": "/User Folders/&sysuserid/My Folder",
        "serverName": "Foundation",
        "repositoryName": "SASApp",
        "buildConfig": {
            "buildOutputFileName": "mysas9deploy.sas",
            "initProgram": "",
            "termProgram": "",
            "macroVars": {}
        },
        "deployConfig": {
            "deployScripts": [
                "build/deploysas9.sh"
            ],
            "deployServicePack": false
        },
        "serviceConfig": {
            "serviceFolders": [
                "targets/sas9/services/admin"
            ],
            "initProgram": "",
            "termProgram": "build/servicetermother.sas",
            "macroVars": {}
        },
        "streamConfig": {
            "assetPaths": [],
            "streamWeb": false,
            "streamWebFolder": "web9",
            "webSourcePath": "dist"
        },
        "testConfig": {
            "initProgram": "sasjs/tests/testinit.sas",
            "termProgram": "sasjs/tests/testterm.sas",
            "macroVars": {
                "testVar": "testValue"
            },
            "testSetUp": "sasjs/tests/testsetup.sas",
            "testTearDown": "sasjs/tests/testteardown.sas"
        },
        "macroFolders": [
            "targets/sas9/macros"
        ],
        "programFolders": []
    }
]