relrec

Generate CDISC Relating Groups of Records in Separate Domain Datasets

%relrec (data = source dataset,
                  rdomain =
related domain,
                  studyid
= study identifier,
                  usubjid
= unique subject id,
                 
idvar = identification variable,
                  output =
output dataset,
                  basecode =
SAS/Base Code);

 

Where

Is Type...

And represents...

dataC (200)A two level dataset name specification in the form of libname.dataname. 
rdomainC (200) Related domain abbreviation to the current dataset
studyidC (200) Study identifier.  This can be specified as a name or a numeric number.
usubjidC (200) Unique Subject Identifier of the SDS domain record(s).
idvarC (200 optional) Identification variable that identifies the related records.  If there are multiple variables then they are to be separated by spaces.
outputC (200 optional) Output dataset name.  This can be either a two level or one level name.  If it is one level, it will be defaulted to be produced in the same location as specified in the data parameter.  If no value is specified, it will generate a data set name RELREC in the default location.
basecodeC (200 optional) Saved location of SAS Base code that is used to create the relational records dataset.

Details
The fixed structure of CDISC SDTM data models restricts what goes into the standard data domain datasets.  There are five distinct types of relationships which SDTM defines which allows for relationships to be made to other special-purpose datasets.  The five types include:

  1. A relationship between a group of records for a given subject within the same domain.
  2. A relationship between independent records (usually in separate domains) for a subject, such as a concomitant medication taken to treat an adverse event.
  3. A dependent relationship between two (or more) datasets where all the records of one (or more) dataset(s) have parent or counterpart record(s) in another dataset (or datasets) in a different general class, such as lesion measurements associated with the identification (and classification) of a lesion.
  4. A dependent relationship between data that cannot be represented by a standard variable and a parent record (or records) within a domain.
  5. A dependent relationship between a comment and a parent record (or records) in other domains, such as a comment recorded with an adverse event.

The output dataset that is going to be generated will have the following structure:

 Variable   Variable Label   Type   Description  
 STUDYID   Study Identifier   Char   Study Identifier of the SDS domain record(s).  
 RDOMAIN   Related Domain Abbreviation   Char*   Domain Abbreviation of the SDS domain record(s).  
 USUBJID   Unique Subject Identifier   Char    Unique Subject Identifier of the SDS domain record(s).  
 IDVAR   Identifier Variable   Char**   Value of the identifier variable in the general class dataset that identifies the related record(s). Examples include --SEQ and --GRPID.  
 IDVARVAL  Identifier Variable Value Char   Value of identifier variable described in IDVAR. If --SEQ is the  
 RELTYPE   Relationship Type   Char**   Identifies the hierarchical level of the records in the relationship. Values should be either ONE or MANY. However, values are only necessary when identifying a relationship between datasets (as described in Section 8.3).  
 RELID  Relationship  Identifier Char  Unique value within USUBJID that identifies the relationship.  All records for the same USUBJID that have the same RELID are considered ’related/associated.’ RELID can be any value the sponsor chooses, and is only meaningful within the RELREC dataset to identify the related/associated Domain records.

The IDVAR and IDVARVAL can be different to reflect the domain for grouped variables.  For example, the group variables for the CM domain main are: CMGRPID, CMTRT, CMDECOD, CMDOSE, CMDOSU, CMSTDTC and CMENDTC.

The basecode parameter will generate SAS/BASE code that will perform the same task of transposing input data into the RELREC dataset.  In addition, it will generate optional code that can be used to perform the reverse transposition from RELREC back into the original data structure.  This is useful if you have legacy code that you wish to use with the RELREC data.   This reverse transposition code can be regenerate the data that can then be used with the original legacy code.

Example

%relrec (data=mylib.ae,
                  rdomain=
ae,
                  studyid=
1232,
                  usubjid
= patnum,
                  idvar
= identification variable,
                  output =
output dataset );
 
    CDISC Builder - CDISC Data Tools Software,  Meta-Xceed Inc.© 2009
Bookmark and Share