<?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 Saving work.formats to a permanent location in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321848#M271027</link>
    <description>&lt;P&gt;I am currently attempting to save formats that were read in using proc import from a SPSS .sav file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I read the data into a work. library as a temporary dataset. How do I then save these formats for future use in SAS datasets.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 31 Dec 2016 21:03:23 GMT</pubDate>
    <dc:creator>msawdey1231</dc:creator>
    <dc:date>2016-12-31T21:03:23Z</dc:date>
    <item>
      <title>Saving work.formats to a permanent location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321848#M271027</link>
      <description>&lt;P&gt;I am currently attempting to save formats that were read in using proc import from a SPSS .sav file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I read the data into a work. library as a temporary dataset. How do I then save these formats for future use in SAS datasets.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2016 21:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321848#M271027</guid>
      <dc:creator>msawdey1231</dc:creator>
      <dc:date>2016-12-31T21:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Saving work.formats to a permanent location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321852#M271028</link>
      <description>&lt;P&gt;Assume you creadted work.spss_formats as sas dataset.&lt;/P&gt;
&lt;P&gt;I don't know SPSS therefore I don't know what variables you have in that dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyhow you can use:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc format lib=anylib cntlin=&lt;/STRONG&gt;work.spss_formats; run;&lt;/P&gt;
&lt;P&gt;You may need rename variables and add format name variable, before running the proc format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does your spss_formats hold data for one format or more than one ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post a sample of your spss_formats daraset.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2016 21:41:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321852#M271028</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-12-31T21:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Saving work.formats to a permanent location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321855#M271029</link>
      <description>&lt;P&gt;Save the dataset to a permanent library. If you're using SAS UE see the Analytics U forum for many questions on how to save to a permanent library. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2016 23:31:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321855#M271029</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-31T23:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Saving work.formats to a permanent location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321873#M271030</link>
      <description>&lt;P&gt;The spss formats are created and placed into a work.formats catalog when the data is imported using proc import.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ROC IMPORT OUT= WORK.cluster0&lt;BR /&gt;DATAFILE= "C:\Users\micha\Dropbox\1. Dissertation\Paper 2\Data\ACHA-NCHA FALL 2015 REFERENCE GROUP-1R BLIND-SAWDEY.sav"&lt;BR /&gt;DBMS=SPSS REPLACE;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then continued to use the work folder as in this program, there is quite a bit of recoding and checking of recodes happening. Later on in the program, I needed to then take the recoded data set and save it as a permanent to be used at a later time for merging it back with data that we conducted a latent class analysis with in mplus.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem that arises, is, even when saving the data to a permanent dataset, the formats folder is a temp.formats. This is what I cannot overcome&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 17:33:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321873#M271030</guid>
      <dc:creator>msawdey1231</dc:creator>
      <dc:date>2017-01-01T17:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Saving work.formats to a permanent location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321874#M271031</link>
      <description>&lt;P&gt;This is actually&amp;nbsp;exactly what I attempted to do. I needed to data to be saved after recoding so it could be re-merged with data from a secondary analysis that had the same identifier variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The creation of the permanent dataset did not pull the formats over from work.formats. Upon closing out of SAS and then reopening a new SAS program and attempting to call the data, I get errors that the formats were not found or loaded. This is because SAS is holding the original formats from the other program as temp.formats.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 17:36:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321874#M271031</guid>
      <dc:creator>msawdey1231</dc:creator>
      <dc:date>2017-01-01T17:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Saving work.formats to a permanent location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321876#M271032</link>
      <description>Hi:&lt;BR /&gt;  Please read this Tech Support note: &lt;A href="http://support.sas.com/kb/23/007.html" target="_blank"&gt;http://support.sas.com/kb/23/007.html&lt;/A&gt; -- to save your formats from one session to another, you will have to follow the steps outlined in this note.&lt;BR /&gt;&lt;BR /&gt;  Or look at this paper and some of the examples at the end: &lt;A href="http://support.sas.com/resources/papers/proceedings12/048-2012.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings12/048-2012.pdf&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Or, this documentation topic: &lt;A href="http://support.sas.com/documentation/cdl/en/proc/69850/HTML/default/viewer.htm#n1lxb8tukmkz70n1xakolh37h7eq.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/proc/69850/HTML/default/viewer.htm#n1lxb8tukmkz70n1xakolh37h7eq.htm&lt;/A&gt; that shows how to use a permanent format.&lt;BR /&gt; &lt;BR /&gt;cynthia</description>
      <pubDate>Sun, 01 Jan 2017 18:54:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321876#M271032</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-01-01T18:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Saving work.formats to a permanent location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321877#M271033</link>
      <description>&lt;P&gt;Hi Cynthia,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been through both of these to no avail. The resulting libname.format is empty and the original work.formats is still a temp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code I was trying was (Ive tried different variations, but this is what I keep coming back to):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname Perm&amp;nbsp;"C: location";&lt;/P&gt;&lt;P&gt;data &lt;SPAN&gt;Perm&lt;/SPAN&gt;.original_data; set work.data; &amp;nbsp;*/ creating the permanent data set/*;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc FORMAT&amp;nbsp;library= &lt;SPAN&gt;Perm&lt;/SPAN&gt;.original_data;&lt;/P&gt;&lt;P&gt;OPTIONS FMTSEARCH= (work.formats);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 19:27:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321877#M271033</guid>
      <dc:creator>msawdey1231</dc:creator>
      <dc:date>2017-01-01T19:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Saving work.formats to a permanent location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321878#M271034</link>
      <description>&lt;P&gt;You have a catalog and a dataset or a catalog?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use CNTLOUT to generate a dataset instead of a catalog.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What does you log say regardimg your code? Your using the appropriate method, but we don't know how,it's 'not working'.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 19:32:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321878#M271034</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-01T19:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Saving work.formats to a permanent location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321880#M271035</link>
      <description>&lt;P&gt;The dataset and work.formats (catalog) are together. I want to move the catalog to be able to use it from step 7 and on below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe you are saying that the CNTLOUT will create a dataset with the formats permanantly attached? If so, this would work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So from start the finish:&lt;/P&gt;&lt;P&gt;1. Import dataset using proc import from SPSS file into work.datafile (creates data set and work.formats)&lt;/P&gt;&lt;P&gt;2. Recoding and Data management using work.datafile(s)&lt;/P&gt;&lt;P&gt;3. Libname for permanent file (libname)&lt;/P&gt;&lt;P&gt;4. Create permanant file (data libname.datafile; set work.datafile)&lt;/P&gt;&lt;P&gt;5. Proc format code listed above. Using OPTIONS FMTSEARCH&lt;/P&gt;&lt;P&gt;6. Close this program and SAS&lt;/P&gt;&lt;P&gt;7. Run my other analysis in mplus.&lt;/P&gt;&lt;P&gt;8. Open SAS back up and Merge data back from other analysis, import all data&lt;/P&gt;&lt;P&gt;9. Merge with with libname.datafile. Get format error for every variable (All 200+)&amp;nbsp;(e.g.&amp;nbsp;ERROR: The format NQ1A was not found or could not be loaded.)&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 19:48:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321880#M271035</guid>
      <dc:creator>msawdey1231</dc:creator>
      <dc:date>2017-01-01T19:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Saving work.formats to a permanent location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321881#M271036</link>
      <description>&lt;P&gt;The easiest method for storing your &lt;SPAN&gt;user-defined SAS formats is to u&lt;/SPAN&gt;se PROC CATALOG to copy them to the permanent location then use FMTSEARCH to point to PERM:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc catalog catalog = temp.formats;
  copy out = perm.formats;
  run;
quit;

options fmtsearch = (work, library, perm);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 20:12:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321881#M271036</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-01-01T20:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Saving work.formats to a permanent location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321882#M271037</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt; I do not believe you are following the model correctly. For example, what is in WORK.DATA? You are using it to create PERM.ORIGINAL_DATA? Does WORK.DATA contain the information you want to turn into a format?&lt;BR /&gt;&lt;BR /&gt;Second, you are telling PROC FORMAT the the format library is PERM.ORIGINAL_DATA -- typically, you do not specify a dataset as a library location for the format catalog. Next, you specify a FMTSEARCH option for WORK.FORMATS. This is odd because you just tried to create a PERM location as a format catalog.&lt;BR /&gt;&lt;BR /&gt; So I don't think you quite have down yet what needs to happen in what order. Typically you define and create your format catalog FIRST and then you test it and see whether the formats work and finally you re-create your format catalog in a permanent location.&lt;BR /&gt;&lt;BR /&gt;There are 2 ways to make a format catalog and add formats to it:&lt;BR /&gt;1) hard code your format values (and pictures) in PROC FORMAT code or&lt;BR /&gt;2) create your format from a SAS dataset.&lt;BR /&gt;&lt;BR /&gt; I generally recommend mastering #1 before jumping into #2.&lt;BR /&gt;&lt;BR /&gt; To master #1, here is the general order of things.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6549i395DD864C760129E/image-size/original?v=v2&amp;amp;px=-1" alt="format_catalog.png" title="format_catalog.png" border="0" /&gt;&lt;BR /&gt;&lt;BR /&gt; No matter which method you choose, to USE the format, you only need to reference it in a FORMAT statement (or other syntax like a PUT statement) like:&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;format myvar fmtname.;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt; I think it will be hard to master the #2 method and make a permanent format catalog from a dataset if you don't quite understand SAS libraries, data sets and how formats work.&lt;BR /&gt;&lt;BR /&gt; The free Programming 1 class has a discussion of SAS formats and creating user-defined formats. The Programming 2 class shows how to make and use permanent formats.&lt;BR /&gt;&lt;BR /&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 20:24:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321882#M271037</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-01-01T20:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Saving work.formats to a permanent location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321885#M271038</link>
      <description>&lt;P&gt;to answer your first question: Work.data is from an imported SPSS data file. The formats already exist and work in my original program. They were created when importing the data into SAS. They are being placed into the work folder when I am importing them as I do not immediately want to create a SAS datafile. They already exist and they already work in the data set where I import and do my recoding.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to figure out how to MOVE the formats out of the work folder to a permanant locations when I am creating a permanent SAS dataset that is being placed in the same location.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortuantely, while I appreciate the very lengthy response, the formats already exist. I really do not want to hardcode 200+ of them. There has to be another way to accomplish this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If my proc format coding is incorrect, this is what I am asking for help with. I need to move an existing work.formats catalog with work.data to another permanent location.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 20:55:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321885#M271038</guid>
      <dc:creator>msawdey1231</dc:creator>
      <dc:date>2017-01-01T20:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Saving work.formats to a permanent location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321886#M271039</link>
      <description>&lt;P&gt;THIS WORKED&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I allowed me to move the catalog. Then, when opening the second program where I plan to do my analysis I called the libname and did an OPTIONS FTMSEARCH (libname.formats).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very MUCH&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 21:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321886#M271039</guid>
      <dc:creator>msawdey1231</dc:creator>
      <dc:date>2017-01-01T21:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Saving work.formats to a permanent location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321890#M271040</link>
      <description>If you have existing formats and you can see them defined in the WORK.FORMATS temporary catalog, then SASKiwi gave you the correct answer to use PROC CATALOG to perform the copy.&lt;BR /&gt;cynthia</description>
      <pubDate>Sun, 01 Jan 2017 23:52:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321890#M271040</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-01-01T23:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Saving work.formats to a permanent location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321891#M271041</link>
      <description>&lt;P&gt;CNTLOUT creates a dataset with formats defined that you can save to a permanent dataset. It does not permanently attach the formats. This dataset is then used in new programs to create/use formats.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc format cntlout=Perm.MyFormats;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, in new session with perm library assigned&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc format cntin=MyFormats;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*rest of programs go here;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2017 01:00:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-work-formats-to-a-permanent-location/m-p/321891#M271041</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-02T01:00:42Z</dc:date>
    </item>
  </channel>
</rss>

