<?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: PROC summary with preloadfmt option truncates char variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-summary-with-preloadfmt-option-truncates-char-variables/m-p/864237#M341322</link>
    <description>Fantastic, thanks Kurt. I missed that option.</description>
    <pubDate>Wed, 15 Mar 2023 10:10:41 GMT</pubDate>
    <dc:creator>PavelD</dc:creator>
    <dc:date>2023-03-15T10:10:41Z</dc:date>
    <item>
      <title>PROC summary with preloadfmt option truncates char variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-summary-with-preloadfmt-option-truncates-char-variables/m-p/864226#M341318</link>
      <description>&lt;P&gt;hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;code:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data data_in;
    length Name $10;
    /* without the line above, Name has length 8 */

    set sashelp.class;
    /* Name has length 10 - as expected */

run;


proc format ;
    value $Name (multilabel)
    "Alfred" = "Alfred"
    "Alice" = "Alice"
    "Alice" = "Aggr"
    "Alfred" = "Aggr"
    other = "other"
    
;
run;

proc summary nway data = data_in completetypes;
	class Name / preloadfmt mlf;
	var Weight;

    format Name $Name.;
	
	output  out = data_out  ( DROP = _TYPE_ _FREQ_)   sum =  ;
    /* in data_out, Name has length 6, and NOT 10 ! */
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;in data_in, Name has length 10. In data_out, Name has length 6.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to force proc summary to MAINTAIN the length of the class variable?&amp;nbsp;&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 08:48:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-summary-with-preloadfmt-option-truncates-char-variables/m-p/864226#M341318</guid>
      <dc:creator>PavelD</dc:creator>
      <dc:date>2023-03-15T08:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: PROC summary with preloadfmt option truncates char variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-summary-with-preloadfmt-option-truncates-char-variables/m-p/864229#M341319</link>
      <description>&lt;P&gt;Create the format with a default length of 10.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p1upn25lbfo6mkn1wncu4dyh9q91.htm#p0okqjurxwjgocn1muw3cfbip2g0" target="_blank" rel="noopener"&gt;DEFAULT= option&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 09:02:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-summary-with-preloadfmt-option-truncates-char-variables/m-p/864229#M341319</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-15T09:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: PROC summary with preloadfmt option truncates char variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-summary-with-preloadfmt-option-truncates-char-variables/m-p/864237#M341322</link>
      <description>Fantastic, thanks Kurt. I missed that option.</description>
      <pubDate>Wed, 15 Mar 2023 10:10:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-summary-with-preloadfmt-option-truncates-char-variables/m-p/864237#M341322</guid>
      <dc:creator>PavelD</dc:creator>
      <dc:date>2023-03-15T10:10:41Z</dc:date>
    </item>
  </channel>
</rss>

