The program first defines a library path via a macro variable, then assigns a 'meta' libname to this location. The core of the script is a DATA step that reads embedded textual data (via 'datalines') to build the 'meta.dm_meta' table. This metadata table is designed to describe the structure of another table. An 'attr' column is dynamically generated to format the attributes of each variable, suggesting later use in a dynamic programming process.
Data Analysis
Type : CREATION_INTERNE
Data is created directly within the script using a 'datalines' statement. No external data source or SASHELP reading is performed.
1 Code Block
DATA STEP Data
Explanation : This code block uses a DATA step to create the 'dm_meta' table in the 'meta' library. It reads the data provided between 'datalines' and ';', structuring it according to the 'name', 'type', 'length', and 'label' columns defined in the 'input' statement. An additional variable, 'attr', is calculated by concatenating the other fields to form a character string describing the attributes of each variable (label, length, and implicit type via '$').
Copied!
%let path = H:\GraphicsGroup\dummy\sdtm\r-style\meta;
libname meta "&path";
*--------------------------------------------------------------------------------;
*---------- metadata ----------;
*--------------------------------------------------------------------------------;
data meta.dm_meta;
input name $ 1-8 type $ 10-13 length $ 16-18 label $ 22-61;
length attr $100;
attr = trim(name) || " label='" || trim(label) || "' length=";
if type = "char" then
attr = trim(attr) || "$";
attr = trim(attr) || trim(length);
*--------1---------2---------3---------4---------5---------6-;
datalines;
STUDYID char 25 Study Identifier
DOMAIN char 2 Domain Abbreviation
USUBJID char 25 Unique Subject Identifier
SUBJID char 25 Subject Identifier for the Study
RFSTDTC char 19 Subject Reference Start Date/Time
RFENDTC char 19 Subject Reference End Date/Time
RFXSTDTC char 19 Date/Time of First Study Tretment
RFXENDTC char 19 Date/Time of Last Study Tretment
RFICDTC char 19 Date/Time of Informed Consent
RFPENDTC char 19 Date/Time of End of Participation
DTHDTC char 19 Date/Time of Death
DTHFL char 1 Subject Death Flag
SITEID char 25 Study Site Identifier
INVID char 25 Investigator Identifier
INVNAM char 200 Investigator Name
BRTHDTC char 19 Date/Time of Birth
AGE num 8 Age
AGEU char 10 Age Units
SEX char 1 Sex
RACE char 50 Race
ETHNIC char 50 Ethnicity
ARMCD char 8 Planned Arm Code
ARM char 50 Description of Planned Arm
ACTARMCD char 8 Actual Arm Code
ACTARM char 50 Description of Actual Arm
COUNTRY char 3 Country
DMDTC char 19 Date/Time of Collection
DMDY num 8 Study Day of Collection
;
run;
RFXSTDTC char 19 Date/Time of First Study Tretment
25
RFXENDTC char 19 Date/Time of Last Study Tretment
26
RFICDTC char 19 Date/Time of Informed Consent
27
RFPENDTC char 19 Date/Time of END of Participation
28
DTHDTC char 19 Date/Time of Death
29
DTHFL char 1 Subject Death Flag
30
SITEID char 25 Study Site Identifier
31
INVID char 25 Investigator Identifier
32
INVNAM char 200 Investigator Name
33
BRTHDTC char 19 Date/Time of Birth
34
AGE num 8 Age
35
AGEU char 10 Age Units
36
SEX char 1 Sex
37
RACE char 50 Race
38
ETHNIC char 50 Ethnicity
39
ARMCD char 8 Planned Arm Code
40
ARM char 50 Description of Planned Arm
41
ACTARMCD char 8 Actual Arm Code
42
ACTARM char 50 Description of Actual Arm
43
COUNTRY char 3 Country
44
DMDTC char 19 Date/Time of Collection
45
DMDY num 8 Study Day of Collection
46
;
47
RUN;
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.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.