SDTM DM Dataset Creation

This code is also available in: Deutsch Español English Français
Difficulty Level
Beginner
Published on :
The script begins by defining the path to the local GitHub repository and deletes previously defined macros to ensure a clean environment. It then configures SAS© options to include custom macros in the specified path and assigns libnames for SDTM data and metadata. The %dm_create macro is called with parameters to generate a demographic dataset (dm10) with a specified number of subjects, sites, countries, dates, and probabilities. Finally, the %sdtm_attrs macro is used to finalize the attributes of the generated dataset (dm10) according to SDTM standards and saves it as sdtm.dm.
Data Analysis

Type : CREATION_INTERNE


The 'dm10' dataset is internally created by the %dm_create macro, which programmatically generates data based on the provided parameters (number of subjects, countries, sex, etc.). The final 'sdtm.dm' dataset is an enriched version of 'dm10'.

1 Code Block
Configuration
Explanation :
This block initializes macro variables (`path`, `seed`), deletes old macro definitions to ensure a clean environment, configures the `mprint` option for macro debugging, and adds the path of custom macros to `sasautos`. It also defines the `sdtm` and `meta` libraries for data and metadata access.
Copied!
1%let path = H:\GitHub\srosanba\sas-sdtm-simulator;
2 
3%sysmacdelete list2format / nowarn;
4%sysmacdelete required / nowarn;
5%sysmacdelete dm_create / nowarn;
6%sysmacdelete sdtm_attrs / nowarn;
7 
8options mprint sasautos=("&path/macros" sasautos);
9 
10LIBNAME sdtm "&path/data";
11LIBNAME meta "&path/meta" access=readonly;
12 
13%let seed = 8675309;
2 Code Block
Macro %dm_create Data
Explanation :
The %dm_create macro is called to generate a new dataset named `dm10`. The parameters specify the number of subjects and sites, the list and proportions of countries, the first and last visit dates of the first subject, screening, treatment, and follow-up durations, the probability of death, and sex distribution.
Copied!
1*---------- create dm dataset ----------;
2%dm_create
3 (out=dm10
4 ,subjid_n=40
5 ,siteid_n=5
6 ,country_list=(USA,CAN,MEX)
7 ,country_table=(.6,.2,.2)
8 ,fpfvdt=01oct2016
9 ,lpfvdt=01apr2017
10 ,screendur=3
11 ,treatdur=182
12 ,followupdur=28
13 ,deathprob=0.05
14 ,sex_table=(.6,.4)
15 );
3 Code Block
Macro %sdtm_attrs
Explanation :
The %sdtm_attrs macro is used to apply the standard attributes of the SDTM (Study Data Tabulation Model) to the previously created `dm10` dataset. The resulting dataset, with finalized attributes, is saved as `sdtm.dm` in the `sdtm` library.
Copied!
1*---------- finalize attributes ----------;
2%sdtm_attrs
3 (DATA=dm10
4 ,out=sdtm.dm
5 ,domain=dm
6 );
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.

Related Documentation

Aucune documentation spécifique pour cette catégorie.