<?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 doubt in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15405#M2697</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming that the table MASTER_FINAL is a data set that has January's data merged with your file. The table for this month is TABLE_1202. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;%MACRO RUNTHIS(TABLEDT);&lt;BR /&gt;DATA MASTER;&lt;BR /&gt;MERGE MASTER_FINAL (IN=A) TABLE_&amp;amp;TABLEDT. (IN=B);&lt;BR /&gt;BY ID;&lt;BR /&gt;IF A;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;DATA MASTER_FINAL;&lt;/P&gt;&lt;P&gt;SET MASTER;&lt;/P&gt;&lt;P&gt;RUN;&lt;BR /&gt;%MEND;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%RUNTHIS(1202)&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Feb 2012 18:51:23 GMT</pubDate>
    <dc:creator>Hima</dc:creator>
    <dc:date>2012-02-27T18:51:23Z</dc:date>
    <item>
      <title>doubt</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15399#M2691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have merge step like belw which has to merge jan and feb months data to the main master thereby creating feb dataset.&lt;/P&gt;&lt;P&gt;Likewise in March, the master should be merged with jan,feb and march months data. though i was able to create a macro for reading&lt;/P&gt;&lt;P&gt;the required input files for a particular month correctly (that is for Feb month, jan and feb months data should be read) &lt;/P&gt;&lt;P&gt;but im helpless in automating the below step. Colud anyone help me out .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data feb;&lt;/P&gt;&lt;P&gt;merge master(in=a) jan(in=b) feb(in=c);&lt;/P&gt;&lt;P&gt;by id;&lt;/P&gt;&lt;P&gt;if a;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 16:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15399#M2691</guid>
      <dc:creator>Happy</dc:creator>
      <dc:date>2012-02-27T16:45:04Z</dc:date>
    </item>
    <item>
      <title>doubt</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15400#M2692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, do you really want to merge the files, or do you really just want to add new records to the master file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, regardless of whether you really want to merge or concatenate, I think it would be easiest if you either updated the master each month or, if that isn't possible, build a macro that accomplishes the task one month at a time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 16:50:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15400#M2692</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-27T16:50:42Z</dc:date>
    </item>
    <item>
      <title>doubt</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15401#M2693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Can you please let me know how the names appear in your data base. That way it will help us in coding.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 16:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15401#M2693</guid>
      <dc:creator>Hima</dc:creator>
      <dc:date>2012-02-27T16:52:33Z</dc:date>
    </item>
    <item>
      <title>doubt</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15402#M2694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;Yes i only have to merge the files. Will try building a macro then ..&lt;/P&gt;&lt;P&gt;but other than this is there not any other better way?.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 17:25:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15402#M2694</guid>
      <dc:creator>Happy</dc:creator>
      <dc:date>2012-02-27T17:25:09Z</dc:date>
    </item>
    <item>
      <title>doubt</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15403#M2695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To answer your question the forum members would need to know more about your data.&amp;nbsp; It would help if you could post example data for your master and, say, jan and feb, and what you want the resulting file to look like given that example data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 17:34:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15403#M2695</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-27T17:34:08Z</dc:date>
    </item>
    <item>
      <title>doubt</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15404#M2696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you're only keeping records in the master data set anyways (if a) then perhaps look at the update and modify options instead of a merge?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It depends on what your'e looking to do, so need more details as others have indicated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 18:25:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15404#M2696</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-02-27T18:25:41Z</dc:date>
    </item>
    <item>
      <title>doubt</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15405#M2697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming that the table MASTER_FINAL is a data set that has January's data merged with your file. The table for this month is TABLE_1202. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;%MACRO RUNTHIS(TABLEDT);&lt;BR /&gt;DATA MASTER;&lt;BR /&gt;MERGE MASTER_FINAL (IN=A) TABLE_&amp;amp;TABLEDT. (IN=B);&lt;BR /&gt;BY ID;&lt;BR /&gt;IF A;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;DATA MASTER_FINAL;&lt;/P&gt;&lt;P&gt;SET MASTER;&lt;/P&gt;&lt;P&gt;RUN;&lt;BR /&gt;%MEND;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%RUNTHIS(1202)&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 18:51:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15405#M2697</guid>
      <dc:creator>Hima</dc:creator>
      <dc:date>2012-02-27T18:51:23Z</dc:date>
    </item>
    <item>
      <title>doubt</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15406#M2698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;%let want_month=4 ; *must be number of month , 4 is April ;

options mprint;
%macro month;
%let list=Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec;
data %scan(&amp;amp;list,&amp;amp;want_month) ;
 merge master(in=a) %do i=1 %to &amp;amp;want_month ;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %scan(&amp;amp;list,&amp;amp;i)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;
 by id;
 if a;
 run;
%mend month;
%month

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 02:56:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15406#M2698</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-02-28T02:56:48Z</dc:date>
    </item>
    <item>
      <title>doubt</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15407#M2699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Hima for yur reply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 17:24:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15407#M2699</guid>
      <dc:creator>Happy</dc:creator>
      <dc:date>2012-02-28T17:24:41Z</dc:date>
    </item>
    <item>
      <title>doubt</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15408#M2700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #eef4f9;"&gt;Oh Great!!....Your code is really interesting ..Never thought that we can do iterations on a dataset mentioned within a merge step...!! Learnt sumthning new ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;Thanks alot Ksharp.:)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 17:26:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/doubt/m-p/15408#M2700</guid>
      <dc:creator>Happy</dc:creator>
      <dc:date>2012-02-28T17:26:57Z</dc:date>
    </item>
  </channel>
</rss>

