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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.