0% found this document useful (0 votes)
90 views24 pages

6 - Life Science Analytics Framework Programming - Lesson 3

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)
90 views24 pages

6 - Life Science Analytics Framework Programming - Lesson 3

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

Lesson 3 Advanced Programming

Topics
3.1 Setup/Config Programs .......................................................................................................... 3-3

3.2 Relative Paths.......................................................................................................................... 3-4

3.3 Sessions................................................................................................................................... 3-8

3.4 Job of Jobs ............................................................................................................................ 3-11

3.5 SAS API Macros .................................................................................................................... 3-12

3.6 Best Practices ....................................................................................................................... 3-14

3.7 Lesson Quiz ........................................................................................................................... 3-18


3-2 Lesson 3 Advanced Programming Topics

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.1 Setup/Config Programs 3-3

3.1 Setup/Config Programs

Setup/Config SAS Programs


• Setup programs are used to make SAS code more portable from one project
to another. Typically, a setup file is included in every program within a project
so that there is consistency across the project. The setup file can contain
references to SAS data libraries, SAS macro autocall libraries (so that the
specific order used for macro variables is defined), SAS format catalogs,
and defined item stores (TEMPLATE procedure).
• To call a setup file into a Life Science Analytics Framework program (or any
other file), the programmer needs to use the special macro &_SASWS_
prepended to the absolute path of the setup.sas file.
Example: %include"_&sasws_/org/project1/study1/macros/setup.sas";
• A setup file can be used in Life Science Analytics Framework and can
facilitate the use of relative path programming.
3
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Setup/Config R Programs
• Setup programs are used to make R code more portable from one project
to another. Typically, a setup file is included in every program within a
project so that there is consistency across the project. The setup file can
contain references to R data frames, R global variables, paths, and so on.
• To call a setup file into a Life Science Analytics Framework program (or any
other file), the programmer needs to use the special global variable
LSAF_WS pasted to the absolute path of the file.
Example: source(paste(LSAF_WS,"/Test area/R-code/paths.R",sep=""))
• A setup file can be used in Life Science Analytics Framework and can
facilitate the use of relative path programming.

4
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.
3-4 Lesson 3 Advanced Programming Topics

3.2 Relative Paths

Relative Paths in SAS Programs


Relative paths in Life Science Analytics Framework are available in SAS programs and jobs.
For program use:
The &_SASFILEPATH_ macro always resolves to the SAS program location (fully qualified path).
The &_SASFILELOCATION_ macro resolves to the folder of the SAS program location.
%let base_path=&_sasws_./&_SASFILELOCATION_;
Note: The SAS program must be saved to a location to have a qualified path. If the program
is not saved, the macro variable does not resolve correctly.
libname sasdata “&base_path./data"; /*data folder below base path*/
%include "&base_path./../testinc.sas"; /*testinc.sas is one level above base path*/

This concept can be extended to allow for modifications in the hierarchy structure.
Even if the hierarchy structure changes, the SAS program might not need to be modified.

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

Relative Paths in SAS Programs


For example:
* Study Specific Related Directories;
%let study_data_dir=&base_path./data/adam
This can be done for all library reference used in the SAS code.
%let study_macro_dir=&base_path./macros
%let study_fmt_dir=&base_path./format
%let study_output_dir=&base_path./output

The library reference in the SAS code is


libname sasdata "&study_data_dir ";

7
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.
3.2 Relative Paths 3-5

Relative Paths in SAS Programs


Here is an example of using the &_SASFILELOCATION_ macro, which
resolves to the location of the SAS program.

Location of input data

Location of PDF output

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

Relative Paths in R Programs


