comment

Generate comment domain dataset as part of the SDTM of CDISC

%comment (data = source dataset,
                         comvar
= comment variable(s),
                         datevar
= date variable,
                         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. 
comvarC (200) Comment variable(s) name found in the specified dataset.
datevar C (200 optional) Date variable associated with the comment.
rdomainC (200) Related domain abbreviation to the current dataset
studyidC (100) Study identifier.  This can be specified as a name or a numeric number.
usubjidC (100) Unique Subject Identifier of the SDS domain record(s).
idvarC (200 optional) Identification variable that identifies the related records
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 CO in the default location.
basecodeC (200 optional) Saved location of SAS Base code that is used to create the relational records dataset.

Details
The COMMENTS special-purpose domain dataset used in SDTM that provides a solution for submitting free-text comments.  Comments are collected on separated CRFs but are documented together in on dataset named CO with the following structure:
 
Variable Name  Variable Label Type 
 STUDYID  Study Identifier Char 
 DOMAIN  Domain Abbreviation Char 
 RDOMAIN  Related Domain Abbreviation Char 
 USUBJID  Unique Subject Identifier Char 
 COSEQ   Sequence Number  Num 
 IDVAR  Identifier Variable NameChar 
 IDVARVAL   Identifier Variable  Char 
 COREF  Comment Reference  Char 
 CODTC  Date/Time of Comment  Char 
 COVAL   CommentChar 
 COEVAL  Evaluator Char 

This macro will capture specified comment fields and populated into the comments dataset.  If the CO dataset already exists, it will make a backup copy in the SASUSER.CO and then this will continue to add new comments to the specified comment dataset.  If the comment variable came from the source that has already been captured, it will update the new comment dataset.  However, it the information is from a new source, the new comment will be inserted.

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

Example

%comment (data=mylib.ae,
                         comvar=comm,
                         rdomain=ae,
                         studyid=1232,
                         usubjid = patnum,
                         idvar = aeseq,
                         output = outlib.co );
 
    CDISC Builder - CDISC Data Tools Software,  Meta-Xceed Inc.© 2009
Bookmark and Share