<?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 format truncation of values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-format-truncation-of-values/m-p/658060#M197212</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/288172"&gt;@Lee_wan&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would mostly&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;look at the CNTLOUT dataset of the format&lt;/LI&gt;
&lt;LI&gt;remember that CNTLIN datasets can be fairly "minimalist"&lt;/LI&gt;
&lt;LI&gt;create the CNTLIN dataset and compare it to the CNTLOUT dataset using PROC COMPARE.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;In your example the result could be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fmt;
retain fmtname 'cmfreq' type 'C';
infile cards eof=eof;
input start $ label $;
output;
return;
eof:
  hlo='OF';
  label='$100.';
  output;
cards;
1 BID
2 TID
3 QID
;

proc format cntlin=fmt;
run;&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jun 2020 13:27:56 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2020-06-12T13:27:56Z</dc:date>
    <item>
      <title>Proc format truncation of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-format-truncation-of-values/m-p/658022#M197197</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to use the code as below to avoid&amp;nbsp;truncation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
 value $cmfreq
    "1" = "BID"
    "2" = "TID"
    "3" = "QID"
    other=[$100.]
    ;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But how to use&amp;nbsp;cntlin to replace this code.&lt;/P&gt;
&lt;PRE&gt;data tmp_format;
	  set tmp_format;
	  by fmtname;
	  output;
	  if last.fmtname then do;
	  start='other';
	  end='other';
	  label='[$200.]';
	  output;
	  end;
	run;&lt;/PRE&gt;
&lt;P&gt;The code as below is not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 11:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-format-truncation-of-values/m-p/658022#M197197</guid>
      <dc:creator>Lee_wan</dc:creator>
      <dc:date>2020-06-12T11:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format truncation of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-format-truncation-of-values/m-p/658025#M197199</link>
      <description>&lt;P&gt;"The code as below is not work" tells us exactly nothing. Describe the problem, show the log.&lt;/P&gt;
&lt;P&gt;I suspect you should start by looking at the HLO dataset variable, or maybe at the DEFAULT= option for the VALUE statement.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 11:41:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-format-truncation-of-values/m-p/658025#M197199</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-06-12T11:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format truncation of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-format-truncation-of-values/m-p/658060#M197212</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/288172"&gt;@Lee_wan&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would mostly&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;look at the CNTLOUT dataset of the format&lt;/LI&gt;
&lt;LI&gt;remember that CNTLIN datasets can be fairly "minimalist"&lt;/LI&gt;
&lt;LI&gt;create the CNTLIN dataset and compare it to the CNTLOUT dataset using PROC COMPARE.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;In your example the result could be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fmt;
retain fmtname 'cmfreq' type 'C';
infile cards eof=eof;
input start $ label $;
output;
return;
eof:
  hlo='OF';
  label='$100.';
  output;
cards;
1 BID
2 TID
3 QID
;

proc format cntlin=fmt;
run;&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 13:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-format-truncation-of-values/m-p/658060#M197212</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-06-12T13:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format truncation of values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-format-truncation-of-values/m-p/658077#M197217</link>
      <description>&lt;P&gt;Doesn't work is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the &amp;lt;&amp;gt; to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bad coding form for people without a lot of SAS experience to use&lt;/P&gt;
&lt;PRE&gt;data tmp_format;
	  set tmp_format;
	  by fmtname;&lt;/PRE&gt;
&lt;P&gt;as that completely overwrites your starting data set an if there is a logic error you will have to go back an recreate the original tmp_format.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 14:22:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-format-truncation-of-values/m-p/658077#M197217</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-12T14:22:29Z</dc:date>
    </item>
  </channel>
</rss>

