<?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 Applying a user defined format in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Applying-a-user-defined-format/m-p/695771#M25205</link>
    <description>&lt;P&gt;For my SAS class I have to create a format called "$StateCd" that will apply to the variable StateCd (that I have to rename from State), that will change all the observations named "IOWA" to a 2 character long "IA" . This was my attempt:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC FORMAT LIBRARY= WORK;
VALUE $StateCd
		"IOWA"= "IA";
RUN;

DATA WORK.Contact_IA;
     SET	HypImpt.IowaResidents (RENAME= (State= StateCd));
FORMAT StateCd $StateCd2.;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The format changed all the "IOWA" to "IA" but the length is still 4 like it was before applying the format. This is my first time trying to use a user defined format, what am I doing wrong?&lt;/P&gt;&lt;P&gt;Thank you so much,&lt;/P&gt;&lt;P&gt;Amanda&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 01 Nov 2020 20:24:34 GMT</pubDate>
    <dc:creator>abrice520</dc:creator>
    <dc:date>2020-11-01T20:24:34Z</dc:date>
    <item>
      <title>Applying a user defined format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Applying-a-user-defined-format/m-p/695771#M25205</link>
      <description>&lt;P&gt;For my SAS class I have to create a format called "$StateCd" that will apply to the variable StateCd (that I have to rename from State), that will change all the observations named "IOWA" to a 2 character long "IA" . This was my attempt:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC FORMAT LIBRARY= WORK;
VALUE $StateCd
		"IOWA"= "IA";
RUN;

DATA WORK.Contact_IA;
     SET	HypImpt.IowaResidents (RENAME= (State= StateCd));
FORMAT StateCd $StateCd2.;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The format changed all the "IOWA" to "IA" but the length is still 4 like it was before applying the format. This is my first time trying to use a user defined format, what am I doing wrong?&lt;/P&gt;&lt;P&gt;Thank you so much,&lt;/P&gt;&lt;P&gt;Amanda&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2020 20:24:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Applying-a-user-defined-format/m-p/695771#M25205</guid>
      <dc:creator>abrice520</dc:creator>
      <dc:date>2020-11-01T20:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Applying a user defined format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Applying-a-user-defined-format/m-p/695772#M25206</link>
      <description>&lt;P&gt;A SAS format just applies to how a variable value is displayed. The underlying value stored in the variable is still IOWA hence it remains as 4 characters long.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2020 20:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Applying-a-user-defined-format/m-p/695772#M25206</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-01T20:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Applying a user defined format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Applying-a-user-defined-format/m-p/695779#M25210</link>
      <description>&lt;P&gt;Another way to apply a format is to use it when creating a new variable.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set HypImpt.IowaResidents;
StateCd = put(state, $stateCd2.);
* drop state;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This program assumes that you have already run the PROC FORMAT.&amp;nbsp; Dropping STATE is optional.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2020 20:46:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Applying-a-user-defined-format/m-p/695779#M25210</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-11-01T20:46:30Z</dc:date>
    </item>
  </channel>
</rss>

