BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Adambo
Obsidian | Level 7

I am working on creating datasets in SDTM format from an XML ODM v1.2 file and I am unable to extract partial dates; columns containing partial dates come out completely empty.

 

I have tried editing the format of the partial date variables in different ways without success. This makes me think the partialDate variables are not pulled from the XML file.

 

I have tried a PowerShell script to convert the partial dates to text format in the XML file without success. (script available here: https://en.wikibooks.org/wiki/OpenClinica_User_Manual/SAS). My XML file becomes unreadable by my SAS program after running the script.

 

Any suggestion would be greatly appreciated.

 

Here is the information relevant to one partial date variable (HYSTERDT) contained in the XML file which I am trying to extract:

 

<ItemGroupDef OID="IG_MEDIC_UNGROUPED" Name="IG_MEDIC_UNGROUPED" Repeating="No" SASDatasetName="UNGRO00c">

               <ItemRef ItemOID="I_MEDIC_HYSTER" OrderNumber="6" Mandatory="No"/>

                <ItemRef ItemOID="I_MEDIC_HYSTERDT" OrderNumber="7" Mandatory="No"/>

</ItemGroupDef>

<ItemDef OID="I_MEDIC_HYSTERDT" Name="HysterDt" DataType="partialDate" SASFieldName="HysterDt" Comment="Date of hysterectomy :">

               <Question>

                   <TranslatedText>

                   Date of Intervention - (dd-mmm-yyyy)

                   </TranslatedText>

               </Question>

           </ItemDef>

<ItemGroupData ItemGroupOID="IG_MEDIC_UNGROUPED" TransactionType="Insert">

                       <ItemData ItemOID="I_MEDIC_HYSTER" Value="1"/>

                       <ItemData ItemOID="I_MEDIC_HYSTERDT" Value="2008"/>

</ItemGroupData>

 

Here is my code for extracting datasets which works fine with any variable other than partial dates:

 

*SAS Options;

options compress=yes nofmterr mprint symbolgen;

 

*Reading the ODM XML file;

 

LIBNAME ODM xml xmltype=CDISCODM

FORMATACTIVE=YES

FORMATNOREPLACE=NO

FORMATLIBRARY=Indata;

run;

 

data SAS.UNGRO00c;

set ODM.UNGRO00c;

format HYSTERDT $10.; *example of formatting I have tried;

run;

 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
Adambo
Obsidian | Level 7

Changing DataType="partialDate" to DataType="text" in the XML file using find/replace is the only solution I found.  

 

View solution in original post

1 REPLY 1
Adambo
Obsidian | Level 7

Changing DataType="partialDate" to DataType="text" in the XML file using find/replace is the only solution I found.  

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

Discussion stats
  • 1 reply
  • 2205 views
  • 0 likes
  • 1 in conversation