<?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 PROC FORMAT - &amp;quot;ABCD&amp;quot; vs &amp;quot;AB&amp;quot; - Can SAS tell the difference or do I need to add spaces? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT-quot-ABCD-quot-vs-quot-AB-quot-Can-SAS-tell-the/m-p/609397#M76711</link>
    <description>&lt;P&gt;Good Morning!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using formats extensively within my project to assign values/descriptions to codes within variables.&amp;nbsp; My question specifically is if I need to add spaces on the left side of the format definitions so SAS identifies the correct code, or if that is not necessary?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i.e. Will SAS format this correctly:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"A"&amp;nbsp; =&amp;nbsp; "Something"&lt;/P&gt;&lt;P&gt;"ABC"&amp;nbsp; =&amp;nbsp; "Something Else"&lt;/P&gt;&lt;P&gt;"ABCD01"&amp;nbsp; =&amp;nbsp; "The Other Thing"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or do I need to add spaces:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;nbsp; =&amp;nbsp; "Something"&lt;/P&gt;&lt;P&gt;"ABC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;nbsp; =&amp;nbsp; "Something Else"&lt;/P&gt;&lt;P&gt;"ABCD01"&amp;nbsp; =&amp;nbsp; "The Other Thing"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ETA:&amp;nbsp; I am using these formats to create new variables after importing the raw data files with a PUT statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PUT(raw_data_codes, $my_format.) AS NEW_VARIABLE ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help!&amp;nbsp; Much Appreciated!&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2019 14:44:39 GMT</pubDate>
    <dc:creator>GBL__</dc:creator>
    <dc:date>2019-12-04T14:44:39Z</dc:date>
    <item>
      <title>PROC FORMAT - "ABCD" vs "AB" - Can SAS tell the difference or do I need to add spaces?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT-quot-ABCD-quot-vs-quot-AB-quot-Can-SAS-tell-the/m-p/609397#M76711</link>
      <description>&lt;P&gt;Good Morning!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using formats extensively within my project to assign values/descriptions to codes within variables.&amp;nbsp; My question specifically is if I need to add spaces on the left side of the format definitions so SAS identifies the correct code, or if that is not necessary?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i.e. Will SAS format this correctly:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"A"&amp;nbsp; =&amp;nbsp; "Something"&lt;/P&gt;&lt;P&gt;"ABC"&amp;nbsp; =&amp;nbsp; "Something Else"&lt;/P&gt;&lt;P&gt;"ABCD01"&amp;nbsp; =&amp;nbsp; "The Other Thing"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or do I need to add spaces:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;nbsp; =&amp;nbsp; "Something"&lt;/P&gt;&lt;P&gt;"ABC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;nbsp; =&amp;nbsp; "Something Else"&lt;/P&gt;&lt;P&gt;"ABCD01"&amp;nbsp; =&amp;nbsp; "The Other Thing"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ETA:&amp;nbsp; I am using these formats to create new variables after importing the raw data files with a PUT statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PUT(raw_data_codes, $my_format.) AS NEW_VARIABLE ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help!&amp;nbsp; Much Appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 14:44:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT-quot-ABCD-quot-vs-quot-AB-quot-Can-SAS-tell-the/m-p/609397#M76711</guid>
      <dc:creator>GBL__</dc:creator>
      <dc:date>2019-12-04T14:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FORMAT - "ABCD" vs "AB" - Can SAS tell the difference or do I need to a</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT-quot-ABCD-quot-vs-quot-AB-quot-Can-SAS-tell-the/m-p/609398#M76712</link>
      <description>&lt;P&gt;The characters that are looked for in the data are exact matches, they do not need to be the same length. Have you tried running this will code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example you could run for proof:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
 value $myfmt "A"   =  "Something"
              "ABC" =  "Something Else"
            "ABCD01"=  "The Other Thing";
run;
&lt;BR /&gt;data have;&lt;BR /&gt;   length var $10;&lt;BR /&gt;   var='A';output;&lt;BR /&gt;   var='ABCD01';output;&lt;BR /&gt;   var='AB';output;&lt;BR /&gt;run;&lt;BR /&gt;
data want;
 set have;
 new_var=put(var, $myfmt.);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and the output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 14:50:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT-quot-ABCD-quot-vs-quot-AB-quot-Can-SAS-tell-the/m-p/609398#M76712</guid>
      <dc:creator>Lucy1</dc:creator>
      <dc:date>2019-12-04T14:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FORMAT - "ABCD" vs "AB" - Can SAS tell the difference or do I need to a</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT-quot-ABCD-quot-vs-quot-AB-quot-Can-SAS-tell-the/m-p/609399#M76713</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/268542"&gt;@GBL__&lt;/a&gt;&amp;nbsp; &amp;nbsp;I'd think both forms are equivalent as trailing blanks do not matter, rather the problem is leading blank. So when assigning a format label using put function, it's always a good idea to use put(key,label. -l)&amp;nbsp; Left align so that we present no scope of an occurrence of a leading blank&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 14:50:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT-quot-ABCD-quot-vs-quot-AB-quot-Can-SAS-tell-the/m-p/609399#M76713</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-04T14:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FORMAT - "ABCD" vs "AB" - Can SAS tell the difference or do I need to a</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT-quot-ABCD-quot-vs-quot-AB-quot-Can-SAS-tell-the/m-p/609402#M76714</link>
      <description>This is great! Thank you for your reply, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/85106"&gt;@Lucy1&lt;/a&gt;</description>
      <pubDate>Wed, 04 Dec 2019 14:58:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT-quot-ABCD-quot-vs-quot-AB-quot-Can-SAS-tell-the/m-p/609402#M76714</guid>
      <dc:creator>GBL__</dc:creator>
      <dc:date>2019-12-04T14:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FORMAT - "ABCD" vs "AB" - Can SAS tell the difference or do I need to a</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT-quot-ABCD-quot-vs-quot-AB-quot-Can-SAS-tell-the/m-p/609404#M76715</link>
      <description>Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt; ! I did not remember about the alignment overrides. Much Appreciated!</description>
      <pubDate>Wed, 04 Dec 2019 15:01:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FORMAT-quot-ABCD-quot-vs-quot-AB-quot-Can-SAS-tell-the/m-p/609404#M76715</guid>
      <dc:creator>GBL__</dc:creator>
      <dc:date>2019-12-04T15:01:14Z</dc:date>
    </item>
  </channel>
</rss>

