Published on :
Macro EXTERNE

Allocation Macro for Read-Only Libraries (allocr)

This code is also available in: Deutsch Español Français
This macro initializes the working environment for protocol 'DRUG001C3001'. It defines a global variable '_ptlibref_', assigns several librefs (der, stats) pointing to specific Windows directories in read-only mode, and configures the format search path (fmtsearch) to include multiple levels of format libraries (increment, protocol, drug, office, client).
Data Analysis

Type : EXTERNE


The script configures access to external folders via absolute Windows paths (C:\pharma\...).

1 Code Block
MACRO
Explanation :
Definition of the %allocr macro which initializes libraries and formats. Uses Windows-style file paths that will need to be adapted for a Linux/Viya environment.
Copied!
1%macro allocr;
2 
3 %*- declare which libref to use for the "protocol" and "titles" dataset -;
4 %global _ptlibref_;
5 %let _ptlibref_=der;
6 
7 LIBNAME der "C:\pharma\xenuyama\tokyo\DRUG001\DRUG001C3001\24weeks\data\derived"
8 access=readonly;
9 LIBNAME stats "C:\pharma\xenuyama\tokyo\DRUG001\DRUG001C3001\24weeks\data\analysis"
10 access=readonly;
11 
12 *- assign format libraries for increment, protocol, drug, office and client -;
13 LIBNAME iformats "C:\pharma\xenuyama\tokyo\DRUG001\DRUG001C3001\24weeks\formats"
14 access=readonly;
15 LIBNAME pformats "C:\pharma\xenuyama\tokyo\DRUG001\DRUG001C3001\formats"
16 access=readonly;
17 LIBNAME dformats "C:\pharma\xenuyama\tokyo\DRUG001\formats" access=readonly;
18 LIBNAME oformats "C:\pharma\xenuyama\tokyo\formats" access=readonly;
19 LIBNAME cformats "C:\pharma\xenuyama\formats" access=readonly;
20 
21 options fmtsearch=(iformats.formats pformats.formats dformats.formats
22 oformats.formats cformats.formats);
23 RUN;
24 
25 %put NOTE: fmtsearch=%sysfunc(getoption(fmtsearch));
26 
27%mend allocr;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Copyright Info : Roland Rashleigh-Berry