<?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: Folks , any suggestions on how to reduce the second part of the code?(after the sqlloop) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Folks-any-suggestions-on-how-to-reduce-the-second-part-of-the/m-p/140946#M28342</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you explain what you're trying to do instead, there may be a better way overall. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Jan 2015 21:27:18 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-01-27T21:27:18Z</dc:date>
    <item>
      <title>Folks , any suggestions on how to reduce the second part of the code?(after the sqlloop)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Folks-any-suggestions-on-how-to-reduce-the-second-part-of-the/m-p/140945#M28341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%macro sqlloop(begin,stop);&lt;BR /&gt; /* &amp;amp;exam is the variable for looping through the eight exams of the cohort */&lt;BR /&gt; PROC SQL noprint;&lt;BR /&gt;&amp;nbsp; %DO exam=&amp;amp;begin. %TO &amp;amp;stop.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %let i=%eval(&amp;amp;exam. +1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /* %put the value of i is &amp;amp;i;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let k=%eval(&amp;amp;exam + 2); */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CREATE TABLE Gout_miss_&amp;amp;exam. as &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT t1.sample,&amp;nbsp; t1.shareid, t1.exams, t1.cohort, t1.gout_inci, count(*) as&amp;nbsp; GoutMiss_&amp;amp;exam.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM work.FRAMINGHAM_CLEANDATA_1 t1 where (t1.exams = &amp;amp;exam.) and (t1.gout_inci = 'NA')&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CREATE table gout_inci&amp;amp;exam. as &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT t1.sample,&amp;nbsp; t1.shareid, t1.exams, t1.cohort, t1.gout_inci, count (*) as GoutInci_&amp;amp;exam.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM work.FRAMINGHAM_CLEANDATA_1 t1 where (t1.exams = &amp;amp;exam.) and (t1.gout_inci = '1');&lt;BR /&gt;&amp;nbsp; %END;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;%sqlloop(begin=1, stop=8 );&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt; create table Gout_miss_12&amp;nbsp; as&lt;BR /&gt;&amp;nbsp; SELECT A.sample,&amp;nbsp; A.shareid, A.exams, A.cohort, A.gout_inci, count(*) as&amp;nbsp; GoutMiss_&lt;BR /&gt;&amp;nbsp;&amp;nbsp; from Gout_miss_1&amp;nbsp; A &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_2&amp;nbsp; B on (A.sample = B.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_inci3 t1 on (A.sample= t1.sample);&lt;BR /&gt; create table Gout_miss_123&amp;nbsp; as&lt;BR /&gt;&amp;nbsp; SELECT A.sample,&amp;nbsp; A.shareid, A.exams, A.cohort, A.gout_inci, count(*) as&amp;nbsp; GoutMiss_&lt;BR /&gt;&amp;nbsp;&amp;nbsp; from Gout_miss_1&amp;nbsp; A &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_2&amp;nbsp; B on (A.sample = B.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_3&amp;nbsp; C on (A.sample = C.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_inci4 t1 on (A.sample= t1.sample);&lt;BR /&gt; create table Gout_miss_1234&amp;nbsp; as&lt;BR /&gt;&amp;nbsp; SELECT A.sample,&amp;nbsp; A.shareid, A.exams, A.cohort, A.gout_inci, count(*) as&amp;nbsp; GoutMiss_&lt;BR /&gt;&amp;nbsp;&amp;nbsp; from Gout_miss_1&amp;nbsp; A &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_2&amp;nbsp; B on (A.sample = B.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_3&amp;nbsp; C on (A.sample = C.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_4&amp;nbsp; D on (A.sample = D.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_inci5 t1 on (A.sample= t1.sample);&lt;BR /&gt; create table Gout_miss_12345&amp;nbsp; as&lt;BR /&gt;&amp;nbsp; SELECT A.sample,&amp;nbsp; A.shareid, A.exams, A.cohort, A.gout_inci, count(*) as&amp;nbsp; GoutMiss_&lt;BR /&gt;&amp;nbsp;&amp;nbsp; from Gout_miss_1&amp;nbsp; A &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_2&amp;nbsp; B on (A.sample = B.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_3&amp;nbsp; C on (A.sample = C.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_4&amp;nbsp; D on (A.sample = D.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_5&amp;nbsp; E on (A.sample = E.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_inci6 t1 on (A.sample= t1.sample);&lt;BR /&gt; create table Gout_miss_123456&amp;nbsp; as&lt;BR /&gt;&amp;nbsp; SELECT A.sample,&amp;nbsp; A.shareid, A.exams, A.cohort, A.gout_inci, count(*) as&amp;nbsp; GoutMiss_&lt;BR /&gt;&amp;nbsp;&amp;nbsp; from Gout_miss_1&amp;nbsp; A &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_2&amp;nbsp; B on (A.sample = B.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_3&amp;nbsp; C on (A.sample = C.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_4&amp;nbsp; D on (A.sample = D.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_5&amp;nbsp; E on (A.sample = E.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_6&amp;nbsp; F on (A.sample = F.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_inci7 t1 on (A.sample= t1.sample);&lt;BR /&gt; create table Gout_miss_1234567&amp;nbsp; as&lt;BR /&gt;&amp;nbsp; SELECT A.sample,&amp;nbsp; A.shareid, A.exams, A.cohort, A.gout_inci, count(*) as&amp;nbsp; GoutMiss_&lt;BR /&gt;&amp;nbsp;&amp;nbsp; from Gout_miss_1&amp;nbsp; A &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_2&amp;nbsp; B on (A.sample = B.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_3&amp;nbsp; C on (A.sample = C.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_4&amp;nbsp; D on (A.sample = D.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_5&amp;nbsp; E on (A.sample = E.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_6&amp;nbsp; F on (A.sample = F.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_miss_7&amp;nbsp; G on (A.sample = G.sample)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join Gout_inci8 t1 on (A.sample= t1.sample);&lt;BR /&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 21:20:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Folks-any-suggestions-on-how-to-reduce-the-second-part-of-the/m-p/140945#M28341</guid>
      <dc:creator>kraman_uab_edu</dc:creator>
      <dc:date>2015-01-27T21:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Folks , any suggestions on how to reduce the second part of the code?(after the sqlloop)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Folks-any-suggestions-on-how-to-reduce-the-second-part-of-the/m-p/140946#M28342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you explain what you're trying to do instead, there may be a better way overall. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 21:27:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Folks-any-suggestions-on-how-to-reduce-the-second-part-of-the/m-p/140946#M28342</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-01-27T21:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Folks , any suggestions on how to reduce the second part of the code?(after the sqlloop)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Folks-any-suggestions-on-how-to-reduce-the-second-part-of-the/m-p/140947#M28343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I&amp;nbsp; generate subsets of data-tables&amp;nbsp; from one table using the variable exam(1to &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; with two possibilities each time(gout_inci = 'na' or 1).&lt;/P&gt;&lt;P&gt;After I get these tables generated I&amp;nbsp; inner join them to generate new tables. This code works. But I was wondering if I could do the inner join portion using some kind of loop. that's all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 21:42:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Folks-any-suggestions-on-how-to-reduce-the-second-part-of-the/m-p/140947#M28343</guid>
      <dc:creator>kraman_uab_edu</dc:creator>
      <dc:date>2015-01-27T21:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Folks , any suggestions on how to reduce the second part of the code?(after the sqlloop)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Folks-any-suggestions-on-how-to-reduce-the-second-part-of-the/m-p/140948#M28344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe you have described what you are currently doing not why. What are you doing with the resulting tables?&lt;/P&gt;&lt;P&gt;I think what you are doing is possibly an odd way of selecting records for counting, which might be doable by creating a series of index variables and summing those. Which could also be used for subsetting if the data is then fed into other steps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 21:59:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Folks-any-suggestions-on-how-to-reduce-the-second-part-of-the/m-p/140948#M28344</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-01-27T21:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Folks , any suggestions on how to reduce the second part of the code?(after the sqlloop)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Folks-any-suggestions-on-how-to-reduce-the-second-part-of-the/m-p/140949#M28345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just need the record count after the inner joins to predict the &lt;BR /&gt;subjects who entered the study with gout.&amp;nbsp; for example the first inner join intersects where gout_inci was 'NA' in exams 1 &amp;amp; 2 but had gout_inci = 1 in exam 3.&amp;nbsp; Then I repeat the same&amp;nbsp; upto exam 8.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 22:07:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Folks-any-suggestions-on-how-to-reduce-the-second-part-of-the/m-p/140949#M28345</guid>
      <dc:creator>kraman_uab_edu</dc:creator>
      <dc:date>2015-01-27T22:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Folks , any suggestions on how to reduce the second part of the code?(after the sqlloop)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Folks-any-suggestions-on-how-to-reduce-the-second-part-of-the/m-p/140950#M28346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So you are looking across multiple records and want to identify if the subject had gout at any of the exams? Or which exam number that gout first appeared?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 22:19:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Folks-any-suggestions-on-how-to-reduce-the-second-part-of-the/m-p/140950#M28346</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-01-27T22:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Folks , any suggestions on how to reduce the second part of the code?(after the sqlloop)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Folks-any-suggestions-on-how-to-reduce-the-second-part-of-the/m-p/140951#M28347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you trying to count how many people first developed GOUT by each EXAMS value?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;do until (last.SAMPLE);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;work.FRAMINGHAM_CLEANDATA_1 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; by SAMPLE EXAMS ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if GOUT_INCI='1' and missing(first_gout) then first_gout=EXAMS;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;keep SAMPLE FIRST_GOUT ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc freq ;&lt;/P&gt;&lt;P&gt;tables first_gout;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 22:38:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Folks-any-suggestions-on-how-to-reduce-the-second-part-of-the/m-p/140951#M28347</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-01-27T22:38:27Z</dc:date>
    </item>
  </channel>
</rss>

