0% found this document useful (0 votes)
55 views38 pages

6 - Life Science Analytics Framework Programming - Lesson 2

Uploaded by

fzannier.lab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views38 pages

6 - Life Science Analytics Framework Programming - Lesson 2

Uploaded by

fzannier.lab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Lesson 2 Working with Jobs

2.1 Introduction to Jobs ............................................................................................................... 2-3

2.2 Transient Workspace .............................................................................................................. 2-5

2.3 Creating a Job ......................................................................................................................... 2-8

2.4 Job Parameters ..................................................................................................................... 2-11

2.5 Job Execution: Batch and Interactive ................................................................................ 2-14

2.6 Job Manifest .......................................................................................................................... 2-15

2.7 Published Job Execution ..................................................................................................... 2-16

2.8 Published History.................................................................................................................. 2-17

2.9 Impact Analysis ..................................................................................................................... 2-20

2.10 Running a Job as the Owner ............................................................................................... 2-22

2.11 Scheduling a Job .................................................................................................................. 2-23

2.12 Job Subscriptions ................................................................................................................. 2-24

2.13 Lesson Quiz ........................................................................................................................... 2-25


2-2 Lesson 2 Working with Jobs

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.1 Introduction to Jobs 2-3

2.1 Introduction to Jobs

What Is a Job in SAS Life Science Analytics Framework?


A job is a collection of information that describes the following:
• Details – path(s) for location(s) where the job log, listing, LSAF JOB
and manifest files are written
Details / / Location
• Programs (Tasks) – one or more SAS and/or R programs Programs
that the user would like to execute as part of the Job
Parameters – Macro Variables
• Parameters – definitions of SAS global macro variables Publish Setup
and R global variables with dynamic run-time values
Check-in
• Publish Setup – file and/or folder path(s) that are used
Publish History
by executing tasks Publish History

• Check-in – folder(s) where output(s) generated


are checked in to the Repository
• Publish History (Published Jobs – Repository Only) – displays status information about
each Repository execution of the job 4
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Why Is a Job Required?


• The SAS Life Science Analytics Framework Content Repository uses
a versioned file system to store content.
• The job definition enables SAS Life Science Analytics Framework to extract
designated files from the Content Repository and put those files onto
the Transient Workspace as required for SAS and/or R execution.
• There are two types of jobs:
• workspace job
• published job
• The primary difference between a workspace job and a published job
is the physical location of the programs, inputs, and resulting outputs.

5
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-4 Lesson 2 Working with Jobs

Workspace Job versus Published Job

User Workspace Transient Workspace


New session created via SAS New session created for
and/or R Program Editor each published job run Versioned File
Job – defined by user Job – stored in repository Repository
• Inputs • Inputs
• Outputs 1. job
• Outputs
• Parameters • Parameters Aa
Raw Bb
Project 1 Analysis 1 Cc
3. outputs Project 2 Analysis 2 Aa

Org
Project 3 Analysis 3 SDTM Bb
Project 4 AdaM Cc

Files synchronized manually Files synchronized from


from repository by user repository via job inputs list
Aa Aa

Project 1 Analysis 1
Raw Bb
Cc Project 1 Analysis 1
Raw Bb
Cc
2. inputs
Project 2 Analysis 2 Aa Project 2 Analysis 2 Aa
Org
Org

Project 3 Analysis 3 SDTM Bb Project 3 Analysis 3 SDTM Bb


Project 4 AdaM Cc Project 4 AdaM Cc

6
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.2 Transient Workspace 2-5

2.2 Transient Workspace

What Is a Transient Workspace?


Transient workspace is a folder location,
/lsafshared/SASWorkspaces/.transient, where:

• A new folder is created for each execution of a published job.


