<?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 Generating ID but don't want to have an id for blank value rows in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11843#M1481</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Besides the variable positions in the output dataset, what is the difference put "retain id ." before and after "set x"?&amp;nbsp; Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data y;&lt;/P&gt;&lt;P&gt;retain id .;&lt;/P&gt;&lt;P&gt;set x;&lt;/P&gt;&lt;P&gt;by num;&lt;/P&gt;&lt;P&gt;if ^missing(num) then id+first.num;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/**********************/&lt;/P&gt;&lt;P&gt;data y;&lt;/P&gt;&lt;P&gt;set x;&lt;/P&gt;&lt;P&gt;retain id .;&lt;/P&gt;&lt;P&gt;by num;&lt;/P&gt;&lt;P&gt;if ^missing(num) then id+first.num;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 Dec 2011 23:02:55 GMT</pubDate>
    <dc:creator>Linlin</dc:creator>
    <dc:date>2011-12-03T23:02:55Z</dc:date>
    <item>
      <title>Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11831#M1469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a data table that I have sorted by a specific field.&amp;nbsp; I want to create an id for this field so I did the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data tbl ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length id 8 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set tbl_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; by num ;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain id 0 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.num then id = id + 1 ;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first few rows of num are blank and I want them to have a . not 0 as the id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm going to use this to create an look up table so by assigning the ids here I can split up the data sets after.&amp;nbsp; I just don't want id 1 = to a blank value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 14:59:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11831#M1469</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2011-09-19T14:59:50Z</dc:date>
    </item>
    <item>
      <title>Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11832#M1470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;Is this what you're looking for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="color: navy; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;data &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="color: black; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;tbl ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: 35.4pt; margin-bottom: 0.0001pt;"&gt;&lt;SPAN lang="EN-US" style="color: blue; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;length&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt; id &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="color: teal; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;8&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="color: black; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: 35.4pt; margin-bottom: 0.0001pt;"&gt;&lt;SPAN lang="EN-US" style="color: blue; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt; tbl_ ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: 35.4pt; margin-bottom: 0.0001pt;"&gt;&lt;SPAN lang="EN-US" style="color: blue; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt; num ;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: 35.4pt; margin-bottom: 0.0001pt;"&gt;&lt;SPAN lang="EN-US" style="color: blue; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;retain&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt; id &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="color: teal; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;0&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="color: black; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="color: blue; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt; not missing(num) &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;then &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;do&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="color: blue; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt; first.num &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt; id = id + &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="color: teal; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="color: black; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN lang="EN-US" style="color: black; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; end&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="color: navy; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;run&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="color: black; background-color: white; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/hobbes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 17:39:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11832#M1470</guid>
      <dc:creator>Hobbes</dc:creator>
      <dc:date>2011-09-19T17:39:59Z</dc:date>
    </item>
    <item>
      <title>Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11833#M1471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are trying to accomplish something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data tbl (drop=counter);&lt;/P&gt;&lt;P&gt;&amp;nbsp; length id 8 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set tbl_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain id . ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if not missing(num) then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter + 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; num=counter; &lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 17:52:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11833#M1471</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-09-19T17:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11834#M1472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys but neither worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Art, &lt;/P&gt;&lt;P&gt;shouldn't the last line of code set id=counter not num?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is how I have it working &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data tbl (drop=counter);&lt;/P&gt;&lt;P&gt;&amp;nbsp; length id 8 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set tbl_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by num ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain id . ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if not missing(num) then do;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.num then do ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter + 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id = counter;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 18:52:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11834#M1472</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2011-09-19T18:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11835#M1473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data tbl ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length id 8 ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set tbl_ ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; by num ;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain id 0 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if num = . then id = .;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if first.num then id + 1 ;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output on first column as input:&lt;/P&gt;&lt;P&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But is there any difference between using NUM or ID as ID field?&amp;nbsp; The only difference is that ID is sequential, but if you only need them as keys, then there's really no difference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 19:02:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11835#M1473</guid>
      <dc:creator>DLing</dc:creator>
      <dc:date>2011-09-19T19:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11836#M1474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I typed too quickly, twice.&amp;nbsp; It should have read:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data tbl (drop=counter);&lt;/P&gt;&lt;P&gt;&amp;nbsp; length id 8 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set tbl_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain id . ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if not missing(num) then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter + 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id=counter;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plus I have a question about num and why you originally used a by statement and looked for first.num.&amp;nbsp; Is there anything special you want done for different nums?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First.Num is only a boolean that will be equal to 1 for the first instance of the particular value in Num and zero for all other instances of that particular value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 19:05:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11836#M1474</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-09-19T19:05:05Z</dc:date>
    </item>
    <item>
      <title>Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11837#M1475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming num is a numeric variable. Try this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data tbl ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length id 8 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set tbl_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; by num ;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.num then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if nmiss(num) then id = .;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if n(num) then id+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end; &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 19:06:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11837#M1475</guid>
      <dc:creator>NickR</dc:creator>
      <dc:date>2011-09-19T19:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11838#M1476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you everyone for your help. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arts last post helped a lot.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2011 19:48:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11838#M1476</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2011-11-29T19:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11839#M1477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... you already got an answer, but here's another suggestion ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;data y;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;set x;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;by num;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;if ^missing(num) then id+first.num;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;else id = .;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 02:49:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11839#M1477</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2011-11-30T02:49:14Z</dc:date>
    </item>
    <item>
      <title>Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11840#M1478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; great code - so simple! :smileyshocked:&lt;/P&gt;&lt;P&gt;(even without the "else ... " )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 17:24:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11840#M1478</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-12-01T17:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11841#M1479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... nicer without the "else..." but unfortunately that generates a id=0 (rather than missing) for the missing num rows given how the sum statement works (with an initial value of zero)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;without the "else" ... but retain is also an extra statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data y;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;retain id .;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;set x;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;by num;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;if ^missing(num) then id+first.num;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the use of +first.&amp;lt;var&amp;gt; for a group counter comes from posts I saw ... and remembered, that's the hard part ... by Howard Schreier a long time ago&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Howard is the elegant code master&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Dec 2011 14:52:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11841#M1479</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2011-12-03T14:52:01Z</dc:date>
    </item>
    <item>
      <title>Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11842#M1480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; no q about Howard's status!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As to the ELSE&amp;nbsp; - my mistake!&lt;/P&gt;&lt;P&gt;I was surprised to see the default of an accumulator is zero rather than missing! &lt;/P&gt;&lt;P&gt;Cannot believe the ELSE statement would ever use measureably more cpu than the RETAIN id .; !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Dec 2011 17:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11842#M1480</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-12-03T17:28:59Z</dc:date>
    </item>
    <item>
      <title>Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11843#M1481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Besides the variable positions in the output dataset, what is the difference put "retain id ." before and after "set x"?&amp;nbsp; Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data y;&lt;/P&gt;&lt;P&gt;retain id .;&lt;/P&gt;&lt;P&gt;set x;&lt;/P&gt;&lt;P&gt;by num;&lt;/P&gt;&lt;P&gt;if ^missing(num) then id+first.num;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/**********************/&lt;/P&gt;&lt;P&gt;data y;&lt;/P&gt;&lt;P&gt;set x;&lt;/P&gt;&lt;P&gt;retain id .;&lt;/P&gt;&lt;P&gt;by num;&lt;/P&gt;&lt;P&gt;if ^missing(num) then id+first.num;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Dec 2011 23:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11843#M1481</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2011-12-03T23:02:55Z</dc:date>
    </item>
    <item>
      <title>Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11844#M1482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not only position, but also data type (and length for character variables) will be defined when the retain statement comes first. &lt;/P&gt;&lt;P&gt;When it comes after the SET, these would be inherited from the first ID variable in any of the data sets on the SET statement. &lt;/P&gt;&lt;P&gt;When ID is not in any of the data sets on the SET statement, the only difference is position.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Dec 2011 15:12:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11844#M1482</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-12-04T15:12:21Z</dc:date>
    </item>
    <item>
      <title>Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11845#M1483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No difference in my eye.&lt;/P&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>Mon, 05 Dec 2011 02:43:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11845#M1483</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-12-05T02:43:41Z</dc:date>
    </item>
    <item>
      <title>Generating ID but don't want to have an id for blank value rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11846#M1484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank you for your detailed explanation Peter!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 15:04:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-ID-but-don-t-want-to-have-an-id-for-blank-value-rows/m-p/11846#M1484</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2011-12-05T15:04:51Z</dc:date>
    </item>
  </channel>
</rss>

