- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug
"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings
SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug
"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings
SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Its not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Its working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Its working but it will add extra line in the output
like <![CDATA
]]
I don't want to add extra line in to the output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Please help me to solve this issue.
without using CDATA how we can display special characters like %$& etc. in any browser.
Thanks.