• SAS and/or R programs and the files and folders defined as inputs in a job
definition are copied.
• Empty folders defined as outputs in the job definition are created.
• Outputs generated by the execution of SAS and/or R programs are written.
• Generated outputs are checked back into the repository from here.
• When the actions above are completed successfully, the folder is deleted
automatically.
8
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Transient Workspace
• Transient workspace disk usage depends on the number of existing
SAS and/or R sessions and content underneath them copied as a result
of the job definition.
• Users do not have direct access to this location and cannot see
the content of this location.
• The Sessions tab enables users to see content for each existing
SAS and/or R session in the transient workspace for the current user
or
for all users, depending on the privilege.
• Users should clear existing sessions from the transient workspace when
the sessions are deemed not required. Use the Delete functionality on
the Sessions tab to clear the sessions.
9
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-6 Lesson 2 Working with Jobs

Workspace Jobs
A workspace job is executed via .SESSIONS on the SAS and/or R server,
and log/lst/mnf files are copied in the workspace.
WORKSPACE

USER WORKSPACE

JOB
SAS SERVER
.SESSIONS

R SERVER

LINUX FILE SYSTEM

10
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Repository Jobs
A repository job is executed by copying content to the .TRANSIENT
workspace. SAS and/or R programs are executed on the SAS and/or R server,
and outputs are checked back in to the repository.
REPOSITORY WORKSPACE

SAS SERVER
.TRANSIENT
JOB 1
JOBID1

JOB 2 JOBID1
R SERVER
JOBID N
JOB N

BINARY FILE SYSTEM


LINUX FILE SYSTEM
11
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.2 Transient Workspace 2-7

Job Execution
A workspace job is executed via .SESSIONS on the SAS and/or R server, and
log/lst/mnf files are copied in the workspace.
A repository job is executed by copying content to .TRANSIENT on the SAS and/or R
server and outputs are checked back in the repository.
SAS SERVER
REPOSITORY WORKSPACE
R SERVER

USER WORKSPACE SASWORK

JOB 1 JOB

JOB 2 .SESSIONS

JOB N

.TRANSIENT
JOBID1

JOBID1

JOBID N

BINARY FILE SYSTEM 12


LINUX FILE SYSTEM
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Repository Job Execution


1. Based on the job definition, data is extracted from the repository and copied
to the transient workspace.
2. Using information from the transient workspace, SAS programs are executed
on the SAS and/or R server.
3. SAS programs outputs are generated in the transient workspace.
4. Outputs are written back to the repository.
1 2

4 3

LIFE SCIENCE ANALYTICS LIFE SCIENCE ANALYTICS FRAMEWORK


FRAMEWORK REPOSITORY TRANSIENT WORKSPACE
13
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-8 Lesson 2 Working with Jobs

2.3 Creating a Job

Creating a Job
In order for a SAS or R program to be run from the repository, it must
be called by a job. Jobs can be created only in the workspace.
There are two ways that a job can be created:
• Create an empty job: In the workspace, select the folder where the job
should be created and then select New Job. This creates an empty job
to be filled in manually. An empty job can also be created by selecting
the Jobs interface on the far right and clicking the New Icon.
• Create a prepopulated job: In the workspace, select one
or more programs and then select New Job from Program.
This creates a job that already has the selected programs
listed for execution.
• Select either Use Relative Paths or Use Absolute Paths when creating the job.
15
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Creating a Job
The job contains five panels:
• Details
• Programs
• Parameters
• Publish Setup
• Check-in
The contents of these panels can be entered manually.
It is a best practice to specify files, not folders, as inputs.
After SAS programs have been added to the job, the remaining panels
can be automatically populated using the Run and populate feature.
Note: The Run and populate feature does not work for R.
16
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.3 Creating a Job 2-9

Creating a Job: Run and Populate


Run and populate automatically places the log, lst,
and manifest files in the same directory location as
the job. It automatically populates Publish Setup
for SAS jobs.

After R programs have been added to the job, the remaining panels cannot
be automatically populated using the Run and populate feature. (Publish
setup specifications are not populated for R programs.)

Note: SAS programs and R programs can be added to the same job.

17
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Creating a Job
• All files referenced by a job (SAS or R programs, inputs) that are versioned
can have a specific version of each file selected, or the latest version
of the file can be used.
• Files that are not versioned when the job is created are set to use the
latest version.
• When you specify Publish Setup for files and/or folders as well as check
in folders manually, always specify only what is needed for the job.
• Do not select a folder and then select Include Subfolders as a way to avoid
specifying inputs and outputs. This copies needless items into the
transient area and takes up unnecessary resources.

