<?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: macro to quote  variables. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239319#M44011</link>
    <description>nope am understanding macros as am working on it....</description>
    <pubDate>Tue, 15 Dec 2015 10:59:09 GMT</pubDate>
    <dc:creator>RTelang</dc:creator>
    <dc:date>2015-12-15T10:59:09Z</dc:date>
    <item>
      <title>macro to quote  variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239285#M43999</link>
      <description>&lt;P&gt;A macro that adds quotes around each item in a list. This list can consist of individual items or a previously defined macro variable containing values. thanks in advance&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 04:32:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239285#M43999</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2015-12-15T04:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: macro to quote  variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239296#M44002</link>
      <description>&lt;P&gt;May be you will like to try something as below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used the quote function to quote the individual values and used strip to remove the trailing spaces. &lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;select distinct strip(quote(name)) into :names separated by ' ' from sashelp.class;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;%put &amp;amp;names;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 07:50:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239296#M44002</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-12-15T07:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: macro to quote  variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239312#M44006</link>
      <description>&lt;P&gt;For what purpose, and what type of data? &amp;nbsp;If you want to do sql in's then use a table:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table WANT as
  select  *
  from    HAVE
  where AVARIABLE in (select CODE from CODELIST);
quit;&lt;/PRE&gt;
&lt;P&gt;If you need a list of data for any purpose a dataset is a far better storage unit for it. &amp;nbsp;Even if somewhere down the line you really have to do it witha &amp;nbsp;macro list (and I have never come across a scenario where there isn't a better method) then you would just&amp;nbsp;use sql select into separated by. &amp;nbsp;However bear in mind the limitations with such a process, and error checking - maybe the data contains quotes/specials etc. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 10:31:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239312#M44006</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-12-15T10:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: macro to quote  variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239313#M44007</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt; &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/29077"&gt;@jagdish&lt;/a&gt; can u provide a specific generic   macro code that adds quotes around each item in a list. This list can consist of individual items or a previously defined macro variable containing values??</description>
      <pubDate>Tue, 15 Dec 2015 10:41:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239313#M44007</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2015-12-15T10:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: macro to quote  variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239315#M44009</link>
      <description>&lt;P&gt;I am beginning to suspect with your questions that you want the community to write an entire macro library based off some idea you have to do everything in macro code, is this the case?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 10:49:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239315#M44009</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-12-15T10:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: macro to quote  variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239319#M44011</link>
      <description>nope am understanding macros as am working on it....</description>
      <pubDate>Tue, 15 Dec 2015 10:59:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239319#M44011</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2015-12-15T10:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: macro to quote  variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239320#M44012</link>
      <description>&lt;P&gt;Could I suggest then that you first start by learning Base SAS:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/training/tutorial/" target="_blank"&gt;http://support.sas.com/training/tutorial/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Is a good start, then maybe some other courses. &amp;nbsp;Understanding of "where" macro language should be used is as important as "how" it should be used. &amp;nbsp;As mentioned, in all of your posts so far, it has not been so much of a question / answer request but more of a please provide code to do XYZ. &amp;nbsp;Understanding of how to do things in Base SAS - which is the underlying programming language will solve most, if not all of the tasks you are trying to do. &amp;nbsp;Once you have that down, you can then start to tlook at what conponents could be more useful as macros, and what systems require. &amp;nbsp;Follow Software Development Lifecycle process also, develop a document which details the full process, then break that process out into separate processes, create functional design specifications for each process which would detail data flow, checks which need to be performed etc. &amp;nbsp;Once you have docuemented the entire thing, then it should be a simple matter to write some code to action those documented processes. &amp;nbsp;Forcing code into macro, especially if you do not understand it, and have no clear concept to follow is a recipe for disaster. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rule no 1 for coding:&lt;/P&gt;
&lt;P&gt;Plan, document, implement, test. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With regards to providing code, consider hiring a contractor to create code based on your FDS if you need to.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 11:34:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239320#M44012</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-12-15T11:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: macro to quote  variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239321#M44013</link>
      <description>no no u get me wrong &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt; i know what am i doing i know macros am jst asking suggestions for my doubts &amp;amp; i send this doubt here for some insight....@rw9 so ....</description>
      <pubDate>Tue, 15 Dec 2015 11:41:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239321#M44013</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2015-12-15T11:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: macro to quote  variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239334#M44015</link>
      <description>&lt;P&gt;UNTESTED CODE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro put_quotes_around(string=);
	%local ii nwords newstring;
	%let nwords=%sysfunc(countw(&amp;amp;string));
	%let newstring=;
	%do ii=1 %to &amp;amp;nwords;
		%let thisword=%scan(&amp;amp;string,&amp;amp;ii,%str( ));
		%let newstring=&amp;amp;newstring %str(%')&amp;amp;thisword%str(%');
	%end;
	%unquote(&amp;amp;newstring)
%mend;
%let newmacrovar=%put_quotes_around(string=ABC DEF GHI);
%put NEWMACROVAR &amp;amp;newmacrovar;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Dec 2015 13:32:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239334#M44015</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-12-15T13:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: macro to quote  variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239578#M44095</link>
      <description>&lt;P&gt;How are your values delimited? Are there spaces within the values you want quoted?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A one minute search on Google for Sas macro variable lists would give you many examples starting with &lt;A href="http://www2.sas.com/proceedings/forum2007/113-2007.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2007/113-2007.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 17:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-to-quote-variables/m-p/239578#M44095</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-12-16T17:18:56Z</dc:date>
    </item>
  </channel>
</rss>

