<?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: How can I set the label length when including a format in another format? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-set-the-label-length-when-including-a-format-in/m-p/761842#M241135</link>
    <description>&lt;P&gt;Simply set the length in the second format to the length you need. If you want 50 characters use:&lt;/P&gt;
&lt;PRE&gt;proc format lib=format.userformat;
value $secondformat
'1'='AShortString'
'2'='AlsoAShortString'
other=[$firstformat&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;50&lt;/STRONG&gt;&lt;/FONT&gt;.]
;
run;&lt;/PRE&gt;
&lt;P&gt;Or show the code where you attempted the default that did not perform as expected.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Aug 2021 15:34:11 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-08-16T15:34:11Z</dc:date>
    <item>
      <title>How can I set the label length when including a format in another format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-set-the-label-length-when-including-a-format-in/m-p/761840#M241134</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When trying to include a format in another format I get a note saying:&lt;BR /&gt;&lt;BR /&gt;NOTE: The $FIRSTFORMAT (in)format was specified on the right-hand side of an equal sign, but without a length specification. PROC &lt;BR /&gt;FORMAT will assume a default length of at least 40 for the format being generated. If this is an insufficient width, you can &lt;BR /&gt;rerun PROC FORMAT with an explicit width for the $FIRSTFORMAT (in)format, or provide a sufficient DEFAULT= option.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;The Code looks something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;proc format lib=format.userformat;&lt;BR /&gt;value $firstformat&lt;BR /&gt;'3'='ThisIsAStringThatIsMoreThanFortyCharactersLong'&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc format lib=format.userformat;&lt;BR /&gt;value $secondformat&lt;BR /&gt;'1'='AShortString'&lt;BR /&gt;'2'='AlsoAShortString'&lt;BR /&gt;other=[$firstformat.]&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data test;&lt;BR /&gt;length value $255.;&lt;BR /&gt;format value $secondformat.;&lt;BR /&gt;value='1';&lt;BR /&gt;output;&lt;BR /&gt;value='2';&lt;BR /&gt;output;&lt;BR /&gt;value='3';&lt;BR /&gt;output;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;The value '3' is truncated to 40 characters... What am I doing wrong? I've tried putting a&amp;nbsp; "default=50" after the value -statement (in both formats) but it doesn't seem to be doing anything.&lt;/P&gt;
&lt;P&gt;How do I set an "explicit width for the $FIRSTFORMAT (in)format" or "provide a sufficient DEFAULT= option"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above code is obviously just an example... In reality the firstformat is created from a file and contains a lot of values, most of whom are longer than the values in secondformat.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Aug 2021 15:30:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-set-the-label-length-when-including-a-format-in/m-p/761840#M241134</guid>
      <dc:creator>andypandy_swe</dc:creator>
      <dc:date>2021-08-16T15:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set the label length when including a format in another format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-set-the-label-length-when-including-a-format-in/m-p/761842#M241135</link>
      <description>&lt;P&gt;Simply set the length in the second format to the length you need. If you want 50 characters use:&lt;/P&gt;
&lt;PRE&gt;proc format lib=format.userformat;
value $secondformat
'1'='AShortString'
'2'='AlsoAShortString'
other=[$firstformat&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;50&lt;/STRONG&gt;&lt;/FONT&gt;.]
;
run;&lt;/PRE&gt;
&lt;P&gt;Or show the code where you attempted the default that did not perform as expected.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Aug 2021 15:34:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-set-the-label-length-when-including-a-format-in/m-p/761842#M241135</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-16T15:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set the label length when including a format in another format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-set-the-label-length-when-including-a-format-in/m-p/761981#M241199</link>
      <description>I tried your code yesterday and it didn't work... Got the same result. Today it works. Must have had en EG hangup.&lt;BR /&gt;Thanks!</description>
      <pubDate>Tue, 17 Aug 2021 06:50:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-set-the-label-length-when-including-a-format-in/m-p/761981#M241199</guid>
      <dc:creator>andypandy_swe</dc:creator>
      <dc:date>2021-08-17T06:50:29Z</dc:date>
    </item>
  </channel>
</rss>