18
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-10 Lesson 2 Working with Jobs

Creating an R Job
• R jobs must have the Check-in tab populated or else no outputs will be
checked back in to the repository upon completion of the job. This would
include jobs that have a combination of SAS and R programs to run.

• This is because R jobs do not have any sort of process like a SAS job, where
the SCAPROC procedure is run behind the scenes to capture outputs
within the SAS program. Because R jobs do not have this (including jobs
that have both SAS and R programs to run), the Check-in tab has to be
properly populated so that any outputs for R programs are checked in
to the correct areas within the repository.

19
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.4 Job Parameters 2-11

2.4 Job Parameters

Job Parameters
• Job parameters enable end users to modify SAS macro values or R global variables
that are then passed through the job into the SAS or R program at the time of
execution.
• The Variable Name value of a job parameter must be a macro variable name in a
SAS program or a global variable in an
R program within the job.
• Do not set the value of the macro variable or global variable in the SAS or R
program. Doing so overrides the value set by the job parameter.
• There are six parameter types: Character, Character (masked),
Date, File, Folder, and Numeric.

21
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Job Parameters
Character: any alphanumeric character value.
Character (masked): any alphanumeric character value, but the text
entered is not displayed in the job user interface. (used only for SAS
program parameters)
• Ensure that MPRINT and MACROGEN are not enabled. If they are,
the masked value will appear in the log.
• The parameter value on the Parameters tab in the manifest always hides
masked values.
Note: Do not use Character (masked): for R program parameters.
This causes an error when the program is run.

22
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-12 Lesson 2 Working with Jobs

Job Parameters
Date: enables the user to enter a date. The parameters window enables
the user to select a date from a calendar widget.
File: enables the user to navigate to a file in the user’s workspace or the
repository. The file is used as an input.
Folder: enables the user to navigate to a folder in the user’s workspace
or the repository. The folder is used as an input.
Numeric: enables the user to enter any numeric values.

23
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

SAS Program Parameters


Verify that the macro variable names are the same in the job and the program.
• Declare macro variables as global.

• Initialize the local default value in case it is executed as a stand-alone program.

• Delete the macro variables at the end of the program.

• Initialize run-time
values in the job.

24
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.4 Job Parameters 2-13

R Program Parameters
Verify that the macro variable names are the same in the job and the program.
• Initialize the local default value in case it is executed as a stand-alone program.
• test_r_var <-”Can you see me”

• Delete the macro variables at the end of the program.


• rm(test_r_var)

• Initialize run-time values in the job.

25
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-14 Lesson 2 Working with Jobs

2.5 Job Execution: Batch and Interactive

Job Execution: Batch and Interactive


A job can be run interactively or as a batch (schedule).
From the workspace or repository:
• Select the job and click the Run icon.
• Open the job and click the Run icon.
• Click the Jobs icon, open a job, and click the Run icon.
When a job is run interactively, if any parameters have been set for the job,
a user interface window is displayed. This window enables the user to
provide parameter values.
Jobs run from the workspace write output files to the workspace.
Jobs run from the repository write output files to the repository.

27
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.6 Job Manifest 2-15

2.6 Job Manifest

Job Manifest
The job manifest file is created after a job runs. It is a very useful file because it is the
source for a large amount of information about the job.
• the name, location, and version of the job
• the type of job (published or workspace)
• the user who submitted the job
• how the job was run (interactive, scheduler, task (process flow))
• the job completion status
• the date and time that the job was submitted and completed
• the SAS and/or R programs that ran
• the parameters that were used with the SAS and/or R programs
• metrics for the inputs and outputs
• links to the log and results
29
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Job Manifest
• The manifest file is an XML file.

• It includes metrics for execution time and


file-transfer time (for repository jobs).

• The manifest file includes links to the log and the listing,
which can be viewed from within the manifest file itself.

• The manifest file can help you with impact analysis.

30
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-16 Lesson 2 Working with Jobs

2.7 Published Job Execution

