<?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: How to edit a format file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837455#M331108</link>
    <description>&lt;P&gt;Thanks Reeza!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Follow-up question - I'm not certain how I should be saving my edited format file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Say I want to save the format file to a new library named out. Should I code as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*create new format;
proc format cntlin=formatDef_added;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*create new format;
proc format library=out cntlin=formatDef_added;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*create new format;
proc format cntlin=out.formatDef_added;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then when I attempt to retrieve my new format file to make certain the updates were added, I'm still seeing the old format file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Output formats to check updates */
proc format library=out cntlout=FormatDef_added;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and the new diagnosis format categories aren't being applied when I run a test:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options obs=max compress=yes fmtsearch=(out);
data test;
input icd_version diagnosis $;
cards;
10 F18280
10 F1927
10 I69169
10 C8376
;
run;
data test;
set test;
if icd_version=9 then elix=put(diagnosis,$RCOM9FMT.);
else if icd_version=10 then elix=put(diagnosis,$RCOM10FMT.);
if elix ne '';
cnt=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 07 Oct 2022 19:17:05 GMT</pubDate>
    <dc:creator>RobertWF1</dc:creator>
    <dc:date>2022-10-07T19:17:05Z</dc:date>
    <item>
      <title>How to edit a format file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837186#M331017</link>
      <description>&lt;P&gt;I'd like to edit an ICD-10 diagnosis category format file by adding new categories.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm running code written by a former coworker and was unable to find the original proc format code that created the format catalog.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, running the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname fmt "D:\Project_Files\395_Matched_Cohort_Study\engaged_performance";
options obs=max compress=yes fmtsearch=(fmt);

proc format library=fmt cntlout=FormatDef;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;outputted a copy of the format dataset FormatDef into my work folder:&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="RobertWF1_1-1665070437766.png" style="width: 521px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75961i07DA8BE4E0D90421/image-dimensions/521x167?v=v2" width="521" height="167" role="button" title="RobertWF1_1-1665070437766.png" alt="RobertWF1_1-1665070437766.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Can I edit this file by adding new lines to the dataset, then save as fmt.FormatDef (or fmt.FormatDef_new)?&amp;nbsp;&lt;/P&gt;
&lt;DIV id="tinyMceEditorRobertWF1_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 15:41:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837186#M331017</guid>
      <dc:creator>RobertWF1</dc:creator>
      <dc:date>2022-10-06T15:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit a format file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837193#M331019</link>
      <description>&lt;P&gt;Yes.&amp;nbsp; But I wouldn't "edit" it.&amp;nbsp; I would make a new version that has changes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT implies that you somehow open the file like a spreadsheet or a Word processor file and type in new things.&amp;nbsp; UPDATE implies a piece of code that you run.&amp;nbsp; For example you might have the new code/decode pairs in another dataset and so the update process will be something like a merge or concatenation of the two datasets.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 15:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837193#M331019</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-06T15:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit a format file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837196#M331022</link>
      <description>&lt;P&gt;Snarky short answer: Yes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The approach I would take would be&amp;nbsp; to extract the format(s) of interest into a new data set to reduce issues.&lt;/P&gt;
&lt;P&gt;You do not describe what changes you need. If you are ADDING new values then you would provide such things as the FMTNAME, Type, as a minimum new Start and Label values. Best would likely be to copy the other variables as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These new values could be done with data step code then appended to the extract for the format data above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would test the format by using Library=work when using that data set with the Cntlin option to create the format. That way you don't overwrite what is currently working until actually ready to. Create a test data set with a combination of values to test some of the old format elements and ALL of the new ones and then display with data step put statements or&amp;nbsp; Proc Print to see if they work as expected.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 16:07:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837196#M331022</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-06T16:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit a format file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837204#M331025</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname fmt "D:\Project_Files\395_Matched_Cohort_Study\engaged_performance";
options obs=max compress=yes fmtsearch=(fmt);

proc format library=fmt cntlout=FormatDef;
run;

*change records;
data formatDef_modified;
set formatDef;
if start=7804 then do;
start=7806;
end=start;
label='New Label';
end;
run;

*add records;
data formatDef_added;
set formatDef_modified newFormats;
run;

*create new format;
proc format cntlin=formatDef_added;
run;

*save fmt for later usage;
data fmt.ICD10fmt_v02;
set formatDef_added;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Probably something along the lines of what I'd do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/408179"&gt;@RobertWF1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'd like to edit an ICD-10 diagnosis category format file by adding new categories.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm running code written by a former coworker and was unable to find the original proc format code that created the format catalog.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, running the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname fmt "D:\Project_Files\395_Matched_Cohort_Study\engaged_performance";
options obs=max compress=yes fmtsearch=(fmt);

