<?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 existing format names in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Changing-existing-format-names/m-p/525210#M142891</link>
    <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your help, it worked!&lt;/P&gt;</description>
    <pubDate>Mon, 07 Jan 2019 20:22:24 GMT</pubDate>
    <dc:creator>kmardinian</dc:creator>
    <dc:date>2019-01-07T20:22:24Z</dc:date>
    <item>
      <title>Changing existing format names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-existing-format-names/m-p/525185#M142879</link>
      <description>&lt;P&gt;Hi, I am working with a dataset that already has existing format names added to it. I would like to know if there is a possibility of renaming the format names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, currently the format name is XX_SEG and I would like the format name to only be SEG.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found this information online, but I am not quite sure if it is what I am looking for: &lt;A href="http://support.sas.com/kb/22/189.html" target="_blank"&gt;http://support.sas.com/kb/22/189.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 19:26:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-existing-format-names/m-p/525185#M142879</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2019-01-07T19:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Changing existing format names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-existing-format-names/m-p/525187#M142881</link>
      <description>&lt;P&gt;You can rename a format, but you'll need to assign the new name to the data set&amp;nbsp;as well. It will not update automatically to know the format has changed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc catalog catalog=Formats;
change age_fmt = new_age_fmt (et=format);
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;/*This program demonstrates how a built in SAS format works. 
It uses the WORDS format to display the age as thirteen rather than 13.
It also creates two additional variables, one is numeric and formatted,
the second is a character variable with the same value

Author: F.Khurshed
Date: 2018-03-23
*/


proc format;
value age_fmt
low - 13 = 'Pre Teen'
13 - 16 = 'Teen'
16 - high = 'Adult';
run;


*Create a sample data set;
data class;
set sashelp.class;

*create a variable identical to age, but formatted;
age_numeric_format = age;
format age_numeric_format age_fmt.;

*Recode variable into character rather than use a format;
age_character = put(age, words.);

run;

title 'Demo of Formats';
proc print data=class;
run;

title 'Check formats and type for AGE variables';
proc contents data=class;run;
title;

proc catalog catalog=Formats;
change age_fmt = new_age_fmt (et=format);
run;quit;

title 'Check formats and type for AGE variables';
proc contents data=class;run;
title;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 19:36:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-existing-format-names/m-p/525187#M142881</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-07T19:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Changing existing format names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-existing-format-names/m-p/525196#M142884</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to clarify, I would use the proc catalog statement first and then assign the new name to the dataset? How exactly would I assign the new format name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition, in the proc catalog statement, is "Formats" my original dataset?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 19:55:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-existing-format-names/m-p/525196#M142884</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2019-01-07T19:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Changing existing format names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-existing-format-names/m-p/525198#M142885</link>
      <description>&lt;P&gt;You need to know the catalog name of where you're storing your formats. That part is up to you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data output;
set input;

format var new_age_format.; *apply new format;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could also use PROC DATASETS to modify the format, if the data set is big that's a good idea.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 19:57:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-existing-format-names/m-p/525198#M142885</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-07T19:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Changing existing format names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-existing-format-names/m-p/525210#M142891</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your help, it worked!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 20:22:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-existing-format-names/m-p/525210#M142891</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2019-01-07T20:22:24Z</dc:date>
    </item>
  </channel>
</rss>