Published Job Execution


When running a job, the user has the option to accept the default values for
the parameters or to enter new values for the parameters.
When running a job in the workspace, the user must ensure that all SAS
and/or R programs and inputs have been copied to the workspace.
When running a job in the repository, the user must ensure the following:
• All SAS and/or R programs, parameters, and publish setup details are set
correctly in the job information. (Check-in information must also be
defined for R jobs.)
• All components of the job are available in the repository with Read access.
• The user has Read access to the files referenced in the job and Content
Write access to the output locations.
32
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Published Job Execution


• When a job is run, there is an attempt to check in (in other words, publish)
the outputs from the transient workspace to the repository.

• If the user running the job has Content Write permission to the output
location, then the outputs are published to the repository.

• A job can be tested in the workspace to check whether it will execute


successfully in the repository. The test checks for the existence of
necessary files and folders in the repository.
This will be noted in the manifest.

33
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.8 Published History 2-17

2.8 Published History

Job Publish History


A published job creates a Publish History. It is created the first time that a job is run,
and it tracks each subsequent job submission. Each entry in the Publish History
represents the associated session for each time that the job was run.
A Publish History for a job lists information about the status of the job run:
• Run Status
• Date Submitted
• Version
• Run-as User
• Submitted By
• Date Completed
• Session Status
• Run Information
35
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Job Publish History


To access a job’s Publish History, open the job and select Publish History
from the menu at the left of the display.
The job manifest is accessible from the Publish History at the upper right
of the Publish History display.

Note: If versioning is disabled for a job manifest file, the job manifest file
is overwritten each time that the job is run. An attempt to view
the job manifest for anything other than the most recent job run
results in an error message that states that the job manifest file does
not exist.

36
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-18 Lesson 2 Working with Jobs

Job Publish History


Run Status and Session Status in the Publish History determine whether files
from the job still exist in the transient workspace.
Status Run Information Transient Workspace Status
Job completed successfully. Transient Workspace content is purged at the end of the Job execution.

Job has completed with one or Transient Workspace content is purged at the end of the Job execution.
more warning messages in the SAS
and/or R log file.

Job has completed with one or Transient Workspace content is purged at the end of the Job execution.
more error messages in the SAS
and/or R log file.

Job fails due to insufficient Transient Workspace content has not been purged.
permissions to write to the Address the reason for check-in failure then retry the check-in.
specified Content Repository
location.

Job completed successfully; Transient Workspace content has not been purged.
outputs are not checked in to the Address the reason for check-in failure then retry the check-in.
Content Repository due to files
being checked out or check in
errors.
37
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Job Publish History


There are several reasons for a check-in failure:
• Permissions are set in a way that does not allow files to be checked in.
• An output file is checked out. Therefore, it cannot be overwritten.
• An output file is locked. Therefore, it cannot be overwritten.
• You do not have the Enable Versioning privilege and you are trying
to check in a versioned file.

38
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.8 Published History 2-19

Job Publish History


When the reason for the check-in failure is corrected, the check-in can
be retried using the Check-in icon in the upper right of the Publish History
display.
Note: Only the user who ran the job can retry check-in from the
Publish History. However, if a job has the Run as owner property
set, only the owner of the job can retry a check-in even if
another user ran the job.
Sessions can be deleted through the Publish History using the Delete icon
at the upper right of the Publish History display.
Note: It is not recommended that you delete a session when the job
output cannot be checked in because doing so eliminates the ability
to check in the output after check-in issues have been resolved.
39
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-20 Lesson 2 Working with Jobs

2.9 Impact Analysis

Impact Analysis
There is a visual indication as to whether files associated with a Published
Job, such as inputs and outputs or the job itself, have changed since the job
was last run. The specific details are reported in a new Health Status window.
Repository Job: the blue box surrounding the Job icon indicates a stale job.

Note: The Published Job must be executed in the repository in order to


