<?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: How to edit text before running it as code in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-edit-text-before-running-it-as-code/m-p/38677#M9941</link>
    <description>Use PROC SQL to generate the macro variable, as demonstrated.  Then code a DATA step with a RETAIN statement, specifying your desired SAS data variable name, and initialize the variable with the "generated" SAS macro variable, specified in double-quotes (not single-quotes -- otherwise the macro var is not going to be resolved).&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Wed, 13 Aug 2008 16:23:28 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2008-08-13T16:23:28Z</dc:date>
    <item>
      <title>How to edit text before running it as code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-edit-text-before-running-it-as-code/m-p/38674#M9938</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I have a list of over 2,000 variables. &lt;BR /&gt;
&lt;BR /&gt;
To run a query on them I need to use the following code:&lt;BR /&gt;
&lt;BR /&gt;
where variable in ('xxx1', 'xxx2', 'xxx3',....etc)&lt;BR /&gt;
&lt;BR /&gt;
The variables are currently in the format of: xxx1 xxx2 xxx3&lt;BR /&gt;
&lt;BR /&gt;
Is there a short cut to format the variables so i do not have to manually add&lt;B&gt; ' ' ,&lt;/B&gt; (the neccessary punctuation) to each of the variables?&lt;BR /&gt;
&lt;BR /&gt;
Any help most appreciated!</description>
      <pubDate>Wed, 13 Aug 2008 14:16:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-edit-text-before-running-it-as-code/m-p/38674#M9938</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-08-13T14:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit text before running it as code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-edit-text-before-running-it-as-code/m-p/38675#M9939</link>
      <description>From the SAS support website and its incredible resource of code snippets and examples -- which I found using a GOOGLE.COM advanced search with site:sas.com to limit the search:&lt;BR /&gt;
&lt;BR /&gt;
Sample 25976: Create a macro variable that contains a quoted list&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/25/976.html" target="_blank"&gt;http://support.sas.com/kb/25/976.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 13 Aug 2008 14:35:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-edit-text-before-running-it-as-code/m-p/38675#M9939</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-08-13T14:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit text before running it as code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-edit-text-before-running-it-as-code/m-p/38676#M9940</link>
      <description>Thanks so much for that Scott!&lt;BR /&gt;
&lt;BR /&gt;
That code was very helpful.&lt;BR /&gt;
&lt;BR /&gt;
Is it possible to keep the newly punctuated variables just as a data set?&lt;BR /&gt;
&lt;BR /&gt;
i.e. I do not need the following:&lt;BR /&gt;
&lt;BR /&gt;
data master;                                                                                                                            &lt;BR /&gt;
  input empl $ job $;                                                                                                                     &lt;BR /&gt;
datalines;                                                                                                                                  &lt;BR /&gt;
12345 clerk                                                                                                                             &lt;BR /&gt;
34567 rep                                                                                                                               &lt;BR /&gt;
00001 analyst                                                                                                                           &lt;BR /&gt;
;                                                                                                                                       &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
proc print data=master;                                                                                                                 &lt;BR /&gt;
  where empl in(&amp;amp;list);                                                                                                                  &lt;BR /&gt;
run;</description>
      <pubDate>Wed, 13 Aug 2008 15:36:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-edit-text-before-running-it-as-code/m-p/38676#M9940</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-08-13T15:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit text before running it as code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-edit-text-before-running-it-as-code/m-p/38677#M9941</link>
      <description>Use PROC SQL to generate the macro variable, as demonstrated.  Then code a DATA step with a RETAIN statement, specifying your desired SAS data variable name, and initialize the variable with the "generated" SAS macro variable, specified in double-quotes (not single-quotes -- otherwise the macro var is not going to be resolved).&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 13 Aug 2008 16:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-edit-text-before-running-it-as-code/m-p/38677#M9941</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-08-13T16:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit text before running it as code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-edit-text-before-running-it-as-code/m-p/38678#M9942</link>
      <description>I ended up concatenating the data in excel because it was the code I needed to format &amp;amp; not the output.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help.</description>
      <pubDate>Thu, 14 Aug 2008 12:44:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-edit-text-before-running-it-as-code/m-p/38678#M9942</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-08-14T12:44:48Z</dc:date>
    </item>
  </channel>
</rss>