proc format library=fmt cntlout=FormatDef;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;outputted a copy of the format dataset FormatDef into my work folder:&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="RobertWF1_1-1665070437766.png" style="width: 521px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75961i07DA8BE4E0D90421/image-dimensions/521x167?v=v2" width="521" height="167" role="button" title="RobertWF1_1-1665070437766.png" alt="RobertWF1_1-1665070437766.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Can I edit this file by adding new lines to the dataset, then save as fmt.FormatDef (or fmt.FormatDef_new)?&amp;nbsp;&lt;/P&gt;
&lt;DIV id="tinyMceEditorRobertWF1_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 16:19:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837204#M331025</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-06T16:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit a format file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837455#M331108</link>
      <description>&lt;P&gt;Thanks Reeza!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Follow-up question - I'm not certain how I should be saving my edited format file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Say I want to save the format file to a new library named out. Should I code as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*create new format;
proc format cntlin=formatDef_added;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*create new format;
proc format library=out cntlin=formatDef_added;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*create new format;
proc format cntlin=out.formatDef_added;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then when I attempt to retrieve my new format file to make certain the updates were added, I'm still seeing the old format file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Output formats to check updates */
proc format library=out cntlout=FormatDef_added;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and the new diagnosis format categories aren't being applied when I run a test:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options obs=max compress=yes fmtsearch=(out);
data test;
input icd_version diagnosis $;
cards;
10 F18280
10 F1927
10 I69169
10 C8376
;
run;
data test;
set test;
if icd_version=9 then elix=put(diagnosis,$RCOM9FMT.);
else if icd_version=10 then elix=put(diagnosis,$RCOM10FMT.);
if elix ne '';
cnt=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Oct 2022 19:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837455#M331108</guid>
      <dc:creator>RobertWF1</dc:creator>
      <dc:date>2022-10-07T19:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit a format file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837457#M331109</link>
      <description>&lt;P&gt;You can have formats with the &lt;STRONG&gt;same name&lt;/STRONG&gt; in &lt;STRONG&gt;different&lt;/STRONG&gt; libraries.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The FMTSEARCH option tells SAS what order to search the libraries.&lt;/P&gt;
&lt;P&gt;Work is default, ahead of your created library.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to specify the formats in your library ahead of work, you need to tell SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example of how that works. Note the default behaviour and how it changes with the different FMTSEARCH options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
*create library to store format catalog;
libname demo '/home/fkhurshed/Demo1';

proc format;
value age_fmt 
  low - 12 = 'Child'
  12-13 = 'Pre-Teen'
  13-16 = 'Teen'
  16-high = 'Young Adult';
run;

proc format lib=demo;
value age_fmt 
  low - 12 = '0 to 12 years old'
  13-15 = '13 to 15 years old'
  16-high = '16+ years old';
run;

title 'Default work library format';
proc print data=sashelp.class;
var age;
format age age_fmt.;
run;

title 'Using format from demo library';
*specify to use the format from the demo library first then check work;
options fmtsearch=(demo work);
proc print data=sashelp.class;
var age;
format age age_fmt.;
run;

title 'Using format from work library';
*specify to use the work library;
options fmtsearch = (work);
proc print data=sashelp.class;
var age;
format age age_fmt.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Oct 2022 20:01:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837457#M331109</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-07T20:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit a format file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837680#M331235</link>
      <description>&lt;P&gt;Thanks Reeza, understood - but what am I doing wrong here when I try to edit an existing format and then save it as a new library catalog? My new format should have 4,448 records but when I output the new format file it only contains 43 records:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Output old formats to work folder */
options fmtsearch=(fmt);
proc format library=fmt cntlout=FormatDef;
run;
/*
NOTE: The data set WORK.FORMATDEF has 3728 observations and 21 variables.
*/

/* Add new format records to new library (fmt2) */
data fmt2.FormatDef_BH;
set FormatDef out.format_new;
run;
/*
NOTE: There were 3728 observations read from the data set WORK.FORMATDEF.
NOTE: There were 720 observations read from the data set OUT.FORMAT_NEW.
NOTE: The data set FMT2.FORMATDEF_BH has 4448 observations and 22 variables.
*/

/* Assign new format library (to prevent stacking old &amp;amp; new formats). */
options fmtsearch=(fmt2);

/* Create new format */
proc format cntlin=fmt2.FormatDef_BH;
run;
/*
24         proc format cntlin=fmt2.FormatDef_BH;
NOTE: Format $RCOM10FMT is already on the library WORK.FORMATS.
NOTE: Format $RCOM10FMT has been output.
NOTE: Format $RCOM9FMT is already on the library WORK.FORMATS.
NOTE: Format $RCOM9FMT has been output.
25         run;

NOTE: PROCEDURE FORMAT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      
NOTE: There were 43 observations read from the data set FMT2.FORMATDEF_BH.
*/