establish the metadata that drives the impact analysis.
41
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Impact Analysis
A job with associated files that have changed is called a stale job.
Repository jobs have two properties that are unique to the job or a job version (if versioned).
The properties are displayed with other repository file properties for job files.
• Last run date: The date on which the job last ran to completion without failures.
• Health status: The health status of the job.
• Unknown: When there is no data about the last job run, the health status of the job (or a
version) is initialized to Unknown. Newly created jobs or jobs upgraded from prior releases
have an Unknown health status.
• Up to date: When a job runs to completion without failures and generates output files, its
health status is Up to date. None of the associated files have changed since the job ran.
• Stale: Modifications to associated files of the job or in locations that have associations to
the job run result in a Stale health status. Files that impact a stale job can be determined.
You can search the repository for jobs by their health status, which enables you to locate
stale jobs.
42
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.9 Impact Analysis 2-21

Impact Analysis
Repository Job; Files impacting job health status:

Click the icon to display the file(s) modified since the last run of the
Published job.

43
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-22 Lesson 2 Working with Jobs

2.10 Running a Job as the Owner

Running a Job as the Owner


• The ability to run a job as the owner is specified in the job properties.
• By default, the Run as owner property is not selected.
• To set the Run as owner property, you must own the job and have
Properties Write access permission to the job.

45
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Running a Job as the Owner


The option to run a job as the owner of the job is reset to No when one
of these actions occurs:
• The job is modified by a user other than the owner.
• The job is copied. (In the copy of the job, the option to run the job
as the owner of the job is reset.)
• The owner of the job is changed.
• The job is restored from the Recycle Bin.
When the run as job owner property is reset to No because of an update,
the owner of the job receives notification.

46
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.11 Scheduling a Job 2-23

2.11 Scheduling a Job

Scheduling a Job
• A schedule is a collection of information about a job to be run in the
future. This information includes the parameters of the job, the date
and time to run the job, and how often to run the job.

• A user must have either the Manage


My Schedules global privilege or the
Manage All Schedules global privilege
to create a scheduled job.

• A user with the Manage All Schedules global


privilege can view and edit a schedule for
another user.
48
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Scheduling a Job
• If you are editing another user’s schedule, you have the following
limitations:
• You cannot change the job or job version.
• If you do not have access permissions to the location of the job associated with
the user schedule hat you are trying to edit, you cannot edit the job parameter
values.
• Scheduled jobs can be created for the repository and the workspace.
• The Schedules panel enables users to create new scheduled jobs, view
future occurrences of jobs, and view historic occurrences of jobs.
• Allowed frequencies for scheduled jobs include Once, Minutes, Hourly,
Daily, and Weekly.

49
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-24 Lesson 2 Working with Jobs

2.12 Job Subscriptions

Job Subscriptions
Job subscriptions can be set for three types of events:
• Job Failure – A notification triggers when any job fails due to any reasons
such as check-in failures or errors in the log.
• Job Run – A notification triggers when an unscheduled job is run.
• Schedule Job Run – A notification triggers when scheduled job is run.
“Subscribe to a job” applies only to repository jobs.
Note: It is not possible to subscribe to a job for other users or groups.
Job Subscription Job Type Triggers
Job Failure All Check-in failures, errors in the log , and so on
Job Run Unscheduled When job is run
Schedule Job Run Scheduled When job is run
51
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Job Subscriptions – User Settings


Job subscriptions for a user can be viewed, updated, or deleted in the
Job Subscriptions panel under User Settings.

52
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.13 Lesson Quiz 2-25

2.13 Lesson Quiz

2.01 Questions: Job Basics


True/False
1. SAS and R programs can be executed interactively in the Program Editor
in the workspace and the repository.

2. Job definitions support only files as input.

3. Job definitions support files as output.

4. The information in the Check-in tab must be populated for R programs in the job in
order for files to be checked into the repository after the execution of the job.

5. SAS programs and R programs cannot be added to the same job.

54
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

2.01 Questions: Job Basics – Correct Answers


True/False
1. SAS and R programs can be executed interactively in the Program Editor
in the workspace and the repository.
False. SAS and R programs need to be run as jobs in the repository.
2. Job definitions support only files as input.
False. Both folders and file can be defined as input within the Publish Setup area.
3. Job definitions support files as output.
False. Only folders can be defined as output within the Publish Setup area.
4. The information in the Check-in tab must be populated for R programs in the job in
order for files to be checked into the repository after the execution of the job. True

