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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

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