<?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 Length of a format name=49 in dictionaries in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Length-of-a-format-name-49-in-dictionaries/m-p/820384#M323802</link>
    <description>&lt;P&gt;In dictionaries, the maximum length of format and informat names is 49&lt;/P&gt;
&lt;P&gt;I would expect something like 31 for formats (32 -1 for the $) and 30 for informats (32 -1 for the $ and - 1 for the @).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    create table tmp as
    select *
    from dictionary.columns
    where upcase(libname)='SASHELP' and
          upcase(memname)='CLASS';
    
    select name, length
    from dictionary.columns
    where upcase(libname)='WORK' and 
          upcase(memname)='TMP' and
          upcase(name) in ('FORMAT','INFORMAT');
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="fmtname.JPG" style="width: 109px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72740iBBCB17C59DA5E387/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fmtname.JPG" alt="fmtname.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The length of the FMTNAME variable in format catalogs is 32.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
    value $sex 'M'='Male'
               'F'='Female';
run;

proc format cntlout=chk;
run;

proc print data=sashelp.vcolumn noobs;
    where upcase(libname)='WORK' and 
          upcase(memname)='CHK'  and 
          upcase(name)='FMTNAME';
    var name length;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="fmtname2.JPG" style="width: 118px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72741i8312DA6C72E0A4DD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fmtname2.JPG" alt="fmtname2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 25 Jun 2022 13:53:06 GMT</pubDate>
    <dc:creator>xxformat_com</dc:creator>
    <dc:date>2022-06-25T13:53:06Z</dc:date>
    <item>
      <title>Length of a format name=49 in dictionaries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-of-a-format-name-49-in-dictionaries/m-p/820384#M323802</link>
      <description>&lt;P&gt;In dictionaries, the maximum length of format and informat names is 49&lt;/P&gt;
&lt;P&gt;I would expect something like 31 for formats (32 -1 for the $) and 30 for informats (32 -1 for the $ and - 1 for the @).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    create table tmp as
    select *
    from dictionary.columns
    where upcase(libname)='SASHELP' and
          upcase(memname)='CLASS';
    
    select name, length
    from dictionary.columns
    where upcase(libname)='WORK' and 
          upcase(memname)='TMP' and
          upcase(name) in ('FORMAT','INFORMAT');
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="fmtname.JPG" style="width: 109px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72740iBBCB17C59DA5E387/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fmtname.JPG" alt="fmtname.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The length of the FMTNAME variable in format catalogs is 32.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
    value $sex 'M'='Male'
               'F'='Female';
run;

proc format cntlout=chk;
run;

proc print data=sashelp.vcolumn noobs;
    where upcase(libname)='WORK' and 
          upcase(memname)='CHK'  and 
          upcase(name)='FMTNAME';
    var name length;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="fmtname2.JPG" style="width: 118px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72741i8312DA6C72E0A4DD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fmtname2.JPG" alt="fmtname2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jun 2022 13:53:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-of-a-format-name-49-in-dictionaries/m-p/820384#M323802</guid>
      <dc:creator>xxformat_com</dc:creator>
      <dc:date>2022-06-25T13:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Length of a format name=49 in dictionaries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-of-a-format-name-49-in-dictionaries/m-p/820392#M323807</link>
      <description>&lt;P&gt;The FMTNAME variable in the CNTLOUT dataset contains the bare (in)format name, which cannot exceed 32 characters. The &lt;FONT face="courier new,courier"&gt;format&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;informat&lt;/FONT&gt; variables of dictionary.columns, however, also include the length and decimal specifications (if any), the period (and the dollar sign for character (in)formats, but this doesn't increase the maximum length needed). The example&amp;nbsp;&lt;FONT face="courier new,courier"&gt;ABCDEFGHIJKLMNOPQRSTUVWXYZFORMAT32767.12345&lt;/FONT&gt;&amp;nbsp;shows that the length of those variables must be at least 43.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jun 2022 16:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-of-a-format-name-49-in-dictionaries/m-p/820392#M323807</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-06-25T16:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Length of a format name=49 in dictionaries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-of-a-format-name-49-in-dictionaries/m-p/820397#M323809</link>
      <description>&lt;P&gt;&lt;STRONG&gt;The is no inconsistency there.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Two different things. Two different variable names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FMTNAME is the NAME of the format.&lt;/P&gt;
&lt;P&gt;FORMAT is the value of the format SPECIFICATION that has been attached to a variable.&amp;nbsp; So the name plus the optional width plus the period plus the option number of decimal places.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will see an inconsistency between the DICTIONARY tables and the output of PROC CONTENTS.&amp;nbsp; The dataset generated by PROC CONTENTS has three variable to store the format specification.&amp;nbsp; The name of the format is in a variable named FORMAT and the width (length) is in FORMATL and the number of decimal places is in FORMATD.&amp;nbsp; So the variable FORMAT created by PROC CONTENTS has the name of the variable in DICTIONARY.COLUMNS but the content of the variable FMTNAME generated by PROC FORMAT or DICTIONARY.FORMATS.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jun 2022 20:48:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-of-a-format-name-49-in-dictionaries/m-p/820397#M323809</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-25T20:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Length of a format name=49 in dictionaries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-of-a-format-name-49-in-dictionaries/m-p/823689#M325259</link>
      <description>&lt;P&gt;Actually FMTNAME lenght of 32 includes the $ and @.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example you can test. Add any character to the format/informat name and you will see a note in the log indicating that the name is exceeding 32 characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
    value   _234567890123456789012345678901_  0='No';  *32 characters;
    invalue _23456789012345678901234567890_   'N'=0;   *31 char + @;
    
    value   $_3456789012345678901234567890_ 'N'='No'; *31 char + $;
    invalue $_345678901234567890123456789_  'N'='No'; *30 char + $ +@;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Jul 2022 10:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-of-a-format-name-49-in-dictionaries/m-p/823689#M325259</guid>
      <dc:creator>xxformat_com</dc:creator>
      <dc:date>2022-07-17T10:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Length of a format name=49 in dictionaries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-of-a-format-name-49-in-dictionaries/m-p/823690#M325260</link>
      <description>&lt;P&gt;So 32 bytes for FORMAT 8 bytes for FORMATD and 8 bytes for FORMATL and 1 byte for the dot.&lt;/P&gt;
&lt;P&gt;It would mean that proc sql FORMAT character value would use 8 characters for FORMAT D (converting FORMATD to numeric) and the same for FORMATL? Not sure it makes sense. Right now, I'm reaching my reasoning limits.&lt;/P&gt;
&lt;P&gt;If I receive metadata with the three variables and want to create the combined version, I would need to know how to convert it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then let's also add -R, -L or -C to account for two extra characters meaning planning for 51 in a variable used by putc... functions.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jul 2022 11:44:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-of-a-format-name-49-in-dictionaries/m-p/823690#M325260</guid>
      <dc:creator>xxformat_com</dc:creator>
      <dc:date>2022-07-17T11:44:42Z</dc:date>
    </item>
  </channel>
</rss>