5. SAS programs and R programs cannot be added to the same job. False

55
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-26 Lesson 2 Working with Jobs

2.02 Questions: Transient Workspace


True/False
1. All users can directly access the transient workspace.

2. The transient workspace is automatically cleaned for successful and


non-successful completion of jobs.

3. The SAS Sessions tab provides the ability to clean transient workspace.

56
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

2.02 Questions: Transient Workspace – Correct Answers


True/False
1. All users can directly access the transient workspace.
False. No application user has direct access to the transient
workspace.
2. The transient workspace is automatically cleaned for successful and
non-successful completion of jobs.
False. The transient workspace is automatically cleaned for successful
runs but not for non-successful completion of jobs.
3. The SAS Sessions tab provides the ability to clean transient workspace.
True. Depending on their privilege, users can clean their own or
everyone’s SAS sessions that exist in the transient workspace.

57
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.13 Lesson Quiz 2-27

2.03 Questions: Creating a Job


1. Which of the following is true?
a. Jobs can be created in the workspace or the repository.
b. Only one program can be selected prior to creating a new job. This prepopulates the
job with the program information.
c. If a new job is created (without initially selecting a program), an empty job
is created, and it must be filled in manually.
d. Absolute paths must always be used when creating a job.

2. True/False: Jobs can pass information into programs that they are running.

3. True/False: When selecting inputs for a job, it is always best to select the entire folder for
input.

4. True/False: By default, Enable versioning on all new output files is selected (on).
58
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

2.03 Questions: Creating a Job – Correct Answers


1. Which of the following is true?
a. Jobs can be created in the workspace or the repository.
b. Only one program can be selected prior to creating a new job. This prepopulates the
job with the program information.
c. If a new job is created (without initially selecting a program), an empty job is
created, and it must be filled in manually.
d. Absolute paths must always be used when creating a job.

2. True/False: Jobs can pass information into programs that they are running.
True, using parameters.
3. True/False: When selecting inputs for a job, it is always best to select the entire folder for
input. False. Best practice is to use only files that are needed for the program or
programs to execute.
4. True/False: By default, Enable versioning on all new output files is selected (on).
False. 59
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-28 Lesson 2 Working with Jobs

2.04 Questions: Job Parameters


True/False
1. Macro variable values can be set and passed to a program interactively
at run time using job parameters.

2. Using the Character (Masked) parameter type ensures that the macro
value will never be visible in any job artifact (log, lst, manifest, and
so on).

3. For File and Folder parameter types, users must manually type the path
to the object.

4. For Date parameter types, a widget is available for the user to select
the date. 60
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

2.04 Questions: Job Parameters – Correct Answers


True/False
1. Macro variable values can be set and passed to a program interactively
at run time using job parameters. True

2. Using the Character (Masked) parameter type ensures that the macro
value will never be visible in any job artifact (log, lst, manifest, and
so on). False

3. For File and Folder parameter types, users must manually type the path
to the object. False

4. For Date parameter types, a widget is available for the user to select
the date. True 61
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.13 Lesson Quiz 2-29

2.05 Questions: Running a Job


True/False
1. An interactive job can be run only in the repository.

2. Interactive jobs produce no outputs.

3. An interactive job run from the workspace writes its output files to the
repository.

4. Run and Populate is available when creating jobs for both SAS programs
and R programs.

62
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

2.05 Questions: Running a Job – Correct Answers


True/False
1. An interactive job can be run only in the repository. False

2. Interactive jobs produce no outputs. False

3. An interactive job run from the workspace writes its output files to the
repository. False

4. Run and Populate is available when creating jobs for both SAS programs
and R programs. False. Run and Populate is available only for
populating fields in jobs that have SAS programs.

63
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-30 Lesson 2 Working with Jobs

2.06 Questions: Manifest File


True/False
1. The manifest file is created for all job runs, whether they are run
interactively or in batch, from the repository or workspace.

