<?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: PROC FORMAT in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT/m-p/509348#M72935</link>
    <description>&lt;P&gt;I do not believe what you have will work with the sample data you have provided.&lt;/P&gt;&lt;P&gt;You may have to list each stringed value.&lt;/P&gt;&lt;P&gt;here is a nice link to formatting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi27/p056-27.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi27/p056-27.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 31 Oct 2018 21:20:08 GMT</pubDate>
    <dc:creator>VDD</dc:creator>
    <dc:date>2018-10-31T21:20:08Z</dc:date>
    <item>
      <title>PROC FORMAT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT/m-p/509340#M72933</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to use proc format on the values below. Example:&amp;nbsp; 1.0-1.9 is 'Pre-functional'. I have to format them as character due to other values such as P1,P2, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;will this work?&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc format;&lt;/P&gt;
&lt;P&gt;value $ engproffmt&lt;/P&gt;
&lt;P&gt;'1.0 - &amp;lt; 1.9' = 'Pre-functional';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="752"&gt;
&lt;P&gt;1.0-1.9&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="752"&gt;
&lt;P&gt;2.0-2.9&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="752"&gt;
&lt;P&gt;3.0-3.9&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="752"&gt;
&lt;P&gt;4.0-4.9&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="752"&gt;
&lt;P&gt;5.0-5.9&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="752"&gt;
&lt;P&gt;6.0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="752"&gt;
&lt;P&gt;P1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="752"&gt;
&lt;P&gt;P2&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="752"&gt;
&lt;P&gt;P3&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="752"&gt;
&lt;P&gt;P4&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="752"&gt;
&lt;P&gt;8&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="752"&gt;
&lt;P&gt;9&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="752"&gt;
&lt;P&gt;W&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="752"&gt;
&lt;P&gt;X&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Wed, 31 Oct 2018 21:10:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT/m-p/509340#M72933</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2018-10-31T21:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FORMAT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT/m-p/509347#M72934</link>
      <description>&lt;P&gt;Programming ranges within a character format is tricky and prone to error.&amp;nbsp; As a general rule, avoid it whenever possible.&amp;nbsp; For this limited case, you could use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;value $engproffmt&lt;/P&gt;
&lt;P&gt;'1.0' - '1.9' = 'Pre-functional'&lt;/P&gt;
&lt;P&gt;'2.0' - '2.9' = 'Next level description';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 21:18:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT/m-p/509347#M72934</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-10-31T21:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FORMAT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT/m-p/509348#M72935</link>
      <description>&lt;P&gt;I do not believe what you have will work with the sample data you have provided.&lt;/P&gt;&lt;P&gt;You may have to list each stringed value.&lt;/P&gt;&lt;P&gt;here is a nice link to formatting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi27/p056-27.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi27/p056-27.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 21:20:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT/m-p/509348#M72935</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-10-31T21:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FORMAT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT/m-p/509358#M72936</link>
      <description>&lt;P&gt;You may want to run this code and see if the formatted values match what you would expect with your data.&lt;/P&gt;
&lt;P&gt;Normally in a numeric&amp;nbsp;format the -&amp;lt;&amp;nbsp; means "up to but not including" so 1.9999 would be "pre-functional" and 2 would be "something else". Note that characters use the active sort sequence (ASCII or EBCDIC depending on environment) and does a character-by-character left-to-right comparison for range membership. Some things may not quite what you expect such as values of 1 and 2 (note no decimal present)&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
value $ engproffmt
'1.0' -&amp;lt; '2.0' = 'Pre-functional'
'2.0' -&amp;lt; '2.9' = 'Something else'
'3.0' -&amp;lt; '3.9' = 'YadaYada'
;
run;
data example;
   input x $;&lt;BR /&gt;   /* so you can see the unformatted value&lt;BR /&gt;    in proc print below*/&lt;BR /&gt;   y=x;
datalines;
1.0
1.01
1.1
1
1.A
10
1.9
1.90
1.93
2
2.
2.0
;
run;
proc print data=example;
   format x $engproffmt.;
run;

 
&lt;/PRE&gt;
&lt;P&gt;Explicit values may be better if known.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 21:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT/m-p/509358#M72936</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-31T21:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FORMAT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT/m-p/509373#M72937</link>
      <description>Is your input data mixed format? If so, I suspect some IF THEN statements are likely more efficient and less error prone. Create a generic else to catch issues though. Use ANYALPHA or NOTDIGIT to test if a value is all numeric.</description>
      <pubDate>Wed, 31 Oct 2018 23:34:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT/m-p/509373#M72937</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-31T23:34:39Z</dc:date>
    </item>
  </channel>
</rss>

