sas and unix: rerunning your batches in a smarter way · sas and unix: rerunning your batches in a...

13
SAS and UNIX: Rerunning your batches in a smarter way Frankfurt 2018 Yaroslav Haiovyi, Intego Group, Kharkiv, Ukraine

Upload: others

Post on 27-Jul-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SAS and UNIX: Rerunning your batches in a smarter way · SAS and UNIX: Rerunning your batches in a smarter way Frankfurt 2018 YaroslavHaiovyi, IntegoGroup, Kharkiv, Ukraine

S A S a n d U N I X : R e r u n n i n g y o u r b a t c h e s i n a s m a r t e r w a y

Frankfurt 2018

Yaroslav Haiovyi, Intego Group, Kharkiv, Ukraine

Page 2: SAS and UNIX: Rerunning your batches in a smarter way · SAS and UNIX: Rerunning your batches in a smarter way Frankfurt 2018 YaroslavHaiovyi, IntegoGroup, Kharkiv, Ukraine

Page 2

Batch #n

__________________________

Manual__________________________

“runbatch” file

X "sas ad_asl.sas"X "sas qc_ad_asl.sas"X "sas ad_aefga.sas"X "sas qc_ad_aefga.sas"...........................

__________________________

makefile

???

Three ways to run batches

Page 3: SAS and UNIX: Rerunning your batches in a smarter way · SAS and UNIX: Rerunning your batches in a smarter way Frankfurt 2018 YaroslavHaiovyi, IntegoGroup, Kharkiv, Ukraine

Page 3

Excel file

SAS programnew SAS program

(addition to makefile)

Makefile

Step-by-step solution

Page 4: SAS and UNIX: Rerunning your batches in a smarter way · SAS and UNIX: Rerunning your batches in a smarter way Frankfurt 2018 YaroslavHaiovyi, IntegoGroup, Kharkiv, Ukraine

<tab>command1<tab>………<tab>commandN

A target is the name of a file that is generated by a program. A prerequisite is a file that is used as an input to create the target. A command is an action that should be run.

target: prerequisite1 … prerequisiteN

t(target) > t(prerequisite1) ?………………………..t(target) > t(prerequisiteN) ?

Page 4

Structure of the makefile

Page 5: SAS and UNIX: Rerunning your batches in a smarter way · SAS and UNIX: Rerunning your batches in a smarter way Frankfurt 2018 YaroslavHaiovyi, IntegoGroup, Kharkiv, Ukraine

Page 5

Libname_ Path_sdtm_1 /project1/study1/SDTMFOLDER/sdtm_2 /project2/study2/SDTMFOLDER/sdtm ./SDTMFOLDERadam ./ADAMFOLDERoutputs ./outputsfolder

Libname_ : contains the name of libraries that are used in SAS program.

Path_ : contains the path to the folders where the files are located. Need to be consistent with UNIX command line.

*.XLS input (Libraries)

Page 6: SAS and UNIX: Rerunning your batches in a smarter way · SAS and UNIX: Rerunning your batches in a smarter way Frankfurt 2018 YaroslavHaiovyi, IntegoGroup, Kharkiv, Ukraine

Page 6

Libname_ Dataset_ Relations_Data

Relations_Prog Command_1 Command_QC

sdtm DM _empty_ _empty_ _empty_ _empty_sdtm AE _empty_ _empty_ _empty_ _empty_sdtm DS _empty_ _empty_ _empty_ _empty_adam ADSL sdtm.DM ad_adsl.sas sas ad_adsl.sas sas qc_ad_adsl.sas

adam ADAE sdtm.AE adam.ADSL ad_adae.sas sas ad_adae.sas sas qc_ad_adae.sas

*.XLS input (Datasets)

Page 7: SAS and UNIX: Rerunning your batches in a smarter way · SAS and UNIX: Rerunning your batches in a smarter way Frankfurt 2018 YaroslavHaiovyi, IntegoGroup, Kharkiv, Ukraine

Page 7

Libname_ Output_ Relations_Data

Relations_Prog Command_1 Command_QC

outputs t_ae.out adam.ASLadam.ADAE t_ae.sas sas t_ae.sas sas qc_t_ae.sas

outputs l_demog.out ADAM.adsl l_demog.sas sas l_demog.sas _empty_

*.XLS input (TLGs)

Page 8: SAS and UNIX: Rerunning your batches in a smarter way · SAS and UNIX: Rerunning your batches in a smarter way Frankfurt 2018 YaroslavHaiovyi, IntegoGroup, Kharkiv, Ukraine

Page 8

RAWs_and_Other

SDTMs

ADaMs

Tables Listings Graphs

Datasets

TLGs

Order of groups

RAWs_and_Other

SDTMs

ADaMs

Tables Listings Graphs

Datasets

TLGs

Page 9: SAS and UNIX: Rerunning your batches in a smarter way · SAS and UNIX: Rerunning your batches in a smarter way Frankfurt 2018 YaroslavHaiovyi, IntegoGroup, Kharkiv, Ukraine

Page 9

All Groups DatasetsTLGs

Libname_ Dataset_ Relations_Data

sdtm DM _empty_sdtm AE _empty_adam ADSL sdtm.DM

adam ADAE sdtm.AE adam.ADSL

Libname_ Dataset_ Relations_Data

sdtm DM _empty_sdtm AE _empty_

adam ADSL DELETED!

adam ADAE DELETED!adam.ADSL

Sorting order

Page 10: SAS and UNIX: Rerunning your batches in a smarter way · SAS and UNIX: Rerunning your batches in a smarter way Frankfurt 2018 YaroslavHaiovyi, IntegoGroup, Kharkiv, Ukraine

Page 10

RAWs_and_Other SDTMs

ADaMsTables

Listings Graphs

System:

Line-by-line creation

RAWs_and_Other SDTMs

ADaMsTables

Listings Graphs

System:

Page 11: SAS and UNIX: Rerunning your batches in a smarter way · SAS and UNIX: Rerunning your batches in a smarter way Frankfurt 2018 YaroslavHaiovyi, IntegoGroup, Kharkiv, Ukraine

Page 11

In chain order

Data1

Data2

Data3

Data1

Data2

Data1

Not in Chain order

Page 12: SAS and UNIX: Rerunning your batches in a smarter way · SAS and UNIX: Rerunning your batches in a smarter way Frankfurt 2018 YaroslavHaiovyi, IntegoGroup, Kharkiv, Ukraine

Selective Rerun

Page 12

Rerun adam.ADSL = Rerun everything ???

SAS program

Makefile

Rename FILE to

OLD_FILE

Create FILE

Compare FILE and

OLD_FILE

1. Keep FILE and delete OLD_FILE OR

2. Delete FILE and rename OLD_FILE

COMMAND is Run “SAS program”

Page 13: SAS and UNIX: Rerunning your batches in a smarter way · SAS and UNIX: Rerunning your batches in a smarter way Frankfurt 2018 YaroslavHaiovyi, IntegoGroup, Kharkiv, Ukraine

Yaroslav [email protected]

Kharkiv, Ukrainewww.intego-group.com

T H A N K Y O U