<?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: Copy a format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/230787#M41912</link>
    <description>&lt;P&gt;You can use PROC CATALOG to manipulate existing formats. There does not appear to be a command to copy an entry to a new name in the same catalog. &amp;nbsp;I would suggest copying it to dummy catalog in the WORK library, using the CHANGE command to rename it and then copy it back.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could just use PROC FORMAT with the CNTLOUT= option to output the definition to a data set, edit the FMTNAME variable in the dataset and then use PROC FORMAT with the CNTLIN= option to define the new format. &amp;nbsp;Not sure if this will work for picture or other more complex formats.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Oct 2015 16:59:17 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2015-10-20T16:59:17Z</dc:date>
    <item>
      <title>Copy a format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/230698#M41881</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i'm a novice on SAS Formats.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to copy a format to a backup one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;something like formata = formatb;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didnt find it on google. Only one i found was to copy inside a catalog. But i didn't know the catalog name of the format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any easy way? please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thx Jan&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 10:31:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/230698#M41881</guid>
      <dc:creator>Jan_Schebeko</dc:creator>
      <dc:date>2015-10-20T10:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Copy a format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/230706#M41883</link>
      <description>&lt;P&gt;I'm not really sure I understand the concept of copying a format to a backup.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if I do understand this, here is the method I use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I create permanent formats, and then store them on a drive that is automatically backed up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, for example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname fmtlib "\\myserver\mydrive\myfolder";
proc format library=fmtlib;
value yn 0='No' 1='Yes';
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then the commands&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname fmtlib "\\myserver\mydrive\myfolder";&lt;BR /&gt;
options fmtsearch=(fmtlib);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;allows the formats in fmtlib (all of them if there are more than one, not just the one format I named YN) to be available to be used in your SAS program.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 12:20:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/230706#M41883</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-10-20T12:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Copy a format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/230759#M41901</link>
      <description>&lt;P&gt;I've never had a need to do this but if you are using base SAS and don't need to do this for a lot of formats you can open the format catalog in the library of interes using the SAS explorer window and copy/paste.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since there isn't much a way to edit a format within a catalog I almost have to believe that you are "experimenting" with creating a variation on the existing format. In which case you might be better off to make sure you have the source code saved somewhere safe to recreate the format as needed.&lt;/P&gt;
&lt;P&gt;Or put the new formata into a different library and have that library appear first in the FMTSEARCH path.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 14:53:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/230759#M41901</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-10-20T14:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Copy a format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/230761#M41903</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I've never had a need to do this but if you are using base SAS and don't need to do this for a lot of formats you can open the format catalog in the library of interes using the SAS explorer window and copy/paste.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since there isn't much a way to edit a format within a catalog I almost have to believe that you are "experimenting" with creating a variation on the existing format. In which case you might be better off to make sure you have the source code saved somewhere safe to recreate the format as needed.&lt;/P&gt;
&lt;P&gt;Or put the new formata into a different library and have that library appear first in the FMTSEARCH path.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, if I am creating a permanent format, I always save the source code. &lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 14:55:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/230761#M41903</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-10-20T14:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Copy a format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/230781#M41911</link>
      <description>&lt;P&gt;Hi.&amp;nbsp; Formats are stored in CATALOGS.&amp;nbsp;Numeric formats have an ENTRYTYPE (ET) of FORMAT, while character formats are FORMATC.&amp;nbsp; Here's an example that makes a few formats, copies two of them to a different catalog, then displays the contents of the two format catalogs ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;libname x 'z:\';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;proc format lib=z.formats;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;value abc&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;1 = 'one'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;2 = 'two'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;value $abc&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;'one' = '1'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;'two' = '2'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;value notcopied&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;1 = '99'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;2 = '88'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;libname y 'e:\';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;proc catalog cat=z.formats;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;copy out=y.formats;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;select abc / et=format;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;select abc / et=formatc;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;proc catalog cat=z.formats;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;contents;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;proc catalog cat=y.formats;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;contents;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Contents of Catalog Z.FORMATS&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp; Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Modified Date&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; ABC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FORMAT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/20/2015 12:31:46&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/20/2015 12:31:46&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp; NOTCOPIED&amp;nbsp;&amp;nbsp;&amp;nbsp; FORMAT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/20/2015 12:31:46&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/20/2015 12:31:46&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp; ABC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FORMATC&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/20/2015 12:31:46&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/20/2015 12:31:46&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Contents of Catalog Y.FORMATS&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp; Name&amp;nbsp;&amp;nbsp;&amp;nbsp; Type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Modified Date&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; ABC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FORMAT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/20/2015 12:31:46&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/20/2015 12:31:46&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp; ABC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FORMATC&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/20/2015 12:31:46&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/20/2015 12:31:46&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 16:36:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/230781#M41911</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2015-10-20T16:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Copy a format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/230787#M41912</link>
      <description>&lt;P&gt;You can use PROC CATALOG to manipulate existing formats. There does not appear to be a command to copy an entry to a new name in the same catalog. &amp;nbsp;I would suggest copying it to dummy catalog in the WORK library, using the CHANGE command to rename it and then copy it back.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could just use PROC FORMAT with the CNTLOUT= option to output the definition to a data set, edit the FMTNAME variable in the dataset and then use PROC FORMAT with the CNTLIN= option to define the new format. &amp;nbsp;Not sure if this will work for picture or other more complex formats.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 16:59:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/230787#M41912</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-10-20T16:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Copy a format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/230797#M41915</link>
      <description>&lt;P&gt;I'm still curious (as I was at the beginning of this thread) why anyone would want to make a copy of a format and store it somewhere else. WIth the code I provided, a user only needs one such catalog with a format, and this can be used in every program that the user writes; and if it is on a shared disk, then every user with access to the shared disk can use this format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, here at my company (and I'm quite sure at all companies), the files (including this catalog) are backed up regularly, why would you need multiple copies of a format (other than the automatic backup)?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 18:21:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/230797#M41915</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-10-20T18:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: Copy a format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/235266#M43070</link>
      <description>&lt;P&gt;The problem was that the format is overwritten on using the macro that generate it, more the one times. So anyway... I have solve this simple, by find out to write the results that contains a column where not the &amp;nbsp;value with formats is sorted, then the value of the format is stored and can be printed on the end. Thanks for take part on this request.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 15:30:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/235266#M43070</guid>
      <dc:creator>Jan_Schebeko</dc:creator>
      <dc:date>2015-11-18T15:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Copy a format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/804860#M316978</link>
      <description>&lt;P&gt;It works! Thank you for sharing!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 18:36:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Copy-a-format/m-p/804860#M316978</guid>
      <dc:creator>FGao</dc:creator>
      <dc:date>2022-03-29T18:36:41Z</dc:date>
    </item>
  </channel>
</rss>

