Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>SASjs - DevOps for SASNew to Visual Studio Code? Get it now.

SASjs - DevOps for SAS

SASjs

|
1,879 installs
| (4) | Free
Execute code on any SAS server, plus SAS Linting and Syntax Highlighting
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Visual Studio Code Extension for SASjs

All Contributors

This project contains the source code for the SASjs VS Code extension, available in the following locations:

  • Visual Studio Code Marketplace (suitable for VS Code): https://marketplace.visualstudio.com/items?itemName=SASjs.sasjs-for-vscode
  • Open VSX (Suitable for VSCodium and Theia): https://open-vsx.org/extension/sasjs/sasjs-for-vscode

Features

Code Execution

You can run code on SAS Viya, SAS 9 EBI or on regular Foundation SAS!

Execute code on SAS Viya

When a SAS program is selected, you can click the running man icon to execute that code on SAS Viya.

snippet

The first time you do this, you will receive a series of prompts:

  • Name of Target. This is an alias relating to the server on which you intend to run the code. It will be added as a GLOBAL target, located at ~/.sasjsrc. More info here).
  • Server Url. The full URL (including port if needed) of your SAS Viya server.
  • Server Type. Currenly only SAS Viya is supported.
  • CLIENT / SECRET. You will need to ask your administrator for these, and they should have the authorization_code grant type. More info here.
  • Select default. Click 'yes' to avoid having to select your target each time.

You can now execute code! You can also highlight a section of code and run that. Each log returned will be stored in a sasjsresults folder. You can also run the SASjs: Execute Code command from the command palette(Cmd+Shift+P).

Execute code on Foundation SAS

In order to run on Foundation / Base / Desktop SAS you will need a running version of SASjs server (on the same machine where SAS is installed). You can download SASjs server here. Configuration instructions are here.

Once SASjs server is running, just click the running man and select 'add new target'. Fill in the prompts as follows:

  1. Name of target. This is the alias for connecting to your chosen SAS server.
  2. serverUrl. The location of SASjs server, eg http://localhost:5000
  3. serverType. Choose SASJS

You can now execute code. The log will be returned in a new window.

SAS Lint and Format

Spend less time on code reviews and more time pushing code! Select VIEW->PROBLEMS (or ctrl+shift+M) to examine the currently opened SAS program for issues.

image

Rules can be configured by creating a .sasjslint file in the root of your project as follows:

{
    "noTrailingSpaces": true,
    "noEncodedPasswords": true,
    "hasDoxygenHeader": true,
    "noSpacesInFileNames": true,
    "maxLineLength": 80,
    "lowerCaseFileNames": true,
    "noTabIndentation": true,
    "indentationMultiple": 2
}

We've now added the ability to automatically fix certain problems within SAS files, such as trailing spaces, missing Doxygen header blocks and missing macro names in %mend statements. You can use this feature in two ways:

  1. On demand - by selecting 'Format Document' either from the right click menu or from the command palette. format

  2. By enabling automatic formatting of files on save/paste from the Settings menu. image

Syntax Highlighting

Two themes are provided with SAS Code formatting - a Light Theme and a Dark Theme

Contributions

SASjs is an open source project, and contributions are warmly welcomed!

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Allan Bowe

💻 ⚠️ 👀 📹 📖

Yury Shkoda

💻 ⚠️ 📆 📹 📖

Krishna Acondy

💻 ⚠️ 👀 🚇 📦 🚧 🖋

Muhammad Saad

💻 ⚠️ 👀 🧑‍🏫 📖

Sabir Hassan

💻 ⚠️ 👀 🤔

Mihajlo Medjedovic

💻 ⚠️ 👀 🚇

Vladislav Parhomchik

⚠️ 👀

This project follows the all-contributors specification. Contributions of any kind welcome!

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2022 Microsoft