<?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: handling trailing blanks when using user-defined formats and informats in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/handling-trailing-blanks-when-using-user-defined-formats-and/m-p/133538#M36259</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My experience with custom formats is the values are compared and for Format purposes 'abcd ' is treated the same as 'abcd'&lt;/P&gt;&lt;P&gt;unless the blank is a more esoteric non-printing character than a simple space or two.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect there is no difference in efficiency. If use the CNTLOUT option to see what is generated there's not any difference unlike ranges of numerics.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 May 2013 20:29:00 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2013-05-10T20:29:00Z</dc:date>
    <item>
      <title>handling trailing blanks when using user-defined formats and informats</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/handling-trailing-blanks-when-using-user-defined-formats-and/m-p/133537#M36258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been using PROC FORMAT to define both formats and informats for use with ICD-9-CM diagnosis codes. The diagnosis codes that I am using are left aligned in 6 character variables with implied decimal points. Since billable codes can range from 3 digits to 5 digits, there is always at least one trailing blank. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1) How does PROC FORMAT handle trailing blanks? When I use a VALUE or INVALUE statement to define a format or informat, must I include the trailing blanks? The following code, for example, shows a format definition that uses 5 characters to map one diagnostic category:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; value $rcomfmt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "39891",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "4280 "-"4289 " = "CHF"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Congestive heart failure */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I assume that this SAS format will match my data where, say, dx1="39891 "? How about where dx1="4281&amp;nbsp; "?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is another VALUE statement using a range:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; value $psychfmt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "2950&amp;nbsp; "-"29595 " = "Schizophrenia"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I assume that this SAS format will match my data where, say, dx1="29500 "?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(2) Is it more efficient to define a format (or informat) with a range or a series of values equaling an output value such as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; invalue ACCPD2D&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* acute bronchitis */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '4660&amp;nbsp; ',&amp;nbsp;&amp;nbsp; /* ACUTE BRONCHITIS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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; '490&amp;nbsp;&amp;nbsp; '&amp;nbsp;&amp;nbsp;&amp;nbsp; /* BRONCHITIS NOS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */ = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; other&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or is this more efficient? (Yes, here it's a format, but in a different program I turned it into an informat because of the way I wanted to use it.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; value $ACCPD2D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '4660&amp;nbsp; ' = 1&amp;nbsp; /* ACUTE BRONCHITIS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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; '490&amp;nbsp;&amp;nbsp; ' = 1&amp;nbsp; /* BRONCHITIS NOS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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; other&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that while my examples have only a few codes per category, my formats/informats can have many codes per category and there are many categories. I'm using the formats or informats as table lookups.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for your ideas! I have spent much too much time hunting through documentation to no avail.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2013 15:46:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/handling-trailing-blanks-when-using-user-defined-formats-and/m-p/133537#M36258</guid>
      <dc:creator>tish</dc:creator>
      <dc:date>2013-05-10T15:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: handling trailing blanks when using user-defined formats and informats</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/handling-trailing-blanks-when-using-user-defined-formats-and/m-p/133538#M36259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My experience with custom formats is the values are compared and for Format purposes 'abcd ' is treated the same as 'abcd'&lt;/P&gt;&lt;P&gt;unless the blank is a more esoteric non-printing character than a simple space or two.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect there is no difference in efficiency. If use the CNTLOUT option to see what is generated there's not any difference unlike ranges of numerics.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2013 20:29:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/handling-trailing-blanks-when-using-user-defined-formats-and/m-p/133538#M36259</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-05-10T20:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: handling trailing blanks when using user-defined formats and informats</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/handling-trailing-blanks-when-using-user-defined-formats-and/m-p/133539#M36260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And Don't forget HashTable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 May 2013 02:33:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/handling-trailing-blanks-when-using-user-defined-formats-and/m-p/133539#M36260</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-05-11T02:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: handling trailing blanks when using user-defined formats and informats</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/handling-trailing-blanks-when-using-user-defined-formats-and/m-p/133540#M36261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This paper is for the R community&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Introducing icd9: working with ICD-9 codes and comorbidities in R. &lt;/P&gt;&lt;P&gt;Jack O. Wasey. &lt;/P&gt;&lt;P&gt;July 21, 2014&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.cran.r-project.org/web/packages/icd9/vignettes/icd9.pdf" title="http://www.cran.r-project.org/web/packages/icd9/vignettes/icd9.pdf"&gt;http://www.cran.r-project.org/web/packages/icd9/vignettes/icd9.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the list of codes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.section111.cms.hhs.gov/MRA/help/ICD9_DX_Codes.txt" title="https://www.section111.cms.hhs.gov/MRA/help/ICD9_DX_Codes.txt"&gt;https://www.section111.cms.hhs.gov/MRA/help/ICD9_DX_Codes.txt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree with ballardw:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;trailing blanks are not going to change the way the format chooses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at the list and search for a $char4. value like 4280&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="https://www.section111.cms.hhs.gov/MRA/help/ICD9_DX_Codes.txt" title="https://www.section111.cms.hhs.gov/MRA/help/ICD9_DX_Codes.txt"&gt;https://www.section111.cms.hhs.gov/MRA/help/ICD9_DX_Codes.txt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your Q is whethere '4280 ' - '4290 ', apparently a $char5. value&lt;/P&gt;&lt;P&gt;is going to return '42810' - '42899',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not think so&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but that is an opinion. &lt;/P&gt;&lt;P&gt;Testing ought to confirm that idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ron Fehd&amp;nbsp; macro maven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 20:30:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/handling-trailing-blanks-when-using-user-defined-formats-and/m-p/133540#M36261</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2014-10-20T20:30:14Z</dc:date>
    </item>
  </channel>
</rss>

