Skip to content

sasjs job

The sasjs job command enables developers to perform operations on SAS Viya Jobs.

Prerequisites

Before using this command, you will need to:

Syntax

sasjs job <action> <job path> [additional arguments]

Additional arguments may include:

  • --target (alias -t) - the target environment in which to deploy the services. If not specified, the first target will be used instead.
  • --output (alias -o) - path where output of the finished job execution will be saved
  • --log (alias -l) - path where the log of the finished job will be saved (if used, -w is implied)
  • --wait (alias -w) - if present, CLI will wait for job completion.

sasjs job execute

Used to execute a job on the SAS server.

Syntax

sasjs job execute /Public/folder/someJob -l ./jobLog.log -o ./jobOutput.json -t targetName

Usage

# run the job using the target defined in sasjs add
sasjs job execute /Public/job -l ./jobLog.log -o ./jobOutput.json -t myTarget

This will create a session and run a SAS job. The log and output will be returned as files in the current directory.