Relative paths in Life Science Analytics Framework are available for R programs and jobs.
For program use: The LSAF_FILEPATH global variable always resolves to the R program location.
It contains the fully qualified path. The global variable LSAF_FILELOCATION resolves to just the
folder path information.
Note: The R program must be saved to a location to have a qualified path/location. If the program
is not saved, the global variables do not resolve correctly. Also, the Paste function is used
to concatenate the needed information to resolve to the correct item in the workspace
or repository.
png(paste(LSAF_WS,LSAF_FILELOCATION,"/output/Boxplot.png",sep=""));
/*Boxplot.png is below location of program file, within output folder*/
png(paste(LSAF_WS, LSAF_FILELOCATION,”/../Boxplot.png",sep=""));
/*Boxplot.png is one level above location of program file*/

This concept can be extended to allow for modifications in the hierarchy structure.
Even if the hierarchy structure changes, the R program
9 might not need to be modified.
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.
3-6 Lesson 3 Advanced Programming Topics

Relative Paths in R Programs


For example:
* Study Specific Related Directories;
study_data_dir <<- paste(LSAF_FILELOCATION,"/data",sep="")

The reference in the R code is


df <- list.files(paste(LSAF_WS,study_data_dir,sep=""), pattern=".RDS")
print(df)

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

Relative Paths in R Programs


Get initial global
variable that has
the path to the
R program.

Define path to the


location of the R data.

Define the relative


path from the
R program location
to list out the data frames in the library data location.
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.
3.2 Relative Paths 3-7

Relative Paths in Jobs


• For Life Science Analytics Framework jobs: By using relative paths for
the output locations (versus absolute paths), when the job is built, you
are able to see that the Log, Results, and Manifest output are all set
by a relative path.

Best Practice: A config (or setup) file can be changed if the hierarchy
changes. Programs are not changed and do not need to be revalidated.
This is based on a dynamic base path.

12
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.
3-8 Lesson 3 Advanced Programming Topics

3.3 Sessions

Sessions
The Sessions panel is used to keep track of SAS and/or R sessions that exist
in the application. It is accessed by clicking Sessions on the navigation bar.

The Show Query Builder icon toggles between showing and hiding the query
parameters for the Session panel.

The Manage All Sessions privilege allows a user to see all the sessions owned
by all users. The Sessions panel shows if there are jobs not finishing, if there are
excessive sessions opened by a user, and any ended sessions that are not able
to publish final results to repository.
14
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Session Types
Type of Sessions Example
Published jobs Any repository job
Session editor (SAS or R) Programs, logs (listings, data sets for SAS)
System sessions Data Standards and Study Management jobs
Workspace jobs Any workspace job
Test jobs Any workspace job runs with Test job option

15
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.
3.3 Sessions 3-9

Session States
State of Sessions Description Notes

Idle ( ) shows that the session is open but not


executing or that a program has
finished executing.
Active ( ) shows that the job or program is
currently running.
Ending ( ) shows that the job or program is
finishing completion.
Ended ( ) if job is executed from the workspace, The session is released in the following cases:
or a program is submitted from the • Browser session goes away due to
workspace, shows that the session is o Logout
ended by a user, or the job has o Browser session closed using X
completed. o Browser session times out
Ended ( ) if the job is executed from the Best practice is to always consult the Job Publish History to ensure that
repository, shows that the session has processing completed as expected, and all outputs are successfully checked in
been ended from the Session Viewer or to the content repository.
the job associated with the session has
completed with check-in errors.

Broken ( ) shows that there is a disconnection This rarely happens. When it does, it is usually due to some sort of network
from the SAS or R Server. issue. 16
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Sessions
• If a user does not have the Create Sessions privilege or the Manage Sessions
privilege, all programs and SAS data sets open only in the File Viewer.

• Initially, the query builder is visible. Users can query what types of sessions they
want to look for on the left side of the window. They can toggle the Hide/Show
Query Builder icon to show or hide the Query Parameters panel.

• When querying sessions, the Manage All Sessions privilege enables the user
to choose other sessions to review.
• Selecting a different user’s session opens the Details tab.
• Selecting the user’s own session opens that session with all included items
(details, results, logs, data sets, and programs).

17
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.
3-10 Lesson 3 Advanced Programming Topics

Sessions
• To start a new session, click the New Editor icon in the upper right corner. If a user
is already in a session, then the user can click the View Sessions icon and start a new
editor session.
• Each session is independent of all the others.
Note: Multiple programs opened within a single session share the session resources
(for example, the Work library).
• The Opened Items icon in the upper right corner informs the user how many sessions are
currently open and gives the user the option to close all of the items or individual sessions.
• The default is to have polling on (automatic refresh). This feature enables the user to refresh
the sessions that can be viewed based on the last query that was requested. A refresh is
automatically done approximately every five seconds. A user can toggle between
Disable/Enable automatic refresh using the icon. Disabling the automatic refresh enables
the user to manually choose when to run the query to view the sessions available. This gives
users more control of what they want to see.
Note: Disabling this feature lasts for only the active session.
18
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Sessions
• A user can end a session by clicking the End/Disconnect icon .
A user might want to end a session because of a non-ending job or an
interactive session with an infinite loop. (You need to terminate but want
to review the log.) Sessions that are ended go into ended state.
• A user can reconnect only to a session that the user started. When
this is done in an interactive session, it refreshes the session.
• Only the interactive session goes away when the browser times out.
A user activity (edits and so on) within the session keeps the browser
session active.
• A user can also end a session by clicking the Delete icon . This
removes or closes the session. If there are unsaved changes, a message
appears noting this.
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.
3.4 Job of Jobs 3-11

3.4 Job of Jobs

Job of Jobs
• Job of Jobs
• Calling one or more jobs from another job
• A caller job is referred to as a parent job, whereas a job being called is referred
to as a child job.
• Can retrieve a list of job parameters for each child job, update the values, and
submit the job with run-time values.

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

Job of Jobs
Child Program
• Main logic resides in the child program.
Child Job
• Defines parameters for any dynamic inputs or outputs.
• References one or more child programs.
Parent Program
• Identifies the list of objects for which specific child logic is to be repeated.
• Retrieves the list of parameters defined on the child job.
• Executes the child job n times by passing different run-time values for the child job
parameters.
Parent Job
• References the parent program.
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.
3-12 Lesson 3 Advanced Programming Topics

3.5 SAS API Macros

SAS API Macros


• SAS API macros in Life Science Analytics Framework enable you to use
some of the Java API functionality as SAS macros.

• The Life Science Analytics Framework macros enable you to use familiar
SAS syntax to make calls to Life Science Analytics Framework to perform
certain operations such as retrieving directory contents and its metadata
or managing users.

• SAS API macros can run from within Life Science Analytics Framework,
from a SAS server, or from local PC SAS.

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

SAS API Macros


Supported functionalities include:
• User Management
• Context Management
• Member Management
• Group Management
• Role Management
• File Management
• Permissions (ACLs)
• Recycle Bin Management
• Synchronization of Repository to Workspace
21
C o p y r i g h t © S AS In s t i tu t e In c. Al l r i g h t s re s e r ve d .

Copyright © 2022, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.
3.5 SAS API Macros 3-13

SAS API Macros


Example: %lsaf_getchildren;
Returns a SAS data set that contains the metadata for objects within a
container in the SAS
Syntax:
%lsaf_getchildren(LSAF_PATH=lsaf-path
<,LSAF_RECURSIVE=recursion-level,
SAS_DSNAME=SAS-data-set>);
Example:
%lsaf_getchildren(lsaf_path=/Training, lsaf_recursive=1);
Output Data Set:
work.lsafgetchildren: Contains metadata for the objects directly below Training
context.
26
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.
3-14 Lesson 3 Advanced Programming Topics

3.6 Best Practices

Best Practices: Defining a Job


• Use relative references for files defined within a job.
This enables the job and its dependent files to be copied to a different location
and still be successfully run, provided that the same hierarchy structure is used.

• Use descriptive text when defining parameter labels.


This text is presented to the user when the job is run, so text that is meaningful
will help the user understand the value required.
28
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Best Practices: Defining a Job


• Use file references when defining inputs where possible.
This reduces the amount of space required for the job to execute.
• Select the Enable versioning on all new output files setting only
if versioning is required.
Versioning files unnecessarily consumes content repository space.

29
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.
3.6 Best Practices 3-15

Best Practices: Defining a Job


• Take Advantage of Run and populate.
Most jobs can have inputs and outputs defined by using the Run and populate
option while defining, running, and testing the job in the user workspace. Effort
is reduced by having the job execution process define inputs and outputs for
the job based on defined programs, input data, and parameter values.
If there are conditional statements in the program, then only those executing
are included in Run and populate.

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

Best Practices: Defining a Job


• If a folder is required to be defined as an input, use with caution.
The recommendation is to create a subfolder and include only necessary files in the subfolder
to minimize content transferred to the transient workspace.
• Selecting the option Include Subfolders when selecting a folder path copies all files
at all levels from the specified location. This might cause one or more of the
following issues:
• All, or a significant percentage of, the allocated disc space can be used. This can occur
whether the job is run in the user workspace or the content repository.
• The elapsed time for the job
run can increase significantly
if a large volume of file
content is transferred to a
transient workspace.
• There can be a performance
degradation within the environment for all users if a large volume of file content
is transferred to a transient workspace. 31
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.
3-16 Lesson 3 Advanced Programming Topics

Best Practices: Running a Job


• Test all programs and jobs in the Life Science Analytics Framework user
workspace prior to running in the Life Science Analytics Framework
content repository. This includes doing a “test run” of the job in the
workspace to ensure that the correct files are in the repository.

• When you are testing a job in the user workspace, copy only those files
from the content repository that are required for the job to run
successfully.
Avoid synching complete folder structures to the user workspace unless
required because this results in unnecessary space consumption.

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

Best Practices: Job Error Handling


Common Errors
• Missing inputs
• Access permissions
• Incorrect path to the log file, SAS listing file, or job manifest file
• Files that a job is attempting to check in are checked out by another user or
process.
Notification of Job Failure
• Notifications of a published job failure are sent to subscribers of the job.
• Here are the options for subscribing to the job:
• Job Failed
• Job Run – an unscheduled job starting
• Scheduled Job Run – a scheduled job starting
• There is no subscription available for notification of the successful completion of a
job.
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.
3.6 Best Practices 3-17

Best Practices: Transient Workspace Content


• If a Job Publish step fails, the associated transient workspace content is not deleted.
When a job is opened from within the content repository, there is a link to the job manifest
file in the Publish History section of the job. Note that if the job manifest file is not versioned,
then only the manifest file
for the most recent job run
is available.

From Publish History, the publish (check-in) step can be retried after troubleshooting problems
with the job, or the associated SAS session can be deleted, which also clears the transient
workspace.

• Transient workspace content remains until an attempted check-in (publish) step


is successful or until the associated session
34
is deleted.
Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

Best Practices: Job Management


• Manually check the status of a published job using the Publish History
section of the job, which is accessible from within the content repository.
• If a published job fails due to a check-in issue, open the job manifest from
within the Publish History section of the job to determine the reason for
the failure.
• Do not delete jobs from the content repository if there are check-in
(publish) errors. If jobs are deleted and there were check-in errors, files
remain orphaned in the transient workspace.
• Remove any completed sessions remaining in the Session viewer.

35
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.
3-18 Lesson 3 Advanced Programming Topics

3.7 Lesson Quiz

3.01 Questions: Setup/Config


True/False
1. A setup file needs to be modified every time that there is a change to
the data within a project.

2. Using a setup file helps make programming within a project more


consistent.

3. A setup file does not support the work with relative paths.

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

3.01 Questions: Setup/Config – Correct Answers


True/False
1. A setup file needs to be modified every time that there is a change to
the data within a project. False.
The setup contains pointers to the data. If the data for a project
changes, the SAS code that uses the setup file just needs to be rerun.

2. Using a setup file helps make programming within a project more


consistent. True.
Data libraries and macro call paths are then all consistent.

3. A setup file does not support the work with relative paths. False.
The setup file can be included via a relative path and have relative
paths defined in it. 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.
3.7 Lesson Quiz 3-19

3.02 Questions: Relative Paths


True/False
1. Relative paths in a SAS program are derived from the location of the Life
Science Analytics Framework job.

2. If you have to choose a folder location as an input to a relative path


program, and that location is at a level above the SAS program, you
need to use ../ in the path to access that folder area.

3. Using relative paths in SAS code facilitates reuse.

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

3.02 Questions: Relative Paths – Correct Answers


True/False
1. Relative paths in a SAS program are derived from the location of the Life
Science Analytics Framework job. False.
Relative paths are derived from the SAS program, not the job.

2. If you have to choose a folder location as an input to a relative path


program, and that location is at a level above the SAS program, you
need to use ../ in the path to access that folder area. True

3. Using relative paths in SAS code facilitates reuse. True

40
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.
3-20 Lesson 3 Advanced Programming Topics

3.03 Questions: SAS Sessions


1. True/False: Each session is dependent on at least one other session.

2. True/False: Users query the types of sessions they want to review by toggling the Hide/Show Query Builder
icon.

3. True/False: A session state can be Active, Broken, Ended, Ending, or Idle.

4. Which of the follow is not a session type in Life Science Analytics Framework?
a. published jobs
b. SAS programs
c. system sessions
d. workspace jobs
e. audit trail processing

5. Which of the following is an example of a SAS session?


a. SAS programs run from workspace
b. Word and PDF documents
c. SAS data sets that are opened from the repository or workspace
41
d. a and c Copyr i ght © SAS I nsti tute I nc. Al l r i ghts reser ved.

3.03 Questions: SAS Sessions – Correct Answers


1. True/False: Each session is dependent on at least one other session. False. Each session is independent.

2. True/False: Users query the types of sessions they want to review by toggling the Hide/Show Query Builder
icon. True

3. True/False: A session state can be Active, Broken, Ended, Ending, or Idle. True

4. Which of the follow is not a session type in Life Science Analytics Framework?
a. published jobs
b. SAS programs
c. system sessions
d. workspace jobs
e. audit trail processing

5. Which of the following is an example of a SAS session?


a. SAS programs run from workspace
b. Word and PDF documents
c. SAS data sets that are opened from the repository or workspace
42
d. a and c 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.
3.7 Lesson Quiz 3-21

3.04 Questions: Job of Jobs


True/False
1. The Job of Jobs concept should be used to run multiple jobs together
sequentially.

2. In the Job of Jobs concept, repetitive task logic should be written in the
child job.

3. For the Job of Jobs concept, all jobs run in one SAS session.

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

3.04 Questions: Job of Jobs – Correct Answers


True/False
1. The Job of Jobs concept should be used to run multiple jobs together
sequentially. True

2. In the Job of Jobs concept, repetitive task logic should be written in the
child job. True

3. For the Job of Jobs concept, all jobs run in one SAS session. False.
There is one session for the parent job, and one session is created
for each child job execution.

44
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.
3-22 Lesson 3 Advanced Programming Topics

3.05 Questions: SAS API Macros


1. True/False: SAS API macros in Life Science Analytics Framework enable
you to use some of the Java API functionality as SAS macros and can be
run only from within PC SAS.

2. Name three functions that can be done using SAS API macros.

3. What information does the %lsaf_getchildren macro return?

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

3.05 Questions: SAS API Macros – Correct Answers


1. True/False: SAS API macros in Life Science Analytics Framework enable
you to use some of the Java API functionality as SAS macros and can be
run only from within PC SAS. False

2. Name three functions that can be done using SAS API macros.
Functions include User Management, Context Management, Member
Management, Group Management, Role Management, File Management,
Permissions (ACLs), Recycle Bin Management, Synchronization of Repository
to Workspace

3. What information does the %lsaf_getchildren macro return?


%lsaf_getchildren returns a SAS data set that contains the metadata
for objects within a container
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.
3.7 Lesson Quiz 3-23

3.06 Questions: Best Practices


1. True/False: The use of Include Subfolders is recommended when defining
job inputs.

2. What is an advantage to using Run and populate while defining, running, and
testing a job in the Life Science Analytics Framework user workspace?

3. True/False: All programs and jobs should be tested from the Life Science
Analytics Framework user workspace before running them in the content
repository.

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

3.06 Questions: Best Practices – Correct Answers


1. True/False: The use of Include Subfolders is recommended when defining
job inputs. False.
Include Subfolders copies all files at all levels from the specified Life Science
Analytics Framework repository location to the transient workspace, resulting
in significant space consumption and longer elapsed job run times. Limit input
definitions to only those files or folders (or both) required by the job.
2. What is an advantage to using Run and populate while defining, running, and
testing a job in the Life Science Analytics Framework user workspace?
Job development effort is reduced by having the job execution process define
inputs and outputs for the job based on defined SAS programs, input data,
and parameter values.
3. True/False: All programs and jobs should be tested from the Life Science
Analytics Framework user workspace before running them in the content
repository. True
48
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.
3-24 Lesson 3 Advanced Programming Topics

3.07 Questions: Best Practices


1. Why is it recommended that you use relative path references for files defined
within a job?

2. True/False: If a job has check-in (publish) errors and is deleted from the Life
Science Analytics Framework repository, files remain orphaned in the transient
workspace.

3. Bonus: Why is this an issue?

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

3.07 Questions: Best Practices – Correct Answers


1. Why is it recommended that you use relative path references for files defined
within a job? Because a relative path location is relative to where the job is
run, this approach enables the job and its dependent files to be copied to a
different Life Science Analytics Framework repository location and still be
successfully run, provided that the same hierarchy structure is used.

2. True/False: If a job has check-in (publish) errors and is deleted from the Life
Science Analytics Framework repository, files remain orphaned in the transient
workspace. True

3. Bonus: Why is this an issue? The transient workspace is a shared physical file
system, and orphaned content consumes that shared space.

50
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