i am trying below code but special characters are not display in browser.
data transformed_data;
input DC_01 $6. DC_02 $13. DC_03 $9.;
cards;
116312 tosst p%o&ic
118323 tosst Police Mobile
113244 tosst Police Mobile
115333 tosst Police Mobile
118333 tosst Police Mobile
;
run;
data _null_;
set transformed_data;
file "$FSAGQS/QIS_DIBIS/transfers2/TEST_Shan1.xml";
if _n_=1 then do;
put '<?xml version="1.0" encoding="iso-8859-1"?>';
put '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:type="http://www.quinity.com/qis/soap/qisxmlpolicyrequestservice/type">';
Put '<Data>';
put '<answer>';
put '<value>' DC_01 '</value>';
put '</answer>';
put '<answer>';
put '<value>' DC_02 '</value>';
put '</answer>';
Put '</Data>';
end;
run;
Thank You.
Hi, maybe try encode the characters:
data transformed_data;
input DC_01 $6. DC_02 $13. DC_03 $9.;
cards;
116312 tosst p%o&ic
118323 tosst Police Mobile
113244 tosst Police Mobile
115333 tosst Police Mobile
118333 tosst Police Mobile
;
run;
data _null_;
set transformed_data;
file "C:\Users\bart\Desktop/TEST_Shan1.xml";
if _n_=1 then do;
put '<?xml version="1.0" encoding="iso-8859-1"?>';
put '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:type="http://www.quinity.com/qis/soap/qisxmlpolicyrequestservice/type">';
end;
Put '<Data>';
put '<answer>';
put '<value>' DC_01 '</value>';
put '</answer>';
put '<answer>';
DC_02x = HTMLENCODE(DC_02);
put '<value>' DC_02x '</value>';
put '</answer>';
Put '</Data>';
run;
Bart
Hi, maybe try encode the characters:
data transformed_data;
input DC_01 $6. DC_02 $13. DC_03 $9.;
cards;
116312 tosst p%o&ic
118323 tosst Police Mobile
113244 tosst Police Mobile
115333 tosst Police Mobile
118333 tosst Police Mobile
;
run;
data _null_;
set transformed_data;
file "C:\Users\bart\Desktop/TEST_Shan1.xml";
if _n_=1 then do;
put '<?xml version="1.0" encoding="iso-8859-1"?>';
put '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:type="http://www.quinity.com/qis/soap/qisxmlpolicyrequestservice/type">';
end;
Put '<Data>';
put '<answer>';
put '<value>' DC_01 '</value>';
put '</answer>';
put '<answer>';
DC_02x = HTMLENCODE(DC_02);
put '<value>' DC_02x '</value>';
put '</answer>';
Put '</Data>';
run;
Bart
One possibility is to use the CDATA section marker:
data _null_;
set transformed_data;
file "$FSAGQS/QIS_DIBIS/transfers2/TEST_Shan1.xml";
if _n_=1 then do;
put '<?xml version="1.0" encoding="iso-8859-1"?>';
put '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:type="http://www.quinity.com/qis/soap/qisxmlpolicyrequestservice/type">';
Put '<Data>';
put '<answer>';
put '<value><![CDATA[' DC_01 ']]></value>';
put '</answer>';
put '<answer>';
put '<value><![CDATA[' DC_02' ]]></value>';
put '</answer>';
Put '</Data>';
end;
run;
This way, unless your columns contain the string "]]>", they will be shown faithfully.
Please help me to solve this issue.
without using CDATA how we can display special characters like %$& etc. in any browser.
Thanks.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.