BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Satish_Parida
Lapis Lazuli | Level 10

Hi All,

 

I have added the following columns in the mapper file.

 

<COLUMN name="DateTimeStamp">
	<PATH syntax="XPathENR">/{1}ODM/{1}ClinicalData/{1}SubjectData/{1}AuditRecord/{1}DateTimeStamp</PATH>
	<TYPE>numeric</TYPE>
	<DATATYPE>datetime</DATATYPE>
	<FORMAT width="19">IS8601DT</FORMAT>
	<INFORMAT width="19">IS8601DT</INFORMAT>
</COLUMN>


<COLUMN name="DateTimeStamp">
	<PATH syntax="XPathENR">/{1}ODM/{1}ClinicalData/{1}SubjectData/{1}StudyEventData/{1}FormData/{1}ItemGroupData/{1}ItemData/{1}AuditRecord/{1}DateTimeStamp</PATH>
	<TYPE>numeric</TYPE>
	<DATATYPE>datetime</DATATYPE>
	<FORMAT width="19">IS8601DT</FORMAT>
	<INFORMAT width="19">IS8601DT</INFORMAT>
</COLUMN>

Here instead of getting the second column in DateTimeStamp it creates a new column.

Is there any way we can map 2 XPATHS to one Column name?

 

Thank you in Advance.

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

If you just calculate

DateTimeStamp=coalescec( of DateTimeStamp1 - DateTimeStamp5 );
drop DateTimeStamp1 - DateTimeStamp5 ;

when reading the XML file, you'll have just one step and the lowest possible IOs.

View solution in original post

7 REPLIES 7
ChrisNZ
Tourmaline | Level 20

Is there any way we can map 2 XPATHS to one Column name?

I am no expert, but not as far as I know.

Satish_Parida
Lapis Lazuli | Level 10

The reason I am looking for this solution is I have the {1}AuditRecord element in multiple places in the clinical data hierarchy.

 

So instead of creating multiple tables, I want to some how extract the data in the same columns.

 

It will reduce 25 columns to 5 columns.

 

Thank you in Advance.

ChrisNZ
Tourmaline | Level 20

Can't you just read DateTimeStamp1, DateTimeStamp2 ... from the different locations and derive DateTimeStamp=coalescec( DateTimeStamp1, DateTimeStamp2, etc )
?

Satish_Parida
Lapis Lazuli | Level 10
Yes, That is the current solution we are using.

In the current solution every XML element is a SAS table with 2 ordinal columns, we then join them.

We are trying to optimize the current process, by reducing number of tables we are coping from XML to SAS hence reducing number of ordinal columns.

Here the road block is the AuditRecord element which can appear at different hierarchy levels per record, but it basically represents the timestamp of the record action.

Easiest way is to download all as different tables and then collase. But to reduce IO I am trying to read all of them in a single column.

How ever it looks impossible.

Thank you.
ChrisNZ
Tourmaline | Level 20
Do you need several tables?Can't you have several columns and do all the processing in one go?
Satish_Parida
Lapis Lazuli | Level 10

That is also doable, we will have 5 datetime columns, we wanted 1 column so:


1. Not to select 4 additional columns (reduce writing time)
2. Do a collase to create the final datetime column (reduce processing time).

3. We have 5 of these type of columns (transactionid, user, location, source, actionname and datetimestamp) so it becomes 25 columns in place of just 5.


All this to reduce IO usage.

ChrisNZ
Tourmaline | Level 20

If you just calculate

DateTimeStamp=coalescec( of DateTimeStamp1 - DateTimeStamp5 );
drop DateTimeStamp1 - DateTimeStamp5 ;

when reading the XML file, you'll have just one step and the lowest possible IOs.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1128 views
  • 0 likes
  • 2 in conversation