<?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 Re: Format PUT Output with Double Quotes, etc. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Format-PUT-Output-with-Double-Quotes-etc/m-p/19257#M2963</link>
    <description>Ignore the original post.  Found the trick.  Replace original PUT with:&lt;BR /&gt;
&lt;BR /&gt;
%scan(&amp;amp;vars,&amp;amp;varn)=compress(%scan(&amp;amp;vars,&amp;amp;varn),'"');&lt;BR /&gt;
put q+(-1) "%scan(&amp;amp;vars,&amp;amp;varn)" q+(-1) ' : ' q+(-1) %scan(&amp;amp;vars,&amp;amp;varn) +(-1)  q+(-1);&lt;BR /&gt;
&lt;BR /&gt;
where q = '"'</description>
    <pubDate>Tue, 19 Oct 2010 16:46:42 GMT</pubDate>
    <dc:creator>jort</dc:creator>
    <dc:date>2010-10-19T16:46:42Z</dc:date>
    <item>
      <title>Format PUT Output with Double Quotes, etc.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-PUT-Output-with-Double-Quotes-etc/m-p/19256#M2962</link>
      <description>Pardon the newbie question!  Thru trial and error I've gotten to this statement:&lt;BR /&gt;
&lt;BR /&gt;
%bquote(put) "%scan(&amp;amp;vars,&amp;amp;varn)" %scan(&amp;amp;vars,&amp;amp;varn);&lt;BR /&gt;
&lt;BR /&gt;
which gives me output like:&lt;BR /&gt;
&lt;BR /&gt;
PATID00136201&lt;BR /&gt;
&lt;BR /&gt;
almost what I want, but I need it formatted as:&lt;BR /&gt;
&lt;BR /&gt;
"PATID" : "00136201"&lt;BR /&gt;
&lt;BR /&gt;
Any help greatly appreciated!</description>
      <pubDate>Tue, 19 Oct 2010 15:21:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-PUT-Output-with-Double-Quotes-etc/m-p/19256#M2962</guid>
      <dc:creator>jort</dc:creator>
      <dc:date>2010-10-19T15:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Format PUT Output with Double Quotes, etc.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-PUT-Output-with-Double-Quotes-etc/m-p/19257#M2963</link>
      <description>Ignore the original post.  Found the trick.  Replace original PUT with:&lt;BR /&gt;
&lt;BR /&gt;
%scan(&amp;amp;vars,&amp;amp;varn)=compress(%scan(&amp;amp;vars,&amp;amp;varn),'"');&lt;BR /&gt;
put q+(-1) "%scan(&amp;amp;vars,&amp;amp;varn)" q+(-1) ' : ' q+(-1) %scan(&amp;amp;vars,&amp;amp;varn) +(-1)  q+(-1);&lt;BR /&gt;
&lt;BR /&gt;
where q = '"'</description>
      <pubDate>Tue, 19 Oct 2010 16:46:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-PUT-Output-with-Double-Quotes-etc/m-p/19257#M2963</guid>
      <dc:creator>jort</dc:creator>
      <dc:date>2010-10-19T16:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Format PUT Output with Double Quotes, etc.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-PUT-Output-with-Double-Quotes-etc/m-p/19258#M2964</link>
      <description>Hello Jort,&lt;BR /&gt;
&lt;BR /&gt;
It seems to me you can also use %put insted of datastep put. It produces the same result writing to the log. For example, like this:&lt;BR /&gt;
&lt;BR /&gt;
%let v1=PATID;&lt;BR /&gt;
%let v2=00136201;&lt;BR /&gt;
%put "&amp;amp;v1." : "&amp;amp;v2.";&lt;BR /&gt;
&lt;BR /&gt;
LOG:&lt;BR /&gt;
&lt;BR /&gt;
"PATID" : "00136201"&lt;BR /&gt;
&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Tue, 19 Oct 2010 18:46:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-PUT-Output-with-Double-Quotes-etc/m-p/19258#M2964</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2010-10-19T18:46:12Z</dc:date>
    </item>
  </channel>
</rss>

