<?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: Trying to apply formats, but for some reason it's not working in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-apply-formats-but-for-some-reason-it-s-not-working/m-p/710900#M218914</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252358"&gt;@Hello_there&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No, it's not the "OR" that confused the compiler, but the ambiguities that arise when quotes around values consisting of multiple words are missing. Just use quotes on both sides of the equals signs and the format will be created correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's good practice to always use quotes around character strings (where appropriate; not talking about macros, of course) although SAS tolerates unquoted strings in some places (for extreme backward compatibility I guess).&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jan 2021 19:10:27 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2021-01-12T19:10:27Z</dc:date>
    <item>
      <title>Trying to apply formats, but for some reason it's not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-apply-formats-but-for-some-reason-it-s-not-working/m-p/710889#M218906</link>
      <description>&lt;P&gt;I'm trying to apply a format to this table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hello_there_0-1610476426727.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53423i44EE9E0F13854FE8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hello_there_0-1610476426727.png" alt="Hello_there_0-1610476426727.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;using this code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;*creating formats;
	value $racex
AMERICAN INDIAN OR ALASKA NATIVE="American Indian or Alaska Native"
ASIAN="Asian"
BLACK OR AFRICAN AMERICAN="Black or African American"
NATIVE HAWAIIAN OR OTHER="Native Hawaiian or Other"
PACIFIC ISLANDER="Pacific Islander"
WHITE="White"
MULTIPLE="Multiple"
MISSING="Missing";
run;
	
data finalrace2;
	length raceX $50.;
	set finalrace;
	racex=put (race, $racex.);
run;
proc print data=finalrace2;
run;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hello_there_1-1610476553999.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53424iDB61B8A6670EC11C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hello_there_1-1610476553999.png" alt="Hello_there_1-1610476553999.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My racex variable looks nothing like the format I created. can anyone point to what I'm doing wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 18:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-apply-formats-but-for-some-reason-it-s-not-working/m-p/710889#M218906</guid>
      <dc:creator>Hello_there</dc:creator>
      <dc:date>2021-01-12T18:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to apply formats, but for some reason it's not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-apply-formats-but-for-some-reason-it-s-not-working/m-p/710890#M218907</link>
      <description>&lt;P&gt;hmmm... after pasting the code and seeing I displayed it looks like the problem is the use of the word OR. That's in the name of the race. Is there anyway to fix it?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 18:37:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-apply-formats-but-for-some-reason-it-s-not-working/m-p/710890#M218907</guid>
      <dc:creator>Hello_there</dc:creator>
      <dc:date>2021-01-12T18:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to apply formats, but for some reason it's not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-apply-formats-but-for-some-reason-it-s-not-working/m-p/710891#M218908</link>
      <description>&lt;P&gt;In PROC FORMAT, there is no "OR" operator, I think you mean&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;*creating formats;
	value $racex
'AMERICAN INDIAN','ALASKA NATIVE'="American Indian or Alaska Native"
'ASIAN'="Asian"
'BLACK','AFRICAN AMERICAN'="Black or African American"
/* etc. */
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Also, the above code is case sensitive, so 'Black" doesn't get formatted. If that's a problem, it's easy to fix via the UPCASE() function in your DATA step.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 18:42:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-apply-formats-but-for-some-reason-it-s-not-working/m-p/710891#M218908</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-12T18:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to apply formats, but for some reason it's not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-apply-formats-but-for-some-reason-it-s-not-working/m-p/710900#M218914</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252358"&gt;@Hello_there&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No, it's not the "OR" that confused the compiler, but the ambiguities that arise when quotes around values consisting of multiple words are missing. Just use quotes on both sides of the equals signs and the format will be created correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's good practice to always use quotes around character strings (where appropriate; not talking about macros, of course) although SAS tolerates unquoted strings in some places (for extreme backward compatibility I guess).&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 19:10:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-apply-formats-but-for-some-reason-it-s-not-working/m-p/710900#M218914</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-01-12T19:10:27Z</dc:date>
    </item>
  </channel>
</rss>

