<?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: How do I create a format for there ranges? &amp;gt; Why does SAS think these ranges overlap? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-create-a-format-for-there-ranges-gt-Why-does-SAS-think/m-p/492513#M72230</link>
    <description>&lt;P&gt;Because you are formatting a character variable, SAS will use lexicographic ordering&amp;nbsp; (i.e. like in a dictionary, comparing first characters, then second characters, etc).&amp;nbsp; Therefore you can have, where the outer values are 'NPI' and the middle value is 'TIN'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token string"&gt;'000000001'&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;lt; &lt;SPAN class="token string"&gt;'1000000000' &amp;lt; '1999999999'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token string"&gt;Now if the TIN values another leading zero, you could use: &lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
      value  $PRV_ID 	        'H0000000' - 'H9999999' = 'Hospital'
						'A0000000' - 'A9999999' = 'A...'
						'P0000000' - 'P9999999' = 'P...'
						'Q0000000' - 'Q9999999' = 'Q...'
						'1000000000' - '1999999999' = 'NPI'
						'0000000001' - '0999999999'  = 'TIN'
             			                Other='?';
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;would work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token string"&gt;&lt;SPAN class="token procnames"&gt;If your actual values for TIN are 9-characters, instead of 10 as I use in the value statement, you could catch and modify those X values, and then successfully use this format. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Sep 2018 01:07:57 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2018-09-05T01:07:57Z</dc:date>
    <item>
      <title>How do I create a format for there ranges? &gt; Why does SAS think these ranges overlap?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-create-a-format-for-there-ranges-gt-Why-does-SAS-think/m-p/492512#M72229</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   proc format;
      value  $PRV_ID 	        'H0000000' - 'H9999999' = 'Hospital'
						'A0000000' - 'A9999999' = 'A...'
						'P0000000' - 'P9999999' = 'P...'
						'Q0000000' - 'Q9999999' = 'Q...'
						'1000000000' - '1999999999' = 'NPI'
						'000000001' -  '999999999'  = 'TIN'
             			                Other='?';
   run;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;24 proc format;&lt;BR /&gt;25 value $PRV_ID 'H0000000' - 'H9999999' = 'Hospital'&lt;BR /&gt;26 'A0000000' - 'A9999999' = 'A...'&lt;BR /&gt;27 'P0000000' - 'P9999999' = 'P...'&lt;BR /&gt;28 'Q0000000' - 'Q9999999' = 'Q...'&lt;BR /&gt;29 '1000000000' - '1999999999' = 'NPI'&lt;BR /&gt;30 '000000001' - '999999999' = 'TIN'&lt;BR /&gt;31 Other='?';&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;ERROR&lt;/FONT&gt;: These two ranges overlap: 000000001-999999999 and 1000000000-1999999999 (fuzz=0).&lt;/STRONG&gt;&lt;BR /&gt;NOTE: The previous statement has been deleted.&lt;BR /&gt;32 run;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 05 Sep 2018 00:50:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-create-a-format-for-there-ranges-gt-Why-does-SAS-think/m-p/492512#M72229</guid>
      <dc:creator>mohassan99</dc:creator>
      <dc:date>2018-09-05T00:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a format for there ranges? &gt; Why does SAS think these ranges overlap?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-create-a-format-for-there-ranges-gt-Why-does-SAS-think/m-p/492513#M72230</link>
      <description>&lt;P&gt;Because you are formatting a character variable, SAS will use lexicographic ordering&amp;nbsp; (i.e. like in a dictionary, comparing first characters, then second characters, etc).&amp;nbsp; Therefore you can have, where the outer values are 'NPI' and the middle value is 'TIN'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token string"&gt;'000000001'&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;lt; &lt;SPAN class="token string"&gt;'1000000000' &amp;lt; '1999999999'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token string"&gt;Now if the TIN values another leading zero, you could use: &lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
      value  $PRV_ID 	        'H0000000' - 'H9999999' = 'Hospital'
						'A0000000' - 'A9999999' = 'A...'
						'P0000000' - 'P9999999' = 'P...'
						'Q0000000' - 'Q9999999' = 'Q...'
						'1000000000' - '1999999999' = 'NPI'
						'0000000001' - '0999999999'  = 'TIN'
             			                Other='?';
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;would work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token string"&gt;&lt;SPAN class="token procnames"&gt;If your actual values for TIN are 9-characters, instead of 10 as I use in the value statement, you could catch and modify those X values, and then successfully use this format. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Sep 2018 01:07:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-create-a-format-for-there-ranges-gt-Why-does-SAS-think/m-p/492513#M72230</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-09-05T01:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a format for there ranges? &gt; Why does SAS think these ranges overlap?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-create-a-format-for-there-ranges-gt-Why-does-SAS-think/m-p/492721#M72238</link>
      <description>&lt;P&gt;You may want to double check the logic of the format in general. Ranges of character values often do not behave as expected.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
      value  $PRV_ID
'H0000000' - 'H9999999' = 'Hospital'
'A0000000' - 'A9999999' = 'A...'
'P0000000' - 'P9999999' = 'P...'
'Q0000000' - 'Q9999999' = 'Q...'
'1000000000' - '1999999999' = 'NPI'
/*'000000001' -  '999999999'  = 'TIN'*/
Other='?';
run;

data junk;
x='H0A';
put x $prv_id.;
run;&lt;/PRE&gt;
&lt;P&gt;Has this result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;39
40   data junk;
41   x='H0A';
42   put x $prv_id.;
43   run;

Hospital
&lt;/PRE&gt;
&lt;P&gt;Do you want a value of H0A to have the formatted value of Hospital?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This may be one of those times that you need to generate a data set with the explicit known values and use them to create a CNTLIN dataset.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Sep 2018 16:23:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-create-a-format-for-there-ranges-gt-Why-does-SAS-think/m-p/492721#M72238</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-09-05T16:23:33Z</dc:date>
    </item>
  </channel>
</rss>

