<?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: Changing the Format of an Existing Variables Using the FORMAT Statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-Format-of-an-Existing-Variables-Using-the-FORMAT/m-p/871509#M344278</link>
    <description>&lt;P&gt;Maxim 1: Read the Documentation.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1wxb7p9jkxycin16lz2db7idbnt.htm" target="_blank" rel="noopener"&gt;ATTRIB Statement&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n0d5oq7e0oia0wn13nsins0x8nmh.htm" target="_blank" rel="noopener"&gt;FORMAT Statement&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/p0z62k899n6a7wn1r5in6q5253v1.htm" target="_blank" rel="noopener"&gt;Dictionary of Formats&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Apr 2023 07:26:50 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-04-24T07:26:50Z</dc:date>
    <item>
      <title>Changing the Format of an Existing Variables Using the FORMAT Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-Format-of-an-Existing-Variables-Using-the-FORMAT/m-p/871507#M344276</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cls;
attrib name $upcase.   Sex $lowcase. ;
/* format name $upcase.  sex $lowcase.; */
set sashelp.class;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;i want to try name in upcase and sex in lowcase using attrib and format statements&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pls where i did wrong above code&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 07:10:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-Format-of-an-Existing-Variables-Using-the-FORMAT/m-p/871507#M344276</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2023-04-24T07:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the Format of an Existing Variables Using the FORMAT Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-Format-of-an-Existing-Variables-Using-the-FORMAT/m-p/871508#M344277</link>
      <description>&lt;P&gt;You need to specify the Format Attribute the in the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1wxb7p9jkxycin16lz2db7idbnt.htm" target="_self"&gt;Attrib Statement&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I don't think a Lowcase Format exists.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cls;
attrib name format = $upcase.;
set sashelp.class;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 07:20:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-Format-of-an-Existing-Variables-Using-the-FORMAT/m-p/871508#M344277</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2023-04-24T07:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the Format of an Existing Variables Using the FORMAT Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-Format-of-an-Existing-Variables-Using-the-FORMAT/m-p/871509#M344278</link>
      <description>&lt;P&gt;Maxim 1: Read the Documentation.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1wxb7p9jkxycin16lz2db7idbnt.htm" target="_blank" rel="noopener"&gt;ATTRIB Statement&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n0d5oq7e0oia0wn13nsins0x8nmh.htm" target="_blank" rel="noopener"&gt;FORMAT Statement&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/p0z62k899n6a7wn1r5in6q5253v1.htm" target="_blank" rel="noopener"&gt;Dictionary of Formats&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 07:26:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-Format-of-an-Existing-Variables-Using-the-FORMAT/m-p/871509#M344278</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-24T07:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the Format of an Existing Variables Using the FORMAT Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-Format-of-an-Existing-Variables-Using-the-FORMAT/m-p/871533#M344297</link>
      <description>&lt;P&gt;Maybe you were thinking of the &lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/n0rrwqm16uiv4vn1t0jj0jvidgao.htm" target="_self"&gt;LOWCASE function&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;gender=lowcase(sex);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But agreeing with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;, you really should check the documentation on these types of questions before coming here, you will save yourself time in the long run. Help documentation is available by pressing F1 in SAS, or via the Internet.&amp;nbsp;I have published this information before, and I provide it again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/allprodsproc/procedures.htm" target="_self"&gt;Alphabetical list of all SAS PROCs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/allprodslang/syntaxByType-function.htm" target="_self"&gt;Alphabetical list of all SAS functions&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/allprodslang/syntaxByType-statement.htm" target="_self"&gt;Alphabetical list of all SAS statements&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/allprodslang/syntaxByType-format.htm" target="_self"&gt;Alphabetical list of all SAS formats&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/allprodslang/syntaxByType-informat.htm" target="_self"&gt;Alphabetical list of all SAS informats&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 11:40:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-Format-of-an-Existing-Variables-Using-the-FORMAT/m-p/871533#M344297</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-04-24T11:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the Format of an Existing Variables Using the FORMAT Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-Format-of-an-Existing-Variables-Using-the-FORMAT/m-p/871673#M344383</link>
      <description>&lt;P&gt;Might want to look at Proc Datasets and the MODIFY statement to change things like formats, labels or variable names in place. When you use a data step then every record is processed and might result in lots of not needed clock cycles. Proc Datasets modifies the data set in place by changing the data set header information.&lt;/P&gt;
&lt;P&gt;Use of Proc Datasets is also less likely to accidentally add/remove variables or change values.&lt;/P&gt;
&lt;P&gt;Consider a minor typo such as forgetting the E at the end of name:&lt;/P&gt;
&lt;PRE&gt;data cls;
attrib nam format=$upcase. ;
/* format name $upcase.  sex $lowcase.; */
set sashelp.class;
run;&lt;/PRE&gt;
&lt;P&gt;This will add a variable named Nam to the data set.&lt;/P&gt;
&lt;P&gt;Note: I don't find any reference to a LOWCASE format. There is an Upcase but not Lowcase supplied by SAS.&lt;/P&gt;
&lt;P&gt;If your organization has such installed then that's another story.&lt;/P&gt;
&lt;P&gt;You would have to remember that just because the format is applied to a value that you still need to use the base value for referencing the value in code such as: "if name='Alice' then &amp;lt;do something&amp;gt;;"&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 17:20:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-Format-of-an-Existing-Variables-Using-the-FORMAT/m-p/871673#M344383</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-04-24T17:20:39Z</dc:date>
    </item>
  </channel>
</rss>

