Hi everyone,
I am reading several XML files as flat-files ... Imagine now i have a dataset XML3, with two columns:
xmlname (e.g.: XML_number1.xml), text1(several hundret alphanumeric characters, this is the xml-content).
DATA xml4_codesys(KEEP = xmlname codesys_flg);
SET xml3;
FORMAT codesys_flg best8.;
codesys_string = INDEX(text1, %str(<name code="2" codeSystem="2.16.840.1.113883.3.989.5.1.1.5.1" codeSystemVersion="1.0" displayName="Master"/>));
IF codesys_string NE 0 THEN DO;
codesys_flg = 1;
END;
ELSE DO;
codesys_flg = 0;
RUN;
RUN;
First attempt with the %str() masking did not help unfortunately 😞
The string i want to search for is exactly this one:
<name code="2" codeSystem="2.16.840.1.113883.3.989.5.1.1.5.1" codeSystemVersion="1.0" displayName="Master"/>
Does someone has an easy solution without complex PERL-Reg-Expressions? 🙂
Thank you in advance for any idea,
Felix
Try to change the %str with single quotes :
codesys_string = INDEX(text1, '<name code="2" codeSystem="2.16.840.1.113883.3.989.5.1.1.5.1" codeSystemVersion="1.0" displayName="Master"/>');
Try to change the %str with single quotes :
codesys_string = INDEX(text1, '<name code="2" codeSystem="2.16.840.1.113883.3.989.5.1.1.5.1" codeSystemVersion="1.0" displayName="Master"/>');
Sometimes, Solutions can be so easy 😄 Thank you 'Shmuel' !
... and sometimes you should Close the day after 10+ hours xD
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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: