<?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: combine data vertically with easy macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/combine-data-vertically-with-easy-macro-variable/m-p/76972#M16632</link>
    <description>Firstly, you appear to be mixing SAS macro language constucts (the %LET macro variable assignments) with DATA step logic -- the SAS %LET statement will be resolved at SAS compile time, not with each iterative DATA step pass.  Or possibly you are not sharing all SAS code, maybe, such as the surrounding %MACRO and %MEND statements necessary with a %DO %END looping technique.&lt;BR /&gt;
&lt;BR /&gt;
Recommending reading up on the SAS MACRO facility documentation if you intend to execute your DATA step "n" times, once for each INFILE specification.  Also, I noticed you may be intending to read several input files in a single DATA step execution -- which is quite possible, however you will either need to reset your lastobs variable to zero with each DO UNTIL(lastobs);  END;  execution  -- SAS will not reset the variable for you -- another suitable technique is to change your END= SAS variable to make it unique for each %DO %END macro execution.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Sun, 15 Mar 2009 18:25:33 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-03-15T18:25:33Z</dc:date>
    <item>
      <title>combine data vertically with easy macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/combine-data-vertically-with-easy-macro-variable/m-p/76971#M16631</link>
      <description>When Im trying to submit the following code to combine the monthly data, SAS returns only the infos from the first month with log 'NOTE: LOST CARD.&lt;BR /&gt;
i=2 lastobs=1 Flight=IA11101 Origin=HND Dest=SFO Date=14883 RevCargo=182886 _ERROR_=1 _N_=1'. What the hell is wrong with that?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data temp1 (drop=i);&lt;BR /&gt;
%let n=9;&lt;BR /&gt;
 do i=1 to 3;&lt;BR /&gt;
     do until (lastobs);&lt;BR /&gt;
      infile "C:\Documents and Settings\Administrator\Desktop\SASPROG3data\prog3_v8\month&amp;amp;n..dat" end=lastobs;&lt;BR /&gt;
      input Flight $ Origin $ Dest $ Date : date9.  RevCargo : comma15.2;&lt;BR /&gt;
      output;&lt;BR /&gt;
      end;&lt;BR /&gt;
  %let n=%eval(&amp;amp;n+1);&lt;BR /&gt;
  end;&lt;BR /&gt;
  stop;&lt;BR /&gt;
  run;</description>
      <pubDate>Sun, 15 Mar 2009 16:18:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/combine-data-vertically-with-easy-macro-variable/m-p/76971#M16631</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-15T16:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: combine data vertically with easy macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/combine-data-vertically-with-easy-macro-variable/m-p/76972#M16632</link>
      <description>Firstly, you appear to be mixing SAS macro language constucts (the %LET macro variable assignments) with DATA step logic -- the SAS %LET statement will be resolved at SAS compile time, not with each iterative DATA step pass.  Or possibly you are not sharing all SAS code, maybe, such as the surrounding %MACRO and %MEND statements necessary with a %DO %END looping technique.&lt;BR /&gt;
&lt;BR /&gt;
Recommending reading up on the SAS MACRO facility documentation if you intend to execute your DATA step "n" times, once for each INFILE specification.  Also, I noticed you may be intending to read several input files in a single DATA step execution -- which is quite possible, however you will either need to reset your lastobs variable to zero with each DO UNTIL(lastobs);  END;  execution  -- SAS will not reset the variable for you -- another suitable technique is to change your END= SAS variable to make it unique for each %DO %END macro execution.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Sun, 15 Mar 2009 18:25:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/combine-data-vertically-with-easy-macro-variable/m-p/76972#M16632</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-03-15T18:25:33Z</dc:date>
    </item>
  </channel>
</rss>

