<?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: Iterating data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Iterating-data-step/m-p/276499#M55398</link>
    <description>&lt;P&gt;At a minimum, you will have to tell us a little more. &amp;nbsp;Where is the program hanging up? &amp;nbsp;Before the macro starts, in the middle of the macro, after the macro ends? &amp;nbsp;Where can we find a copy of the macro? &amp;nbsp;Does the log file keep getting larger or not?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Four days sounds like an unreasonable amount of time. &amp;nbsp;It is possible that the larger sizes have used up some other resource such as the space in the WORK area, and that no further processing is able to take place.&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jun 2016 13:47:28 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-06-10T13:47:28Z</dc:date>
    <item>
      <title>Iterating data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Iterating-data-step/m-p/276414#M55371</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I am trying to match controls to cases using gmatch macro(by Eric bregstralh). The processing time is fairly fast (3min) if I use 100 cases and 2000000 controls as the source data. However, I&amp;nbsp;applied this macro to my unmatched case/control data [n=10832090 (cases =345013, pool of potential controls=10487077)] and its taking longer to process (four days now). &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I used to process the 100cases/2000000 potential controls. Is it want to iterate until&amp;nbsp;the last case is matched to 4 possible controls? &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%include "C:\SAS programs\gmatch.sas";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;/**randomly selecting 100 cases without replacement**/&lt;/P&gt;&lt;P&gt;PROC SURVEYSELECT DATA=casecontrol( WHERE=(case = 1))&lt;BR /&gt;OUT=case&lt;BR /&gt;METHOD=SRS&lt;BR /&gt;N=100&lt;BR /&gt;SEED=1420;&lt;BR /&gt;ID uniqueid gender yob ethnicity1 ;&lt;BR /&gt;RUN;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;/**randomly selecting 2000000 controls without replacement**/&lt;/SPAN&gt;&lt;BR /&gt;PROC SURVEYSELECT DATA=casecontrol ( WHERE=(T2DMstatus =0))&lt;BR /&gt;OUT=control&lt;BR /&gt;METHOD=SRS&lt;BR /&gt;N=2000000&lt;BR /&gt;SEED=345;&lt;BR /&gt;ID uniqueid gender yob ethnicity1 ;&lt;BR /&gt;RUN;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=case; by uniqueid;run;&lt;BR /&gt;proc sort data=control;by uniqueid;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data unmatched;&lt;BR /&gt;set case control;&lt;BR /&gt;by uniqueid;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%gmatch(data=unmatched,group=t2dmstatus,id=uniqueid,mvars= gender yob ethnicity1,wts=10 1 4,dmaxk=0 1 0,&lt;BR /&gt;dist=1,transf =1, contls=4,seedca=67,seedco=99,out=greedymatched,outnmca=nonmathcedcases,outnmco=nonmathchedcontrols);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data match;&lt;BR /&gt;set greedymatched;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/**creating a dataset that doesn't contain the matches just made from above**/&lt;/P&gt;&lt;P&gt;/** next random selection of cases and controls should be done on this dataset**/&lt;BR /&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE potential_match AS&lt;BR /&gt;SELECT *&lt;BR /&gt;FROM casecontrol_2014&lt;BR /&gt;WHERE uniqueid NOT IN (SELECT __IDCA FROM match)&lt;BR /&gt;AND uniqueid NOT IN (SELECT __IDCO FROM match);&lt;/P&gt;&lt;P&gt;%END;&lt;/P&gt;&lt;P&gt;/***************************************************************************/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to be able to repeat this whole process until the dataset potential_match has no more case. This process is likely to produce close to 3000 datasets that will be merged.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 04:33:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Iterating-data-step/m-p/276414#M55371</guid>
      <dc:creator>kaditor</dc:creator>
      <dc:date>2016-06-10T04:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Iterating-data-step/m-p/276499#M55398</link>
      <description>&lt;P&gt;At a minimum, you will have to tell us a little more. &amp;nbsp;Where is the program hanging up? &amp;nbsp;Before the macro starts, in the middle of the macro, after the macro ends? &amp;nbsp;Where can we find a copy of the macro? &amp;nbsp;Does the log file keep getting larger or not?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Four days sounds like an unreasonable amount of time. &amp;nbsp;It is possible that the larger sizes have used up some other resource such as the space in the WORK area, and that no further processing is able to take place.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 13:47:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Iterating-data-step/m-p/276499#M55398</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-06-10T13:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Iterating-data-step/m-p/276521#M55406</link>
      <description>&lt;P&gt;Without know the specific macro it is a bit difficult to discuss. BUT you have &lt;STRONG&gt;multiplied&lt;/STRONG&gt; the case numbers by 3450, the controls by 5.2.&lt;/P&gt;
&lt;P&gt;If the process time expands linearly that would mean an expected&amp;nbsp;time approximately 3450*5.2*3 (minutes) =&amp;gt; about 37.4 days&amp;nbsp;by my estimate.&lt;/P&gt;
&lt;P&gt;If the actuall code is doing anything approaching cartesian&amp;nbsp;joins of stuff then the&amp;nbsp;time may not increase linearly but&amp;nbsp;more of an&amp;nbsp;n-squared.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 15:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Iterating-data-step/m-p/276521#M55406</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-06-10T15:17:36Z</dc:date>
    </item>
  </channel>
</rss>