2. The manifest file is a proprietary SAS file format (.mnf) that cannot
be read outside of Life Science Analytics Framework.

3. The manifest file includes execution times for different tasks, which can
help identify areas for performance improvements.

64
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

2.06 Questions: Manifest File – Correct Answers


True/False
1. The manifest file is created for all job runs, whether they are run
interactively or in batch, from the repository or workspace. True

2. The manifest file is a proprietary SAS file format (.mnf) that cannot
be read outside of Life Science Analytics Framework. False

3. The manifest file includes execution times for different tasks, which can
help identify areas for performance improvements. True

65
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.13 Lesson Quiz 2-31

2.07 Questions: Job Execution


1. Which global privilege or privileges does a user need to run a job
in the repository or workspace?

2. What are some common reasons that jobs might run properly
in the workspace but not in the repository?

3. What additional checks are done when a job runs is “tested” in the
workspace?

66
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

2.07 Questions: Job Execution – Correct Answers


1. Which global privilege or privileges does a user need to run a job
in the repository or workspace? Create Session or Manage Sessions
2. What are some common reasons that jobs might run properly
in the workspace but not in the repository?
The programs, parameters, and inputs have not been set correctly
in the job information.
The user running the job might not have Read access to the files referenced
in the job or Content Write access to the outputs location.
All components of the job are not available in the repository with Read access.
Output files might be checked out to another user.
3. What additional checks are done when a job runs is “tested” in the workspace?
The test checks for the existence of necessary files and folders in the repository.
67
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-32 Lesson 2 Working with Jobs

2.08 Questions: Publish History


True/False
1. Jobs run from both the Life Science Analytics Framework repository
and user workspace have a Publish History.

2. The job manifest is accessible from its Publish History.

68
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

2.08 Questions: Publish History – Correct Answers


True/False
1. Jobs run from both the Life Science Analytics Framework repository
and user workspace have a Publish History. False

2. The job manifest is accessible from its Publish History. True

69
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.13 Lesson Quiz 2-33

2.09 Multiple Choice Questions: Publish History

1. Why might a published job end with a check-in failure?


a. Permissions are set in a way that does not allow files to be
checked in.
b. An output file is checked out. Therefore, it cannot be overwritten.
c. An output file is locked. Therefore, it cannot be overwritten.
d. You do not have the Enable Versioning privilege, and you are trying
to check in a versioned file.
e. All of the above.

70
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

2.09 Multiple Choice Questions: Publish History –


Correct Answers
1. Why might a published job end with a check-in failure?
a. Permissions are set in a way that does not allow files to be
checked in.
b. An output file is checked out. Therefore, it cannot be overwritten.
c. An output file is locked. Therefore, it cannot be overwritten.
d. You do not have the Enable Versioning privilege, and you are trying
to check in a versioned file.
e. All of the above.

71
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-34 Lesson 2 Working with Jobs

2.10 Multiple Choice Question: Publish History

Why is it important to address any remaining transient workspace content


following each job run?
a. To ensure that all outputs produced by the job are checked in to the
appropriate repository location.
b. The transient workspace is a shared physical file system, and orphaned
content consumes that shared space.
c. Orphaned files might interfere with other sessions in the transient
workspace.
d. a and b

72
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

2.10 Multiple Choice Question: Publish History –


Correct Answer
Why is it important to address any remaining transient workspace content
following each job run?
a. To ensure that all outputs produced by the job are checked in to the
appropriate repository location.
b. The transient workspace is a shared physical file system, and orphaned
content consumes that shared space.
c. Orphaned files might interfere with other sessions in the transient
workspace.
d. a and b

73
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.13 Lesson Quiz 2-35

2.11 Questions: Impact Analysis


1. A Published Job can be stale for the following reasons:
a. Any input file(s) have been modified since last run.
b. Any output file(s) have been modified since last run.
c. The actual repository Job has changed.
d. All of the above.
2. True or False: Published Jobs that have inputs (to it) or outputs (from it)
modified after the initial run in the Repository have their icon bordered
by a blue square.
3. True or False: It is not possible to search for Published Jobs that are stale
(have inputs or outputs modified after the latest run of the Published
job).

