Macros for SAS Application Developers
https://github.com/sasjs/core
mv_createjob.sas File Reference

Creates a Viya Job. More...

Go to the source code of this file.

Detailed Description

Code is passed in as one or more filerefs.

%* Step 1 - compile macros ;
filename mc url
  "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
%inc mc;

%* Step 2 - Create some SAS code and add it to a job;
filename ft15f001 temp;
parmcards4;
    data some_code;
      set sashelp.class;
    run;
;;;;
%mv_createjob(path=/Public/app/sasjstemp/jobs/myjobs,name=myjob)

The path to the job will then be shown in the log, eg as follows:

viya job location

SAS Macros

Parameters
[in]path=The full path (on SAS Drive) where the job will be created
[in]name=The name of the job
[in]desc=(Created by the mv_createjob.sas macro) The job description
[in]precode=() Space separated list of filerefs, pointing to the code that needs to be attached to the beginning of the job
[in]code=(ft15f001) Fileref(s) of the actual code to be added
[in]access_token_var=(ACCESS_TOKEN) Global macro variable containing the access token
[in]grant_type=(sas_services) Valid values:
  • sas_services
  • detect
  • authorization_code
  • password
[in]replace=(YES) select NO to avoid replacing any existing job
[in]addjesbeginendmacros=(false) Relates to the _addjesbeginendmacros setting. Normally this would always be false however due to a Viya bug (https://github.com/sasjs/cli/issues/1229) this is now configurable. Valid values:
  • true
  • false
  • 0 - this will prevent the flag from being set (job will default to true)
[in]contextname=() Choose a specific context on which to run the Job. Leave blank to use the default context. From Viya 3.5 it is possible to configure a shared context - see https://go.documentation.sas.com/?docsetId=calcontexts&docsetTarget=n1hjn8eobk5pyhn1wg3ja0drdl6h.htm&docsetVersion=3.5&locale=en
Version
VIYA V.03.04
Author
Allan Bowe

Definition in file mv_createjob.sas.