/* Options statement for library with new format */
options fmtsearch=(fmt2);

/* Output formats to check updates */
proc format cntlout=FormatDef_BH;
run;
/*
NOTE: PROCEDURE FORMAT used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds
      
NOTE: The data set WORK.FORMATDEF_BH has 43 observations and 21 variables.
*/&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 15:20:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837680#M331235</guid>
      <dc:creator>RobertWF1</dc:creator>
      <dc:date>2022-10-10T15:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit a format file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837711#M331241</link>
      <description>&lt;P&gt;You seem to have pulled some lines from the SAS log and pasted them into your program.&amp;nbsp; Can you instead show the actual SAS log?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE that&amp;nbsp;If you don't tell PROC FORMAT what catalog to use it will default to WORK.FORMATS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you build&amp;nbsp;FormatDef from FMT.FORMATS catalog.&lt;/P&gt;
&lt;P&gt;You then build the dataset fmt2.FormatDef_BH from that and&amp;nbsp;out.format_new.&lt;/P&gt;
&lt;P&gt;You then try to convert that to catalog entries in WORK.FORMATS catalog.&lt;/P&gt;
&lt;P&gt;It seems to have read only 43 observations instead of all of them.&lt;/P&gt;
&lt;P&gt;Is perhaps the data not sorted properly?&lt;/P&gt;
&lt;P&gt;Add a proc sort step after the concatenation step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 17:14:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837711#M331241</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-10T17:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit a format file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837721#M331247</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Format $RCOM10FMT is already on the library WORK.FORMATS.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You're still creating the formats in the WORK library because the PROC FORMAT doesn't have a lib name as to where you're creating the formats.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I'm not sure I understand why only 43 records are being noted as read....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FMTSEARCH affects the formats when you use them, see the proc print steps in the example.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LIB on the PROC FORMAT controls where the formats are created. With your code you're still creating them in the work library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As Tom said, please post the full log, that's a modified version, perhaps the full log has the data needed to debug the issue. &amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Output old formats to work folder */
options fmtsearch=(fmt);
proc format library=fmt cntlout=FormatDef;
run;


/* Add new format records to new library (fmt2) */
data fmt2.FormatDef_BH;
set FormatDef out.format_new;
run;


/* Assign new format library (to prevent stacking old &amp;amp; new formats). */
options fmtsearch=(fmt2);

/* Create new format */
proc format library =fmt2 cntlin=fmt2.FormatDef_BH;
run;


/* Options statement for library with new format */
options fmtsearch=(fmt2);

/* Output formats to check updates */
proc format library = fmt2 cntlout=FormatDef_BH;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 18:33:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837721#M331247</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-10T18:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit a format file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837724#M331249</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*create library to store format, catalog is formats;
libname demo '/home/fkhurshed/Demo1';

*create format;
proc format lib=work;
value age_fmt 
  low - 12 = 'Child'
  12-13 = 'Pre-Teen'
  13-16 = 'Teen'
  16-18 = 'Young Adult';
run;

*output back to data set;
proc format cntlout=age_fmt_original;
run;

*create a new data set with an adult age group;
data add_adult;
fmtname = 'AGE_FMT';
type = 'N';
start = '18';
end = '99';
label= 'Adult';
output;
run;

*add adult to the age category;
data new_fmt_dset;
set age_fmt_original add_adult;
run;

*create new age format in different library;
proc format lib=demo cntlin=new_fmt_dset;
run;

*output back to verify it;
proc format lib=demo cntlout=age_fmt_new;
select AGE_FMT;
run;

*create sample data set to test application;
data ages;
do age=0 to 45 by 5;
output;
end;
run;

*test application;
options fmtsearch=(work);
proc print data=ages;
format age age_fmt.;
run;

options fmtsearch=(demo work);
proc print data=ages;
format age age_fmt.;
run;



&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is analogous to your example and shows it works. You may need more details to help debug your issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 18:47:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837724#M331249</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-10T18:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit a format file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837990#M331353</link>
      <description>&lt;P&gt;If you'd like the "point and click" ability to edit formats in a catalog, you are welcome to try out this tool (built by my team):&amp;nbsp;&amp;nbsp;&lt;A href="https://docs.datacontroller.io/formats/" target="_blank"&gt;https://docs.datacontroller.io/formats/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It's free for up to 5 users, you can edit formats directly, upload from excel, download in various formats, run filters, and even configure jobs to run after a format is updated.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 08:10:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-edit-a-format-file/m-p/837990#M331353</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2022-10-12T08:10:43Z</dc:date>
    </item>
  </channel>
</rss>

