<?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: Assign id in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Assign-id/m-p/762853#M80940</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16719"&gt;@Miracle&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;FONT face="georgia,palatino" size="4"&gt;I try to use proc sql more for my work now.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Mastery of a tool also means knowing when not to use it.&lt;/P&gt;
&lt;P&gt;SQL is very useful for a lot of things, but using it here, and in a&amp;nbsp;&lt;STRONG&gt;production environment(!)&lt;/STRONG&gt;, would simply be stupid. The next one to maintain that code will come after you with murder in their eyes.&lt;/P&gt;</description>
    <pubDate>Fri, 20 Aug 2021 14:17:28 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-08-20T14:17:28Z</dc:date>
    <item>
      <title>Assign id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assign-id/m-p/762243#M80927</link>
      <description>&lt;P&gt;&lt;FONT face="georgia,palatino" size="3"&gt;Dear All,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="georgia,palatino" size="3"&gt;May I know how do go from 'have' to 'want' using proc sql?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="georgia,palatino" size="3"&gt;Thanks a lot.&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT face="georgia,palatino" size="3"&gt;&lt;U&gt;&lt;STRONG&gt;have&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;studyid test
abc110  1
abc110  2
abc110  3
abc201  1
abc201  2
abc405  1
abc405  2&lt;/FONT&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;FONT face="georgia,palatino" size="3"&gt;&lt;U&gt;&lt;STRONG&gt;want&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;studyid test   n
abc110  1           1
abc110  2          1
abc110  3          1
abc201  1          2
abc201  2         2
abc405  1         3
abc405  2         3&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 09:15:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assign-id/m-p/762243#M80927</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2021-08-18T09:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Assign id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assign-id/m-p/762245#M80928</link>
      <description>&lt;P&gt;The task defines the tool, so you use the data step for this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by studyid;
if first.studyid then n + 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;No need to code yourself to insanity when there's such a simple solution.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 09:23:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assign-id/m-p/762245#M80928</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-18T09:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Assign id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assign-id/m-p/762785#M80938</link>
      <description>&lt;P&gt;&lt;FONT face="georgia,palatino" size="4"&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp; for your solution using datastep.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="georgia,palatino" size="4"&gt;But I need to perform this manipulation using proc sql.&lt;BR /&gt;BTW, this is not homework. I try to use proc sql more for my work now.&lt;BR /&gt;Thanks a lot.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 08:49:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assign-id/m-p/762785#M80938</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2021-08-20T08:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Assign id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assign-id/m-p/762808#M80939</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16719"&gt;@Miracle&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT face="georgia,palatino" size="4"&gt;But I need to perform this manipulation using proc sql.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Really a bad idea. Use a DATA step. Don't listen to me, listen to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; , he knows.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 11:05:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assign-id/m-p/762808#M80939</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-20T11:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Assign id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assign-id/m-p/762853#M80940</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16719"&gt;@Miracle&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;FONT face="georgia,palatino" size="4"&gt;I try to use proc sql more for my work now.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Mastery of a tool also means knowing when not to use it.&lt;/P&gt;
&lt;P&gt;SQL is very useful for a lot of things, but using it here, and in a&amp;nbsp;&lt;STRONG&gt;production environment(!)&lt;/STRONG&gt;, would simply be stupid. The next one to maintain that code will come after you with murder in their eyes.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 14:17:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assign-id/m-p/762853#M80940</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-20T14:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Assign id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assign-id/m-p/763899#M80956</link>
      <description>&lt;P&gt;Thanks everyone for the advice.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 16:42:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assign-id/m-p/763899#M80956</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2021-08-25T16:42:36Z</dc:date>
    </item>
  </channel>
</rss>

