<?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: Permanent formats not loading using the set statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364334#M86405</link>
    <description>&lt;P&gt;There is code that creates the format(s), and there is code that tries to use them. We need to see both to be able to help.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jun 2017 19:08:19 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-06-05T19:08:19Z</dc:date>
    <item>
      <title>Permanent formats not loading using the set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364326#M86399</link>
      <description>&lt;P&gt;I have an excel data file on a folder on my computer and a sas code that generates and saves a format for that dataset - I saved the sas dataset with formats and the permanent formats to the same location on my computer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I go to import that sas data set using a libname and a set statement, I get an error that the formats "were not found or could not be loaded." All of the formats, excel, and sas dataset is saved to the same folder. I am not sure what I am doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS 9.4.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 18:45:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364326#M86399</guid>
      <dc:creator>Melk</dc:creator>
      <dc:date>2017-06-05T18:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent formats not loading using the set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364327#M86400</link>
      <description>&lt;P&gt;Can you show us your code?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 18:52:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364327#M86400</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-06-05T18:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent formats not loading using the set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364330#M86402</link>
      <description>&lt;P&gt;It is just a set statement with reference to the libname. I think the problem is why isnt it reading in the formats - they are saved under the same libname?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 18:58:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364330#M86402</guid>
      <dc:creator>Melk</dc:creator>
      <dc:date>2017-06-05T18:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent formats not loading using the set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364331#M86403</link>
      <description>&lt;P&gt;Try using PROC IMPORT&amp;nbsp;instead of a simple data step&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 19:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364331#M86403</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-06-05T19:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent formats not loading using the set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364334#M86405</link>
      <description>&lt;P&gt;There is code that creates the format(s), and there is code that tries to use them. We need to see both to be able to help.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 19:08:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364334#M86405</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-06-05T19:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent formats not loading using the set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364337#M86407</link>
      <description>&lt;P&gt;proc format library=work.formats cntlout = lib.formats;&lt;BR /&gt;run;&lt;BR /&gt;proc format library=lib.formats cntlin=lib.formats;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also saved the dataset to the same lib. When I close and open SAS and run a code to just set the sas dataset, the formats dont load automatically (I thought they were supposed to)?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 19:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364337#M86407</guid>
      <dc:creator>Melk</dc:creator>
      <dc:date>2017-06-05T19:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent formats not loading using the set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364340#M86409</link>
      <description>&lt;P&gt;Is the library that you created the formats in, LIB from your code, part of your current FMTSEARCH path?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code will show your current setting for FMTSEARCH (at least in Base SAS);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;proc&lt;/FONT&gt; &lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;options&lt;/FONT&gt; &lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;option&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;=fmtsearch;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;run&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;The result will look like&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;FMTSEARCH=(WORK LIB); if the format library you created is in the path.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;If not you need to execute&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;options fmtsearch=(WORK LIB); or an appropriate version with append or insert.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 19:20:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364340#M86409</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-05T19:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent formats not loading using the set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364344#M86411</link>
      <description>&lt;P&gt;Thanks - my libname was not in the path. This used to work for me as long as I saved the dataset with the formats and used the set statement within the same libnane. Its odd that its not working anymore and I have to specify the format path. Wonder what changed.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 19:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364344#M86411</guid>
      <dc:creator>Melk</dc:creator>
      <dc:date>2017-06-05T19:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent formats not loading using the set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364347#M86412</link>
      <description>&lt;P&gt;Another related question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I specify some more formats but do not save them, and save that updated dataset, when I open SAS again later do I have to rerun the formats? Is there any way to save a dataset with formats permanently?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 19:35:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364347#M86412</guid>
      <dc:creator>Melk</dc:creator>
      <dc:date>2017-06-05T19:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent formats not loading using the set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364348#M86413</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/140721"&gt;@Melk&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks - my libname was not in the path. This used to work for me as long as I saved the dataset with the formats and used the set statement within the same libnane. Its odd that its not working anymore and I have to specify the format path. Wonder what changed.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One of the fun things with perisitent data elements in any environment is how are they kept and changed. You may have set the option at sometime in the past using one of the menus and then run a bit of someone's code that modified options and then when the SAS session closed the options were saved as of the state when closed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use an autoexec.sas program that executes everytime SAS starts to make sure that some of these items are set just in case as well as library assignments and such.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 19:36:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364348#M86413</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-05T19:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent formats not loading using the set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364349#M86414</link>
      <description>&lt;P&gt;Ah interesting. Would be interested in what kinds of steps you find important to run in yout autoexec file if you would not mind sharing.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 19:38:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364349#M86414</guid>
      <dc:creator>Melk</dc:creator>
      <dc:date>2017-06-05T19:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Permanent formats not loading using the set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364358#M86419</link>
      <description>&lt;P&gt;If the formats are in a permanent library AND the FMTSEARCH option references that library AND that library is active for the current session that is all you need. If those three conditions are not met then you need to reexecute the code to&amp;nbsp;create the formats, set the FMTSEARCH option and/or create the library depending which&amp;nbsp;have not been done in the current session.&amp;nbsp;How you get that library active in the session depends on your preferences of using the menus to create a permanent library and set the FMTSEARCH option or code is your choice. Mine as I mentioned has been code in an Autoexec.sas file for more than 20 years.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to tell SAS where that autoexec program file may be varies a bit from installation to installation. The content would look something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;libname Lib "path to the lib location";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options fmtsearch = (work lib);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Formats can be permanently&amp;nbsp;associated with variables in a data step with the FORMAT statement, with Proc Datasets and the Modify statement and some other procedures that create data sets when formats are assigned to variables.&lt;/P&gt;
&lt;P&gt;However that is only the bit that tells SAS to use Format XXX. to display variable YYY. The actual format is stored in a special file type called a Catalog in the format you specify&amp;nbsp;when you&amp;nbsp;create the format. There is an option that tells SAS what to do when it encounters one of these format names not currently found: Options fmterr; will treat a not found format as an error and halt processing or Options NoFmtErr allows code to run but will assume a BEST format for numerics and a $ format for character.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 20:14:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Permanent-formats-not-loading-using-the-set-statement/m-p/364358#M86419</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-05T20:14:20Z</dc:date>
    </item>
  </channel>
</rss>