74
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

2.11 Questions – Impact Analysis Correct Answers


1. A Published Job can be stale for the following reasons:
a. Any input file(s) have been modified since last run.
b. Any output file(s) have been modified since last run.
c. The actual repository Job has changed.
d. All of the above.
2. True or False: Published Jobs that have inputs (to it) or outputs (from it)
modified after the initial run in the Repository have their icon bordered
by a blue square. True
3. True or False: It is not possible to search for Published Jobs that are stale
(have inputs or outputs modified after the latest run of the Published
job). False

75
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-36 Lesson 2 Working with Jobs

2.12 Multiple Choice Questions:


Running a Job as the Owner
1. Which of the following is true?
a. The Run job as Owner flag is set when a job is created in the workspace.
b. If the owner of the job changes, Run job as Owner is automatically set to Yes.
c. If someone (other than the owner) updates the job, then Run job as Owner
is always reset to No.
d. Run job as Owner lets someone run a job in another user’s workspace.

2. Which of the following is a way to find out whether a job is “Run as the Owner.”
a. Publish History
b. job manifest details
c. Audit Trail
d. All of the above 76
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

2.12 Multiple Choice Questions:


Running a Job as the Owner– Correct Answers
1. Which of the following is true?
a. The Run job as Owner flag is set when a job is created in the workspace.
b. If the owner of the job changes, Run job as Owner is automatically set to Yes.
c. If someone (other than the owner) updates the job, then Run job as Owner
is always reset to No.
d. Run job as Owner lets someone run a job in another user’s workspace.

2. Which of the following is a way to find out whether a job is “Run as the Owner.”
a. Publish History
b. job manifest details
c. Audit Trail
d. All of the above 77
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2.13 Lesson Quiz 2-37

2.13 Questions: Scheduling Jobs


1. True/False: The global privilege Manage My Schedules or Manage All Schedules
is required to create a scheduled job.
2. Which of the following is not an allowed frequency for a scheduled job?
(Select all possible answers.)
a. once
b. daily
c. weekly
d. monthly
e. yearly
3. True/False: Jobs can be scheduled only in the repository.
4. True/False: Users with the privilege Manage All Schedules can edit the job or job
version in a schedule of another user.
5. True/False: Users with the privilege Manage All Schedules can pause or resume
scheduled jobs for another user. 78
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

2.13 Questions: Scheduling Jobs – Correct Answers


1. True/False: The global privilege Manage My Schedules or Manage All Schedules
is required to create a scheduled job. True
2. Which of the following is not an allowed frequency for a scheduled job?
(Select all possible answers.)
a. once
b. daily
c. weekly
d. monthly
e. yearly
3. True/False: Jobs can be scheduled only in the repository. False
4. True/False: Users with the privilege Manage All Schedules can edit the job or job
version in a schedule of another user. False
5. True/False: Users with the privilege Manage All Schedules can pause or resume
scheduled jobs for another user. True79
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
2-38 Lesson 2 Working with Jobs

2.14 Multiple Choice Questions: Job Subscriptions


1. A job subscription can be set to provide notification when which
of the following occurs?
a. A job runs.
b. A scheduled job runs.
c. A job fails.
d. All of the above.

2. Which of the following statements is not true?


a. Job subscriptions can be set in both the repository and the workspace.
b. Job subscriptions cannot be set for other users or groups.
c. Job subscriptions can be viewed and deleted from the User Settings
windows.
d. Job subscription notifications can be set for email or internal messaging,
80
or for both. Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

2.14 Multiple Choice Questions: Job Subscriptions –


Correct Answers
1. A job subscription can be set to provide notification when which
of the following occurs?
a. A job runs.
b. A scheduled job runs.
c. A job fails.
d. All of the above.

2. Which of the following statements is not true?


a. Job subscriptions can be set in both the repository and the workspace.
b. Job subscriptions cannot be set for other users or groups.
c. Job subscriptions can be viewed and deleted from the User Settings
windows.
d. Job subscription notifications can be set for email or internal messaging,
81
or for both. Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

You might also like