<?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: create a macro variable which will store list of integer in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-a-macro-variable-which-will-store-list-of-integer/m-p/277854#M55853</link>
    <description>&lt;P&gt;Why? &amp;nbsp;Why not put that list of "data" items in a "data"set that is what "datasets" are for storing data. &amp;nbsp;Macro language is not a replacement for Base SAS - it is a text generation tool.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jun 2016 11:04:59 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-06-16T11:04:59Z</dc:date>
    <item>
      <title>create a macro variable which will store list of integer</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-macro-variable-which-will-store-list-of-integer/m-p/277848#M55848</link>
      <description>&lt;P&gt;i want to creat a macro variable to store (2,4,15,16) in it, How to do this?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 10:42:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-macro-variable-which-will-store-list-of-integer/m-p/277848#M55848</guid>
      <dc:creator>subrat1</dc:creator>
      <dc:date>2016-06-16T10:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: create a macro variable which will store list of integer</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-macro-variable-which-will-store-list-of-integer/m-p/277849#M55849</link>
      <description>&lt;P&gt;Two questions:&lt;/P&gt;
&lt;P&gt;- where is the list coming from (fixed constant, dataset, ....)?&lt;/P&gt;
&lt;P&gt;- how should it be used (determines the format of the list)?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 10:48:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-macro-variable-which-will-store-list-of-integer/m-p/277849#M55849</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-06-16T10:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: create a macro variable which will store list of integer</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-macro-variable-which-will-store-list-of-integer/m-p/277854#M55853</link>
      <description>&lt;P&gt;Why? &amp;nbsp;Why not put that list of "data" items in a "data"set that is what "datasets" are for storing data. &amp;nbsp;Macro language is not a replacement for Base SAS - it is a text generation tool.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 11:04:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-macro-variable-which-will-store-list-of-integer/m-p/277854#M55853</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-06-16T11:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: create a macro variable which will store list of integer</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-macro-variable-which-will-store-list-of-integer/m-p/277855#M55854</link>
      <description>&lt;P&gt;create a macro variable to store fixed constant integer so that i can pass that in my program.&lt;/P&gt;&lt;P&gt;like for example&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;%Let&amp;nbsp; a= (4, 5, 6)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; but this is not working&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 11:17:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-macro-variable-which-will-store-list-of-integer/m-p/277855#M55854</guid>
      <dc:creator>subrat1</dc:creator>
      <dc:date>2016-06-16T11:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: create a macro variable which will store list of integer</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-macro-variable-which-will-store-list-of-integer/m-p/277856#M55855</link>
      <description>&lt;P&gt;"this is not working" is not helpful.&lt;/P&gt;
&lt;P&gt;You need to be much more specific, ie by posting the relevant piece of code and the log, and the data as it came out and as you wanted it to be.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 11:21:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-macro-variable-which-will-store-list-of-integer/m-p/277856#M55855</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-06-16T11:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: create a macro variable which will store list of integer</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-macro-variable-which-will-store-list-of-integer/m-p/277879#M55863</link>
      <description>&lt;P&gt;Why do you say it's not working?&amp;nbsp; It's easy to check.&amp;nbsp; Assuming you added a semicolon:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let a = (4, 5, 6);&lt;/P&gt;
&lt;P&gt;%put **&amp;amp;a**;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What's actually happening is that the statement works, but you don't know what to do with the result.&amp;nbsp; It is highly likely that you should heed the suggestion about keeping data in data sets instead of macro variables.&amp;nbsp; If you show what you are trying to accomplish, you are pretty sure to get some helpful suggestions.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 12:50:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-macro-variable-which-will-store-list-of-integer/m-p/277879#M55863</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-06-16T12:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: create a macro variable which will store list of integer</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-macro-variable-which-will-store-list-of-integer/m-p/277907#M55868</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Consider this program (with different numbers so I could use it with SASHELP.CLASS):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title; footnote;

%let a=(14,15,16);
%put -----&amp;gt; macro variable a is: &amp;amp;a;

options mprint symbolgen;
proc print data=sashelp.class;
  title "Looking for Ages &amp;amp;a";
  where age in &amp;amp;a;
run;
  
   
data new;
  x = sum&amp;amp;a;
run;
  
proc print data=new;
title "adding up values &amp;amp;a in parentheses with sum function";
run;
title;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Illustrates 2 completely different uses of &amp;amp;a in 2 different steps. So what the OP wants and what the data looks like and the reason for having the&amp;nbsp; numbers in a macro variable need to be explained so that everybody understands WHAT the OP is trying to accomplish.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above program generates this in the log and output:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3650i65B50CB9CC0CDD51/image-size/original?v=v2&amp;amp;px=-1" alt="forum_macro.png" title="forum_macro.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But without a context for the question, it's hard to know which generated code is the desired aim.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 14:37:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-macro-variable-which-will-store-list-of-integer/m-p/277907#M55868</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-06-16T14:37:18Z</dc:date>
    </item>
  </channel>
</rss>

