<?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: Use macro to convert multiple STATA files to SAS files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Use-macro-to-convert-multiple-STATA-files-to-SAS-files/m-p/160934#M31308</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"C:\data\us_ny_&amp;amp;i_core.dta"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"C:\data\us_ny_&amp;amp;i._core.dta" &lt;/P&gt;&lt;P&gt;the . after the macro variable says to append the following text. As written it is looking for a macro variable named I_core&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Feb 2015 16:00:25 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-02-10T16:00:25Z</dc:date>
    <item>
      <title>Use macro to convert multiple STATA files to SAS files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-macro-to-convert-multiple-STATA-files-to-SAS-files/m-p/160933#M31307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've asked a similar question previously at &lt;A __default_attr="64982" __jive_macro_name="thread" class="jive_macro jive_macro_thread" href="https://communities.sas.com/"&gt;&lt;/A&gt;. But the answer does not seem to address my current case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 10 STATA files which I need to convert to SAS files. Their files names are like "us_ny_YEAR_core.dta"; here, "YEAR" stands for each specific year from 2001 to 2010. As I tried to do the following macro to convert the files, it does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro convert_data();&lt;/P&gt;&lt;P&gt;%do i=2001 %to 2010;&lt;/P&gt;&lt;P&gt;proc import out=ny&amp;amp;i datafile="C:\data\us_ny_&amp;amp;i_core.dta";run;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%convert_data();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone has any suggestion? Thanks so much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lizi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 15:14:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-macro-to-convert-multiple-STATA-files-to-SAS-files/m-p/160933#M31307</guid>
      <dc:creator>lizzy28</dc:creator>
      <dc:date>2015-02-10T15:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Use macro to convert multiple STATA files to SAS files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-macro-to-convert-multiple-STATA-files-to-SAS-files/m-p/160934#M31308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"C:\data\us_ny_&amp;amp;i_core.dta"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"C:\data\us_ny_&amp;amp;i._core.dta" &lt;/P&gt;&lt;P&gt;the . after the macro variable says to append the following text. As written it is looking for a macro variable named I_core&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 16:00:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-macro-to-convert-multiple-STATA-files-to-SAS-files/m-p/160934#M31308</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-02-10T16:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Use macro to convert multiple STATA files to SAS files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-macro-to-convert-multiple-STATA-files-to-SAS-files/m-p/160935#M31309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Ballard. I see your point.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 16:14:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-macro-to-convert-multiple-STATA-files-to-SAS-files/m-p/160935#M31309</guid>
      <dc:creator>lizzy28</dc:creator>
      <dc:date>2015-02-10T16:14:07Z</dc:date>
    </item>
  </channel>
</rss>

