<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic unexpected space with required quotation marks in xml file output in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/unexpected-space-with-required-quotation-marks-in-xml-file/m-p/273871#M15974</link>
    <description>&lt;P&gt;Generating a XML file in the datastep that acts as input for another program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Filename outxml "C:\phase4.xml";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;file outxml; /*XML Output File */&lt;BR /&gt;set testxml&amp;nbsp;NOBS=Lst; /* SAS File with input data */&lt;BR /&gt;by fileName;&lt;/P&gt;&lt;P&gt;&amp;nbsp;if _n_=1 then do;&lt;/P&gt;&lt;P&gt;put '&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;';&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;fileName= compress(fileName, );&lt;/P&gt;&lt;P&gt;put '&amp;lt;DataFile fileName="' fileName'" ';&amp;nbsp;&lt;/P&gt;&lt;P&gt;put 'dataCon="' &amp;nbsp;dataCon'" dataStdVer="' dataStdV'" dVersion="' &amp;nbsp; dVer'" /&amp;gt;';&lt;/P&gt;&lt;P&gt;if _n_=lst then do;&lt;BR /&gt;put '&amp;lt;/DataFile&amp;gt;';&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current output:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;DataFile fileName="test1.sas7bdat "&lt;/P&gt;&lt;P&gt;dataConformance="CDR1 " dataStandardVer="1 " domainVersion="1 " /&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;/DataFile&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;All the variable are being resolved with a trailing space which is creating problem. While i checked the datafile, there are no trailing blanks, even the compress function is not helping. There seesm to be a problem with the quotation marks placement, if anyone can help me resolve this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 30 May 2016 08:19:05 GMT</pubDate>
    <dc:creator>sAura</dc:creator>
    <dc:date>2016-05-30T08:19:05Z</dc:date>
    <item>
      <title>unexpected space with required quotation marks in xml file output</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/unexpected-space-with-required-quotation-marks-in-xml-file/m-p/273871#M15974</link>
      <description>&lt;P&gt;Generating a XML file in the datastep that acts as input for another program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Filename outxml "C:\phase4.xml";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;file outxml; /*XML Output File */&lt;BR /&gt;set testxml&amp;nbsp;NOBS=Lst; /* SAS File with input data */&lt;BR /&gt;by fileName;&lt;/P&gt;&lt;P&gt;&amp;nbsp;if _n_=1 then do;&lt;/P&gt;&lt;P&gt;put '&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;';&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;fileName= compress(fileName, );&lt;/P&gt;&lt;P&gt;put '&amp;lt;DataFile fileName="' fileName'" ';&amp;nbsp;&lt;/P&gt;&lt;P&gt;put 'dataCon="' &amp;nbsp;dataCon'" dataStdVer="' dataStdV'" dVersion="' &amp;nbsp; dVer'" /&amp;gt;';&lt;/P&gt;&lt;P&gt;if _n_=lst then do;&lt;BR /&gt;put '&amp;lt;/DataFile&amp;gt;';&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current output:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;DataFile fileName="test1.sas7bdat "&lt;/P&gt;&lt;P&gt;dataConformance="CDR1 " dataStandardVer="1 " domainVersion="1 " /&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;/DataFile&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;All the variable are being resolved with a trailing space which is creating problem. While i checked the datafile, there are no trailing blanks, even the compress function is not helping. There seesm to be a problem with the quotation marks placement, if anyone can help me resolve this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2016 08:19:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/unexpected-space-with-required-quotation-marks-in-xml-file/m-p/273871#M15974</guid>
      <dc:creator>sAura</dc:creator>
      <dc:date>2016-05-30T08:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: unexpected space with required quotation marks in xml file output</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/unexpected-space-with-required-quotation-marks-in-xml-file/m-p/273872#M15975</link>
      <description>&lt;P&gt;That is the default behaviour of the put statement. Either build your string ahead of time using a CATT function or add +(-1) between your terms.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Put var1 +(-1) var2;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 May 2016 08:23:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/unexpected-space-with-required-quotation-marks-in-xml-file/m-p/273872#M15975</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-30T08:23:22Z</dc:date>
    </item>
  </channel>
</rss>

