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!
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.
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.
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!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: