<?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 determining length count for observations within the same variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/determining-length-count-for-observations-within-the-same/m-p/32546#M7842</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Haikuo-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One quick follow-up question, how do I do this step without using the input statement?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to use a dataset currently located in my work library.&amp;nbsp; According to proc contents for this dataset, the subject id has the variable listed as numeric with 6 as the length (though I know there are subject ids with up to 9 numbers).&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sure this is a very simple SAS 101 question. I just can't seem to get my head around it.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Mar 2012 13:57:06 GMT</pubDate>
    <dc:creator>sophia_SAS</dc:creator>
    <dc:date>2012-03-15T13:57:06Z</dc:date>
    <item>
      <title>determining length count for observations within the same variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/determining-length-count-for-observations-within-the-same/m-p/32544#M7840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS Community-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using a large dataset, there is the numeric variable -&amp;nbsp; 'SubjectID'.&amp;nbsp; Within 'SubjectID' the observations including a number of different lengths.&amp;nbsp; For example some SubjectID observations have 6 numbers while others have 7 or 8 numbers.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SubjectID&lt;/P&gt;&lt;P&gt;234583&lt;/P&gt;&lt;P&gt;5546492&lt;/P&gt;&lt;P&gt;5546489&lt;/P&gt;&lt;P&gt;234577&lt;/P&gt;&lt;P&gt;68907734&lt;/P&gt;&lt;P&gt;68907736&lt;/P&gt;&lt;P&gt;234581&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise on a SAS function that will inform me on how many Subject IDs have 6 for a number length, 7th for a number length and 8 for a number length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eventually, I will use this information to for a substring.&lt;BR /&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 12:35:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/determining-length-count-for-observations-within-the-same/m-p/32544#M7840</guid>
      <dc:creator>sophia_SAS</dc:creator>
      <dc:date>2012-03-15T12:35:35Z</dc:date>
    </item>
    <item>
      <title>determining length count for observations within the same variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/determining-length-count-for-observations-within-the-same/m-p/32545#M7841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hope this will get you started:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input SubjectID $8.;&lt;/P&gt;&lt;P&gt;len=length(subjectid);&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;234583&lt;/P&gt;&lt;P&gt;5546492&lt;/P&gt;&lt;P&gt;5546489&lt;/P&gt;&lt;P&gt;234577&lt;/P&gt;&lt;P&gt;68907734&lt;/P&gt;&lt;P&gt;68907736&lt;/P&gt;&lt;P&gt;234581&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=have;&lt;/P&gt;&lt;P&gt;table len;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 12:41:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/determining-length-count-for-observations-within-the-same/m-p/32545#M7841</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-03-15T12:41:15Z</dc:date>
    </item>
    <item>
      <title>determining length count for observations within the same variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/determining-length-count-for-observations-within-the-same/m-p/32546#M7842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Haikuo-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One quick follow-up question, how do I do this step without using the input statement?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to use a dataset currently located in my work library.&amp;nbsp; According to proc contents for this dataset, the subject id has the variable listed as numeric with 6 as the length (though I know there are subject ids with up to 9 numbers).&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sure this is a very simple SAS 101 question. I just can't seem to get my head around it.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 13:57:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/determining-length-count-for-observations-within-the-same/m-p/32546#M7842</guid>
      <dc:creator>sophia_SAS</dc:creator>
      <dc:date>2012-03-15T13:57:06Z</dc:date>
    </item>
    <item>
      <title>determining length count for observations within the same variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/determining-length-count-for-observations-within-the-same/m-p/32547#M7843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope the following will help you with your problem:&lt;/P&gt;&lt;P&gt;/*This to input the numberic value*/&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input SubjectID ;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;234583&lt;/P&gt;&lt;P&gt;5546492&lt;/P&gt;&lt;P&gt;5546489&lt;/P&gt;&lt;P&gt;234577&lt;/P&gt;&lt;P&gt;68907734&lt;/P&gt;&lt;P&gt;68907736&lt;/P&gt;&lt;P&gt;234581&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;len=length(strip(subjectid));&lt;/P&gt;&lt;P&gt; /*This to get the occupied length*/&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=want;&lt;/P&gt;&lt;P&gt;table len;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 14:08:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/determining-length-count-for-observations-within-the-same/m-p/32547#M7843</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-03-15T14:08:02Z</dc:date>
    </item>
    <item>
      <title>determining length count for observations within the same variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/determining-length-count-for-observations-within-the-same/m-p/32548#M7844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; If the values are numeric the length refers to the number of bytes used to store the value. The range for length of numerics is 3 to 8. This might do what you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data len;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set &amp;lt;your dataset&amp;gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; len = length (put(SubjectId,f10.0));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq;&lt;/P&gt;&lt;P&gt;table len;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 14:12:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/determining-length-count-for-observations-within-the-same/m-p/32548#M7844</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-03-15T14:12:36Z</dc:date>
    </item>
  </channel>
</rss>

