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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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