<?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: Find definition of user defined format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788753#M252276</link>
    <description>&lt;P&gt;Only if they either sent you the code for creating the user-defined format or the SAS catalog containing it. You can use the SAS catalog to reverse engineer the code that created the format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just be clear that SAS datasets do not store&amp;nbsp;SAS format definitions.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jan 2022 23:36:59 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2022-01-06T23:36:59Z</dc:date>
    <item>
      <title>Find definition of user defined format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788752#M252275</link>
      <description>Hello&lt;BR /&gt;Let's say that someone send me a data set that is saved in a permanent  library.&lt;BR /&gt;Let's say that I run proc sql on that data set and there is a field with user defined format .&lt;BR /&gt;Is it possible to find out what is  the full definition  of this user defined format ?&lt;BR /&gt;Please  note that it might happen that some of the format values in proc format are not in the data set but I still want to know what is the full definition  of this proc format ?&lt;BR /&gt;( in a case that the person who create this user defined format is not available  and cannot as him )&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Jan 2022 23:28:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788752#M252275</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-01-06T23:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Find definition of user defined format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788753#M252276</link>
      <description>&lt;P&gt;Only if they either sent you the code for creating the user-defined format or the SAS catalog containing it. You can use the SAS catalog to reverse engineer the code that created the format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just be clear that SAS datasets do not store&amp;nbsp;SAS format definitions.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 23:36:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788753#M252276</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-01-06T23:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Find definition of user defined format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788754#M252277</link>
      <description>Let's say that the  guy who created the data set didn't  sebd me the code of user defined  format. &lt;BR /&gt;How can I check if the  catalog containing it?&lt;BR /&gt;May you please  show code for it?&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Jan 2022 23:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788754#M252277</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-01-06T23:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Find definition of user defined format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788757#M252278</link>
      <description>&lt;P&gt;You can use PROC FORMAT to check if there are formats in a SAS catalog:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format library = MyLib.MyCatalog FMTLIB;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here is another &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p1swd5d7lnugzgn1rv7pgzkjav4w.htm#p1swd5d7lnugzgn1rv7pgzkjav4w" target="_blank" rel="noopener"&gt;example&lt;/A&gt; from the documentation.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 23:52:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788757#M252278</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-01-06T23:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Find definition of user defined format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788758#M252279</link>
      <description>&lt;P&gt;If you think the library has formats (I'd bet against it if related to your previous question) you can use the following to have all formats outputed to a SAS data set with their defintions. If you're not familiar with CNTLIN/CNTLOUT data sets you may to read up on formats.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Change demo to the permanent library where the file is stored to check if the format exists.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format library=demo cntlout=check;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Let's say that the guy who created the data set didn't sebd me the code of user defined format. &lt;BR /&gt;How can I check if the catalog containing it?&lt;BR /&gt;May you please show code for it?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*create a libname reference;
libname demo '/home/fkhurshed/Demo1';

*create a format in the library;
proc format library=demo;
value age_fmt 
0 - 9 = 'Child'
10-12 = 'Pre-Teen'
13-19 = 'Teenager'
19-high = 'Adult';
run;

*Tell SAS to use this library for formats;
OPTIONS FMTSEARCH = ( demo );

*check that it works;
proc print data=sashelp.class;
format age age_fmt.;
run;

*output the format back to a dataset called check;
proc format library=demo cntlout=check;
run;

*print out format definition ;
proc print data=check;run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Jan 2022 00:00:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788758#M252279</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-01-07T00:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Find definition of user defined format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788763#M252281</link>
      <description>&lt;P&gt;Datasets live in files with SAS7BDAT extension.&amp;nbsp; Formats live in catalogs.&amp;nbsp; Catalogs live in files with SAS7BCAT extension.&amp;nbsp; If they sent you a catalog file then you can check if the format is in that catalog by using PROC FORMAT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Point a libref at the directory that contains the catalog.&amp;nbsp; Then use the libref you created and the name of the catalog file with PROC FORMAT.&amp;nbsp; So if the file is named 'mycat.sas7bcat' then the code might look like this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mylib 'some directory';
proc format lib=mylib.mycat cntlout=formats;
run;
proc freq data=formats;
   tables fmtname*fmttype / list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that catalogs are not readable across versions of SAS (or version of the operating system).&amp;nbsp; So if they made the catalog in an earlier version of SAS or used a different operating system then you cannot read the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really want them to send you the definition they need to either use PROC CPORT to make a transportable version of the catalog.&amp;nbsp; Or use the code above to make a dataset with the format definitions and send that dataset.&amp;nbsp; Or just send the SAS statments to define the format(s).&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2022 01:16:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788763#M252281</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-01-07T01:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Find definition of user defined format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788821#M252320</link>
      <description>&lt;P&gt;This macro will export all the format definitions for a particular dataset, so long as they are contained in the FMTSEARCH path:&amp;nbsp;&amp;nbsp;&lt;A href="https://core.sasjs.io/mp__getformats_8sas.html" target="_blank"&gt;https://core.sasjs.io/mp__getformats_8sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Usage:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%mp_getformats(
  lib=YOURLIB
  ,ds=YOURDATASET
  ,outsummary=work.summarytable
  ,outdetail=work.formatdetails
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Jan 2022 11:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788821#M252320</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2022-01-07T11:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Find definition of user defined format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788916#M252365</link>
      <description>&lt;P&gt;To get a working version of a format, you need either&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;PROC FORMAT code to create the format&lt;/LI&gt;
&lt;LI&gt;a CNTLIN dataset for PROC FORMAT&lt;/LI&gt;
&lt;LI&gt;a catalog containing the format&lt;/LI&gt;
&lt;LI&gt;a logical description of the format, so you can create the code yourself&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Without neither, you're hosed and have to resort to guessing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The options are listed in order of being useful; code works everywhere, while catalogs and datasets may have issues with your platform.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2022 16:27:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-definition-of-user-defined-format/m-p/788916#M252365</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-07T16:27:10Z</dc:date>
    </item>
  </channel>
</rss>

