Module JobSubmissionService
Macros to execute jobs and to report the status of a submitted job.
Since: 2.1
%lsaf_getsubmissionstatus(lsaf_jobsubmission_id=);
[ Exposure:
external
]
- Gets the status of a repository or workspace job submission.
The SAS macro variable _lsafJobSubmissionStatus_ is set to the status value. The values are
NOT_SET, NOT_STARTED, STARTED, RUNNING_TASKS, POST_EXECUTION_PUBLISHING, COMPLETED_SUCCESSFUL,
COMPLETED_SASERRORS, COMPLETED_CHECKIN_ERROR, COMPLETED_SASERRORS_CHECKIN_ERROR,
COMPLETED_FAILED, COMPLETED_CANCELED, COMPLETED_SASWARNINGS, and
COMPLETED_SASWARNINGS_CHECKIN_ERROR.
If the macro runs without error, _lsafRC_ is set to 0, the _lsafJobSubmissionStatus_
macro variable is set to the appropriate value, and a job submission status message is
printed to the SAS log file. If the job completed with warnings or errors, the job submission
message shows in the SAS log file as a warning or an error, as appropriate.
Syntax:
%LSAF_GETSUBMISSIONSTATUS(LSAF_JOBSUBMISSION_ID=job-submission-id)
-
History:
- 2014-04-07
- initial code
- 2016-08-26
- rebrand as LSAF
- 2016-11-02
- added job submission message, updated doc
- 2019-02-11
- update to 2.1
-
-
Expected Macro Variables:
-
_lsafJobSubmissionStatus_
-
The job submission status.
-
_lsafMsg_
-
The return message.
-
_lsafRC_
-
The return code.
-
Parameters:
-
lsaf_jobsubmission_id
-
- Required - The submission identifier returned from the
lsaf_submitjob macro.
-
File: lsaf_getsubmissionstatus.sas
-
First available in version: 1.4
%lsaf_submitandpopulatewsjob(lsaf_path=, lsaf_userelativepaths=0, sas_dsname=);
[ Exposure:
external
]
- Submits a workspace job for immediate execution, and updates the input and output specifications
in the job based on inputs and outputs that are accessed during the job run. The SAS macro
variable _lsafPopulateWsJobSummissionId_ is set to the identifier for the job submission. If the
job cannot be submitted, _lsafPopulateWsJobSummissionId_ is set to blank.
If the job runs with errors, the job is not updated. If the job runs successfully or with
warnings, it is updated, and it replaces any existing input and output definitions in the job.
A data set that represents the job parameters values to overwrite for the current job submission
can be specified in the call of lsaf_submitandpopulatewsjob. If no job parameters data set is
specified, the default values for all job parameters are used.
The output data sets from either lsaf_getjobparameters or lsaf_getworkspacejobparameters
contain all of the data that is relevant to the parameters for a specific job and can be used as
a source for the input parameters data set for the lsaf_submitandpopulatewsjob macro. Modify the
data set with changes prior to calling lsaf_submitandpopulatewsjob.
- Rename the defaultValue variable to "value" or add a variable with the name "value" to
indicate the values to use for the current submission.
- Default job parameter values are used for missing parameters (deleted rows).
- Specifying an empty string for a parameter value results in using a blank as the parameter
value for the current submission.
- Added parameters are ignored.
- The parameters in the input data set are matched with the job parameters by name and type.
If no match is found for a parameter, its default value is used.
- Data set rows with duplicate values for a parameter name cause an execution error.
- DATE job parameter values must be in SAS datetime18. format (such as 02NOV2013:09:33:22) or
in SAS E8601DZ25. format (such as 2013-11-02T09:33:22-04:00). For SAS datetime18. format, an
offset of zero hours from GMT is used. To specify an offset from GMT, use the E8601DZ25. format.
Date values in formats other than the two described above result in an execution error.
Syntax:
%LSAF_SUBMITANDPOPULATEWSJOB(LSAF_PATH=lsaf-path <, LSAF_USERELATIVEPATHS=use-relative-paths,
SAS_DSNAME=SAS-data-set>);
-
History:
- 2016-10-20
- initial coding
- 2019-02-11
- update to 2.1
-
-
Expected Macro Variables:
-
_lsafMsg_
-
The return message.
-
_lsafPopulateWsJobSummissionId_
-
The job submission identifier.
-
_lsafRC_
-
The return code.
-
Parameters:
-
lsaf_path
-
- Required - The path of the job in the workspace of the current user.
-
lsaf_userelativepaths
-
- Optional - Indicates whether to generate inputs and outputs
as absolute or relative paths. Valid values:
- 0 (Default): Absolute paths.
- 1: Relative paths.
-
sas_dsname
-
- Optional - The name of the SAS data set that contains the job parameter
information, specified as libref.dataset. If not specified, the default job
parameters values aree used. The data set must contain at least the character
variables listed below. Additional variables are ignored.
- name: The name of the parameter.
- type: The parameter type. Valid values: CHARACTER, CHARACTER_MASKED, NUMERIC,
DATE, FILE, and FOLDER.
- value: The value of the parameter to use in the current job submission.
- fileVersion: The file version to use, if the parameter is of type FILE.
For versioned files, a blank value specifies the latest file version used. For
unversioned files, the value is ignored.
- includeSubFolders: Indicates whether the subfolders of a container are included
during job execution.
-
File: lsaf_submitandpopulatewsjob.sas
-
First available in version: 1.5
%lsaf_submitjob(lsaf_path=, lsaf_version=, sas_dsname=);
[ Exposure:
external
]
- Submits a repository job for immediate execution and sets the SAS macro variable
_lsafJobSubmissionId_ to the identifier for the job submission. If the job cannot be submitted,
_lsafJobSubmissionId_ is set to blank.
A data set that represents the job parameters values to overwrite for the currentjob submission
can be specified in the call of lsaf_submitjob. If no job parameters data set is specified, the
default values for all job parameters are used.
The output data set from the macro lsaf_getjobparameters contains all of the data that is relevant
to the parameters for a specific job and can be used as a source for the input parameters data
set for the lsaf_submitjob macro. Modify the data set with any changes prior to calling
lsaf_submitjob.
- Rename the defaultValue variable to "value" or add a variable with the name "value" to
indicate the values to use for the current submission.
- Default job parameter values are used for missing parameters (deleted rows).
- Indicating an empty string for a parameter value results in using a blank as the parameter
value for the current submission.
- Added parameters are ignored.
- The parameters in the input data set are matched with the job parameters by name and type.
If no match is found for a parameter, its default value is used.
- Data set rows with duplicate values for parameter name cause an execution error.
- DATE job parameter values must be in SAS datetime18. format (such as 02NOV2013:09:33:22), or
in SAS E8601DZ25. format (such as 2013-11-02T09:33:22-04:00). For SAS datetime18. format, an
offset of zero hours from GMT is used. To specify an offset from GMT, use the E8601DZ25.
format. Date values in formats other than the two described above result in an execution error.
Syntax:
%LSAF_SUBMITJOB(LSAF_PATH=lsaf-path <, LSAF_VERSION=lsaf-version,
SAS_DSNAME=SAS-data-set>);
-
History:
- 2014-04-09
- initial coding
- 2016-08-26
- rebrand as LSAF
- 2019-02-11
- update to 2.1
-
-
Expected Macro Variables:
-
_lsafJobSubmissionId_
-
The job submission identifier.
-
_lsafMsg_
-
The return message.
-
_lsafRC_
-
The return code.
-
Parameters:
-
lsaf_path
-
- Required - The path of the job in the repository.
-
lsaf_version
-
- Optional - The specific version number of the job. If not specified, the
the latest version of the job is submitted. Specifying a version for a non-versioned
file causes an error.
-
sas_dsname
-
- Optional - The name of the SAS data set that contains the job parameter
information, specified as libref.dataset. If not specified, the default job parameters
values are used. The data set must contain at least the character variables that are
listed below. Additional variables are ignored.
- name: The name of the parameter.
- type: The parameter type. Valid values: CHARACTER, CHARACTER_MASKED, NUMERIC,
DATE, FILE, and FOLDER.
- value: The value of the parameter to use in the current job submission.
- fileVersion: The file version to use, if the parameter is of type FILE. For
versioned files, a blank value results in the latest file version used. For
unversioned files, the value is ignored.
- includeSubFolders: Indicates whether the subfolders of a container are included
during job execution.
-
File: lsaf_submitjob.sas
-
First available in version: 1.4
%lsaf_submitworkspacejob(lsaf_path=, sas_dsname=);
[ Exposure:
external
]
- Submits a workspace job for immediate execution, and sets the SAS macro variable
_lsafWorkspaceJobSubmissionId_ to the identifier for the job submission. If the job cannot be
submitted, _lsafWorkspaceJobSubmissionId_ is set to blank.
A data set that represents the job parameter values to overwrite for the current job submission
can be specified in the call to lsaf_submitworkspacejob. If no job parameters data set is
specified, the default values for all job parameters are used.
The output data sets from either lsaf_getjobparameters or lsaf_getworkspacejobparameters contain
all of the data that is relevant to the parameters for a specific job and can be used as a source
for the input parameters data set for the lsaf_submitworkspacejob macro. Modify the data set with
any changes prior to calling lsaf_submitworkspacejob.
- Rename the defaultValue variable to "value" or add a variable with the name "value" to
indicate the values to use for the current submission.
- Default job parameter values are used for missing parameters (deleted rows).
- Specifying an empty string for a parameter value results in using a blank as the parameter
value for the current submission.
- Added parameters are ignored.
- The parameters in the input data set are matched with the job parameters by name and type.
If no match is found for a parameter, its default value is used.
- Data set rows with duplicate values for parameter name cause an execution error.
- DATE job parameter values must be in SAS datetime18. format (such as 02NOV2013:09:33:22), or
in SAS E8601DZ25. format (such as 2013-11-02T09:33:22-04:00). For SAS datetime18. format, an
offset of zero hours from GMT is used. To specify an offset from GMT, use the E8601DZ25.
format. Date values in formats other than the two described above result in an execution error.
Syntax:
%LSAF_SUBMITWORKSPACEJOB(LSAF_PATH=lsaf-path <, SAS_DSNAME=SAS-data-set>);
-
History:
- 2016-10-20
- initial coding
- 2019-02-11
- update to 2.1
-
-
Expected Macro Variables:
-
_lsafMsg_
-
The return message.
-
_lsafRC_
-
The return code.
-
_lsafWorkspaceJobSubmissionId_
-
The job submission identifier.
-
Parameters:
-
lsaf_path
-
- Required - The path of the job in the workspace of the current user.
-
sas_dsname
-
- Optional - The name of the SAS data set that contains the job parameter
information, specified as libref.dataset. If not specified, the default job
parameters values are used. The data set must contain at least the characater
variables that are listed below. Additional variables are ignored.
- name: The name of the parameter.
- type: The parameter type. Valid values: CHARACTER, CHARACTER_MASKED, NUMERIC,
DATE, FILE, and FOLDER.
- value: The value of the parameter to use in the current job submission.
- fileVersion: The file version to use, if the parameter is of type FILE.
For versioned files, a blank value results in the latest file version used.
For unversioned files, the value is ignored.
- includeSubFolders: Indicates whether the subfolders of a container are included
during job execution.
-
File: lsaf_submitworkspacejob.sas
-
First available in version: 1.5