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

I am attempting to parse an XML document and keep getting the error in the subject line when I try to run my PROC SQL against the tables. The tables show up nicely in the library. I just can't query them without getting the transcode error.

filename clinvw "xmlfile.xml" encoding="utf-8";
libname clinvw xmlv2 compat=yes automap=reuse xmlmap="xmlmapfile.map"; 
    	PROC SQL;   
    		select    
    			s.SubjectData_SubjectKey as subject,   
    			r.SiteRef_LocationOID as sitenumber,   
    			e.StudyEventData_StudyEventOID as visitoid,   
    			e.StudyEventData_StudyEventRepeatK as visitrepeatkey,   
    			f.FormData_FormOID as formoid,   
    			f.FormData_FormRepeatKey as formrepeatkey,   
    			g.ItemGroupData_ItemGroupOID as itemgroup,   
     			TRANWRD(i.ItemData_ItemOID,cat(f.FormData_FormOID,'.'),'') as item,    
    			i.ItemData_Value as itemvalue,   
    			today() as importtime    
    		FROM clinvw.SubjectData s   
    		inner join clinvw.SiteRef r on s.SubjectData_ORDINAL = r.SubjectData_ORDINAL   
    		left join clinvw.StudyEventData e on s.SubjectData_ORDINAL = e.SubjectData_ORDINAL   
    		left join clinvw.FormData f on e.StudyEventData_ORDINAL = f.StudyEventData_ORDINAL   
    		left join clinvw.ItemGroupData g on f.FormData_ORDINAL = g.FormData_ORDINAL   
    		left join clinvw.ItemData i on g.ItemGroupData_ORDINAL = i.ItemGroupData_ORDINAL;    
    	QUIT;    

Any ideas on how I can get this working?

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
evaleah
Obsidian | Level 7

Turns out I just needed to set SAS Studio to UTF-8 encoding via the hamburger icon in the top right corner. Everyone else seemed to know this hence my inability to find posts about it.

For any future searchers... From that icon -> Change SAS Workspace Header -> UTF-8 and then it all works as expected.

View solution in original post

1 REPLY 1
evaleah
Obsidian | Level 7

Turns out I just needed to set SAS Studio to UTF-8 encoding via the hamburger icon in the top right corner. Everyone else seemed to know this hence my inability to find posts about it.

For any future searchers... From that icon -> Change SAS Workspace Header -> UTF-8 and then it all works as expected.

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
  • 1 reply
  • 2608 views
  • 0 likes
  • 1 in conversation