<?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 assing into a macro varibale in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/549196#M152367</link>
    <description>&lt;P&gt;Please find the attached document for your reference....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per the attached document, I want to create Two macro variables - 1 for City and other for 01&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Apr 2019 07:45:05 GMT</pubDate>
    <dc:creator>vThanu</dc:creator>
    <dc:date>2019-04-08T07:45:05Z</dc:date>
    <item>
      <title>How to assing into a macro varibale</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/548464#M152089</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 10 data sets and it is save in my library as&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt_city_01; (data sets name)&lt;/P&gt;&lt;P&gt;dt_city_02;&lt;/P&gt;&lt;P&gt;dt_city_03; .............&amp;nbsp; so on to&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt_city_10.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to assign &lt;STRONG&gt;city&lt;/STRONG&gt; into 1 macro variable and &lt;STRONG&gt;01,02,03(so on to 10)&amp;nbsp;&lt;/STRONG&gt;into other macro variable.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can any 1 help me out..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 12:12:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/548464#M152089</guid>
      <dc:creator>vThanu</dc:creator>
      <dc:date>2019-04-04T12:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to assing into a macro varibale</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/548469#M152090</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/247664"&gt;@vThanu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi All&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 10 data sets and it is save in my library as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dt_city_01; (data sets name)&lt;/P&gt;
&lt;P&gt;dt_city_02;&lt;/P&gt;
&lt;P&gt;dt_city_03; .............&amp;nbsp; so on to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dt_city_10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to assign &lt;STRONG&gt;city&lt;/STRONG&gt; into 1 macro variable and &lt;STRONG&gt;01,02,03(so on to 10)&amp;nbsp;&lt;/STRONG&gt;into other macro variable.....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show us the results that you want. I'm afraid I don't find your explanation clear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, where are these 10 data set names located? Are they in a text file, or an Excel file, or a SAS data set, or did you type them into your SAS program, or somewhere else?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 12:15:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/548469#M152090</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-04-04T12:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to assing into a macro varibale</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/548485#M152099</link>
      <description>&lt;P&gt;This creates your dataset names:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro mymac(dspart=,number=);
%do i = 1 %to &amp;amp;number.;
  %let dsnum=%sysfunc(putn(&amp;amp;i.,z2.));
  %let dsname=dt_&amp;amp;dspart._&amp;amp;dsnum.;
  %put dsname=&amp;amp;dsname.;
%end;
%mend;
%mymac(dspart=city,number=10)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Apr 2019 13:26:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/548485#M152099</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-04-04T13:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to assing into a macro varibale</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/549194#M152366</link>
      <description>&lt;P&gt;SAS data sets (data set name itself saved as dt_city_01..... dt_city_10)....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 07:31:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/549194#M152366</guid>
      <dc:creator>vThanu</dc:creator>
      <dc:date>2019-04-08T07:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to assing into a macro varibale</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/549196#M152367</link>
      <description>&lt;P&gt;Please find the attached document for your reference....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per the attached document, I want to create Two macro variables - 1 for City and other for 01&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 07:45:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/549196#M152367</guid>
      <dc:creator>vThanu</dc:creator>
      <dc:date>2019-04-08T07:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to assing into a macro varibale</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/549200#M152368</link>
      <description>&lt;P&gt;Please post relevant information as text, many won't open office documents.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 08:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/549200#M152368</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-04-08T08:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to assing into a macro varibale</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/549204#M152369</link>
      <description>&lt;P&gt;If you want to set a macro variable from the names of datasets, use a "select into" from dictionary.tables in proc sql.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 09:15:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/549204#M152369</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-04-08T09:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to assing into a macro varibale</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/549209#M152370</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/247664"&gt;@vThanu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe most people will understand what you have but it's a bit hard to understand what you want. What's normally really helpful is to get a desired result - like you giving us the name and content of the macro variables you're after in detail.&lt;/P&gt;
&lt;P&gt;Below a code sample which hopefully will provide you the hints you need to make things working for you. Run the code and inspect the SAS log.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.dt_city_01 work.dt_city_02 work.dt_city_03;
  set sashelp.class;
run;
    
proc sql noprint;
  select 
    memname, memname 
      into :ds_name_mvar1-:ds_name_mvar99, :ds_name_list separated by ' '
  from dictionary.tables
  where libname='WORK' and memname like 'DT^_CITY^_%' escape '^'
  ;
quit;
%put &amp;amp;=sqlobs;
%put &amp;amp;=ds_name_list;

%macro PutCreatedMVars();
%put &amp;amp;=sqlobs;
  %do i=1 %to &amp;amp;sqlobs;
    %put ds_name_mvar&amp;amp;i: &amp;amp;&amp;amp;ds_name_mvar&amp;amp;i;
  %end;
%mend;
%PutCreatedMVars()
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Apr 2019 10:28:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assing-into-a-macro-varibale/m-p/549209#M152370</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-04-08T10:28:20Z</dc:date>
    </item>
  </channel>
</rss>

