Los datos de origen para la creación del conjunto de datos `meta.eg_meta` se proporcionan directamente en el script a través de la instrucción `datalines`. Contienen información de metadatos (nombre de variable, tipo, longitud, etiqueta) para variables de un dominio de estudio clínico (EG).
1 Bloque de código
MACRO/LIBNAME
Explicación : Este bloque inicializa el entorno. Define una variable macro `path` para especificar la ubicación física de los archivos de la biblioteca. Luego, la declaración `libname` crea una biblioteca SAS llamada `meta`, vinculándola a la ruta definida. Esta biblioteca será el contenedor para el conjunto de datos `eg_meta`.
¡Copiado!
%let path = H:\GraphicsGroup\dummy\sdtm\r-style\meta;
libname meta "&path";
Explicación : Este `DATA STEP` es responsable de la creación y el llenado del conjunto de datos `meta.eg_meta`. Utiliza la instrucción `INPUT` para leer datos brutos estructurados, proporcionados a través de `datalines`, en las variables `name`, `type`, `length` y `label`. Luego se construye dinámicamente una nueva variable `attr`. Esta variable contiene una cadena de texto que representa los atributos SAS de una variable (nombre, etiqueta, longitud). La lógica `if type = "char"` garantiza que el símbolo `$` se agregue a la longitud para las variables de tipo carácter, lo cual es esencial para la correcta definición de los atributos en SAS.
¡Copiado!
data meta.eg_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
EGSEQ num 8 Sequence Number
EGGRPID char 25 Group ID
EGREFID char 25 ECG Reference ID
EGSPID char 25 Sponsor-Defined Identifier
EGTESTCD char 8 ECG Test or Examination Short Name
EGTEST char 50 ECG Test or Examination Name
EGCAT char 50 Category for ECG
EGSCAT char 50 Subcategory for ECG
EGPOS char 25 ECG Position of Subject
EGORRES char 25 Result or Finding in Original Units
EGORRESU char 25 Original Units
EGSTRESC char 25 Character Result/Finding in Std Format
EGSTRESN num 8 Numeric Result/Finding in Standard Units
EGSTRESU char 25 Standard Units
EGSTAT char 25 Completion Status
EGREASND char 200 Reason ECG Not Performed
EGFXN char 200 ECG External File Path
EGNAM char 200 Vendor Name
EGLEAD char 50 Lead Location Used for Measurement
EGMETHOD char 50 Method of ECG Test
EGBLFL char 1 Baseline Flag
EGDRVFL char 1 Derived Flag
EGEVAL char 200 Evaluator
VISITNUM num 8 Visit Number
VISIT char 100 Visit Name
VISITDY num 8 Planned Study Day of Visit
EGDTC char 19 Date/Time of ECG
EGDY num 8 Study Day of ECG
EGTPT char 25 Planned Time Point Name
EGTPTNUM num 8 Planned Time Point Number
EGELTM char 19 Planned Elapsed Time from Time Point Ref
EGTPTREF char 25 Time Point Reference
EGRFTDTC char 19 Date/Time of Reference Time Point
;
run;
1
DATA meta.eg_meta;
2
INPUT name $ 1-8 type $ 10-13LENGTH $ 16-18 label $ 22-61;
EGTESTCD char 8 ECG Test or Examination Short Name
18
EGTEST char 50 ECG Test or Examination Name
19
EGCAT char 50 Category for ECG
20
EGSCAT char 50 Subcategory for ECG
21
EGPOS char 25 ECG Position of Subject
22
EGORRES char 25RESULT or Finding in Original Units
23
EGORRESU char 25 Original Units
24
EGSTRESC char 25 Character RESULT/Finding in Std FORMAT
25
EGSTRESN num 8 Numeric RESULT/Finding in Standard Units
26
EGSTRESU char 25 Standard Units
27
EGSTAT char 25 Completion STATUS
28
EGREASND char 200 Reason ECG Not Performed
29
EGFXN char 200 ECG External File Path
30
EGNAM char 200 Vendor Name
31
EGLEAD char 50 Lead Location Used for Measurement
32
EGMETHOD char 50 Method of ECG Test
33
EGBLFL char 1 Baseline Flag
34
EGDRVFL char 1 Derived Flag
35
EGEVAL char 200 Evaluator
36
VISITNUM num 8 Visit Number
37
VISIT char 100 Visit Name
38
VISITDY num 8 Planned Study Day of Visit
39
EGDTC char 19 Date/Time of ECG
40
EGDY num 8 Study Day of ECG
41
EGTPT char 25 Planned Time Point Name
42
EGTPTNUM num 8 Planned Time Point Number
43
EGELTM char 19 Planned Elapsed Time from Time Point Ref
44
EGTPTREF char 25 Time Point Reference
45
EGRFTDTC char 19 Date/Time of Reference Time Point
46
;
47
RUN;
Este material se proporciona "tal cual" por We Are Cas. No hay garantías, expresas o implícitas, en cuanto a la comerciabilidad o idoneidad para un propósito particular con respecto a los materiales o el código contenidos en este documento. We Are Cas no es responsable de los errores en este material tal como existe ahora o existirá, ni We Are Cas proporciona soporte técnico para el mismo.
SAS y todos los demás nombres de productos o servicios de SAS Institute Inc. son marcas registradas o marcas comerciales de SAS Institute Inc. en los EE. UU. y otros países. ® indica registro en los EE. UU. WeAreCAS es un sitio comunitario independiente y no está afiliado a SAS Institute Inc.
Este sitio utiliza cookies técnicas y analíticas para mejorar su experiencia.
Saber más.