<?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: BASE  SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/340895#M77962</link>
    <description>&lt;P&gt;Here is one way to obtain the result you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want (keep=siteid country sites subid);
  length sites $100.;
  do until (last.siteid);
    set dem;
    by siteid;
    if first.siteid then call missing(sites);
    sites=catx(',',sites,invnam);
  end;
   do until (last.siteid);
    set dem;
    by siteid;
    output;
  end;
run;

&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Mar 2017 18:16:19 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2017-03-14T18:16:19Z</dc:date>
    <item>
      <title>BASE  SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/340884#M77960</link>
      <description>&lt;P&gt;i HAVE THE FOLLOWING DATASET:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA dem;&lt;BR /&gt;INPUT SITEID $ COUNTRY $ INVNAM $ subid ;&lt;BR /&gt;CARDS;&lt;BR /&gt;001 USA SRINU 101&lt;BR /&gt;001 USA RUBY 102&lt;BR /&gt;001 USA SAS 103&lt;BR /&gt;001 USA MEHAR 111&lt;BR /&gt;001 USA QLAS 104&lt;BR /&gt;002 USA SURI 105&lt;BR /&gt;002 USA KEERTI 106&lt;BR /&gt;002 USA DEEP 107&lt;BR /&gt;003 USA SATYA 108&lt;BR /&gt;004 USA XYZ 109&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;I need output as&lt;/P&gt;&lt;P&gt;001 USA SRINU,RUBY,SAS,MEHAR,QLAS 101&lt;BR /&gt;001 USA SRINU,RUBY,SAS,MEHAR,QLAS 102&lt;BR /&gt;001 USA SRINU,RUBY,SAS,MEHAR,QLAS 103&lt;BR /&gt;001 USA SRINU,RUBY,SAS,MEHAR,QLAS 111&lt;BR /&gt;001 USA SRINU,RUBY,SAS,MEHAR,QLAS 104&lt;BR /&gt;002 USA SURI,KEERTI,DEEP 105&lt;BR /&gt;002 USA SURI,KEERTI,DEEP 106&lt;BR /&gt;002 USA SURI,KEERTI,DEEP 107&lt;BR /&gt;003 USA SATYA 108&lt;BR /&gt;004 USA XYZ 109&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 17:59:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/340884#M77960</guid>
      <dc:creator>molla</dc:creator>
      <dc:date>2017-03-14T17:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: BASE  SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/340895#M77962</link>
      <description>&lt;P&gt;Here is one way to obtain the result you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want (keep=siteid country sites subid);
  length sites $100.;
  do until (last.siteid);
    set dem;
    by siteid;
    if first.siteid then call missing(sites);
    sites=catx(',',sites,invnam);
  end;
   do until (last.siteid);
    set dem;
    by siteid;
    output;
  end;
run;

&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 18:16:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/340895#M77962</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-03-14T18:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: BASE  SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/340928#M77966</link>
      <description>&lt;P&gt;Hi I got the result,cud u pls explain me the program&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 19:23:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/340928#M77966</guid>
      <dc:creator>molla</dc:creator>
      <dc:date>2017-03-14T19:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: BASE  SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/340947#M77967</link>
      <description>&lt;P&gt;Sure. The first part of the programs reach each record. For each siteid it builds a variable called sites that contains all of the invnams that the particular siteid&amp;nbsp;has records for. By the time it reaches the last siteid, sites contains all of the invnams for that siteid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want (keep=siteid country sites subid);
  length sites $100.;
  do until (last.siteid);
    set dem;
    by siteid;
    if first.siteid then call missing(sites);
    sites=catx(',',sites,invnam);
  end;&lt;/PRE&gt;
&lt;P&gt;As soon as the last record for a siteid is processed, the second part of the program takes over and simply outputs the results.&lt;/P&gt;
&lt;PRE&gt;   do until (last.siteid);
    set dem;
    by siteid;
    output;
  end;
run;&lt;/PRE&gt;
&lt;P&gt;You can Google the method to understand more about it. It's referred to as a Double DOW.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 20:21:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/340947#M77967</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-03-14T20:21:22Z</dc:date>
    </item>
  </channel>
</rss>

