Create a SAS job

post/jobs
Internal-Use Only

Creates a new job to run a SAS program. The type of job is created depending on the Accept header. application/vnd.sas.batch.job.request.sas.batch+json headers creates a Batch job to run a SAS program. application/vnd.sas.batch.job.request.sas.line.mode+json headers creates a new interactive job to run SAS in line mode. application/vnd.sas.batch.job.request.command.batch+json headers creates a Batch job to run an arbitrary command. application/vnd.sas.batch.job.request.command.interactive+json headers creates an interactive job to run an arbitrary command.

Request Samples

1

Response Samples

1{
2 "creationTimeStamp": "2022-06-14T15:00:49.668113Z",
3 "createdBy": "someuser",
4 "modifiedTimeStamp": "2022-06-14T15:01:05.66361Z",
5 "modifiedBy": "anonymous",
6 "contextId": "6794ba8a-6aff-4989-ae77-93f67286aea2",
7 "endedTimeStamp": "2022-06-14T15:01:02Z",
8 "executionHost": "10.254.3.12",
9 "fileSetId": "JOB_20220614_150046_039_1",
10 "id": "dbbb00c3-e67c-408b-bd84-9b57a2d69472",
11 "links": [
12 {
13 "method": "GET",
14 "rel": "self",
15 "href": "/batch/jobs/dbbb00c3-e67c-408b-bd84-9b57a2d69472",
16 "uri": "/batch/jobs/dbbb00c3-e67c-408b-bd84-9b57a2d69472",
17 "type": "application/vnd.sas.batch.job"
18 },
19 {
20 "method": "GET",
21 "rel": "up",
22 "href": "/batch/jobs",
23 "uri": "/batch/jobs",
24 "type": "application/vnd.sas.collection",
25 "itemType": "application/vnd.sas.batch.job"
26 }
27 ],
28 "name": "testEnvVars",
29 "processId": "b7e39cf9-eda7-400c-a752-301653e55e8e",
30 "workloadJobId": "5",
31 "returnCode": 0,
32 "state": "completed",
33 "startedTimeStamp": "2022-06-14T15:00:49Z",
34 "submittedTimeStamp": "2022-06-14T15:00:49Z",
35 "version": 1
36}

Request Body

Job request to run a SAS program as a background task.

NameTypeRequiredDescription
fileSetId
string
true

Specifies the ID of the file set to use for transporting files to and from the job.

launcherOptions
Job Launch Options
true

Options that are passed on every job request that describe how to process the job.

restartType
string
false

Specifies whether the job can be restarted and the type of restart. 'job' indicates that the job is restarted and no checkpoint restart is done. 'label' indicates the job is restarted using SAS Label Checkpoint restart. 'none' indicates the job cannot be restarted. 'step' indicates the job is restarted using SAS Data Step Checkpoint restart.

Allowed values:
joblabelnonestep
listFile
string
false

Specifies the file name and, optionally, the path to use for the output SAS list file. If the specified name is a full path, the user must be able to access the existing directory or be able to create the directory path in the Batch server pod. If the specified path is only a file name and the outputDir option is specified, the SAS list file is placed in the specified output directory. If the specified path is only a file name and the outputDir option is not specified, the SAS list file is placed in the file set. The file name can use the following replaceable parameters in the file name or path: @STARTTIME@ - the start time of the Batch job in YYYY-MM-DD-hh-mm-ss format. @FILESETID@ - the file set ID. @SASPGMNAME@ - the base name of the SAS program. Available in version 2 and higher.

<= 1000 characters
logFile
string
false

Specifies the file name and, optionally, the path to use for the output SAS log file. If the specified name is a full path, the user must be able to access the existing directory or be able to create the directory path in the Batch server pod. If the specified path is only a file name and the outputDir option is specified, the SAS log file is placed in the specified output directory. If the specified path is only a file name and the outputDir option is not specified, the SAS log file is placed in the file set. The file name can use the following replaceable parameters in the file name or path: @STARTTIME@ - the start time of the Batch job in YYYY-MM-DD-hh-mm-ss format. @FILESETID@ - the file set ID. @SASPGMNAME@ - the base name of the SAS program. Available in version 2 and higher.

<= 1000 characters
outputDir
string
false

Specifies a directory in the server that is used to store job output. The default is to upload the files to the file set. The user must be able to either access the existing directory or create the directory path in the Batch server pod. The directory name can use the following replaceable parameters in the name or path: @STARTTIME@ - the start time of the Batch job in YYYY-MM-DD-hh-mm-ss format. @FILESETID@ - the file set ID. @SASPGMNAME@ - the base name of the SAS program. Available in version 2 and higher.

<= 1000 characters
sasProgramName
string
true

Specifies the file name of the program to process.

sasOptions
string
false

Specifies the SAS options to use on the SAS command line.

<= 1000 characters
watchOutput
boolean
false

Specifies whether the STDOUT of the Batch job is available for retrieval through the REST API.

version
integer<int32>
true

Specifies the version number of this representation schema. This is version 2.

>= 1<= 2

Responses

StatusMeaningDescription
201CreatedThe job was created.HeadersSchema
400Bad RequestThe create job request is not valid due to one of the following reasons. <UL> <LI> The request is not valid JSON. <LI> The version is not a number. <LI> The version is not a valid value. <LI> A required field is missing. <LI> A field's length is too long. <LI> An enumeration's value is not a valid value. <LI> The file set specified by the file set ID is not found. <LI> The context specified by the context ID is not found. <LI> The specified file set is not associated with the specified context. </UL> See the returned error response for more information.Schema
406Not AcceptableThe requested response type is not acceptable. See the returned error response for more information and acceptable response types.Schema