<?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 Put with eq character in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203400#M13512</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Today I was producing a output with a data step, with the classical put statement to print results on TXT file. The problem appear when I had tried to print a variable with an eq character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that put could do things as &lt;/P&gt;&lt;P&gt;put name=;&lt;/P&gt;&lt;P&gt;but if it is enclosed with quotes, it should print the content of the quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea of how to print this?&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;set try;&lt;/P&gt;&lt;P&gt;put&amp;nbsp; "Try = this";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Aug 2015 08:25:43 GMT</pubDate>
    <dc:creator>arodriguez</dc:creator>
    <dc:date>2015-08-20T08:25:43Z</dc:date>
    <item>
      <title>Put with eq character</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203400#M13512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Today I was producing a output with a data step, with the classical put statement to print results on TXT file. The problem appear when I had tried to print a variable with an eq character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that put could do things as &lt;/P&gt;&lt;P&gt;put name=;&lt;/P&gt;&lt;P&gt;but if it is enclosed with quotes, it should print the content of the quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea of how to print this?&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;set try;&lt;/P&gt;&lt;P&gt;put&amp;nbsp; "Try = this";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 08:25:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203400#M13512</guid>
      <dc:creator>arodriguez</dc:creator>
      <dc:date>2015-08-20T08:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Put with eq character</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203401#M13513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data Have;&lt;/P&gt;&lt;P&gt;var = "This";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;put "Try = " var;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Want;&lt;/P&gt;&lt;P&gt;var= "This";&lt;/P&gt;&lt;P&gt;put "Try =" var;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Displays the value in log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;file "path\filename.txt";&lt;/P&gt;&lt;P&gt;var= "This";&lt;/P&gt;&lt;P&gt;put "Try =" var;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Displays the value in the file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 08:47:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203401#M13513</guid>
      <dc:creator>MadhuKorni</dc:creator>
      <dc:date>2015-08-20T08:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Put with eq character</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203402#M13514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Single quotes works:&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put 'Try = this';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 08:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203402#M13514</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-08-20T08:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Put with eq character</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203403#M13515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;and if the "=" is in a variable macro, how can I do it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 08:56:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203403#M13515</guid>
      <dc:creator>arodriguez</dc:creator>
      <dc:date>2015-08-20T08:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Put with eq character</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203404#M13516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are actually trying to produce?&amp;nbsp; The data step you posted will output the 10 character string &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;"Try = this" once for each observation in the input dataset TRY.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 09:00:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203404#M13516</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-08-20T09:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Put with eq character</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203405#M13517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to reference the value of a macro variable then you need to use &amp;amp; before the macro variable name. If you want to use the reference inside of a quoted string then the outer quotes need to be double quote character and not single quote character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;%let mvar=TRY = This;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;data _null_;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;&amp;nbsp; put "&amp;amp;mvar" ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;If the value of the macro variable could contain embedded double quote characters then you will need to protect them or the generated code will look like two strings instead of one.&amp;nbsp; So in this example the first PUT statement is wrong since it ends up looking like two quoted strings separated by a reference to a variable named THIS.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;%let mvar=TRY = " This " is quoted;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;data _null_;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;&amp;nbsp; put "&amp;amp;mvar" ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;&amp;nbsp; put %sysfunc(quote(&amp;amp;mvar));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: Variable This is uninitialized.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;TRY = .&amp;nbsp; is quoted&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;TRY = " This " is quoted&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 09:03:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203405#M13517</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-08-20T09:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Put with eq character</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203406#M13518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is your wanted result in the output file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 09:04:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203406#M13518</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-08-20T09:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Put with eq character</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203407#M13519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I have a macro that produce a report.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Until now i have any problem with this, but today i had use a var with a column name with an equal.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;The data step do for each break page print the "headers" and with an equal it doesn't work.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;The call is something like&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;if first.page then do;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; put @%eval(col_width) "%trim(&amp;amp;header)";&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;end;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;where trim is a Rolland macro, that could be find here &lt;A class="active_link" href="http://www.datasavantconsulting.com/roland/trim.sas" title="http://www.datasavantconsulting.com/roland/trim.sas"&gt;http://www.datasavantconsulting.com/roland/trim.sas&lt;/A&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I have tried the same code without trim and seems to work, so It's no problem of the put statement. I will review for the problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 09:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203407#M13519</guid>
      <dc:creator>arodriguez</dc:creator>
      <dc:date>2015-08-20T09:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Put with eq character</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203408#M13520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you call a macro with code like %XXX(try=THIS) then it looks to SAS like you want to set the parameter TRY to the value THIS.&lt;/P&gt;&lt;P&gt;So you need to quote the value you are passing to the macro call.&amp;nbsp; Here is one way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;%trim(%superq(header))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRIM is the name of a macro supplied by SAS.&amp;nbsp; Did Roland create his own version of that macro?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 10:13:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203408#M13520</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-08-20T10:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Put with eq character</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203409#M13521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may also consider what your code is doing in the first place.&amp;nbsp; I don't see a reason for macro calls and references etc. on a report out procedure?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 10:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203409#M13521</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-08-20T10:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Put with eq character</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203410#M13522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another workaround way in Data Step is using SYMGET().&lt;/P&gt;&lt;PRE&gt;%let mvar=TRY = " This " is quoted;

data _null_;
&amp;nbsp; put "&amp;amp;mvar" ;
&amp;nbsp; put %sysfunc(quote(&amp;amp;mvar));
&amp;nbsp; x=symget('mvar');
&amp;nbsp; put x
run;

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 05:46:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Put-with-eq-character/m-p/203410#M13522</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-08-21T05:46:26Z</dc:date>
    </item>
  </channel>
</rss>

