<?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: Applying a format-Not displaying the entire value for the variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Applying-a-format-Not-displaying-the-entire-value-for-the/m-p/20620#M4282</link>
    <description>Hmmm! Even an attrib statement doesn't help.&lt;BR /&gt;
I would have stepped into this trap as well.&lt;BR /&gt;
&lt;BR /&gt;
Any suggestion how to get the "other" cases like "Passionfruit" in the output variable?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc format;&lt;BR /&gt;
  value $f_name default= 40 max=40 min=40&lt;BR /&gt;
    "Apple"  = "A"&lt;BR /&gt;
    "Banana" = "B"&lt;BR /&gt;
    "Grapes" = "G"&lt;BR /&gt;
    "Mango"  = "M"&lt;BR /&gt;
  ;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data have;&lt;BR /&gt;
  length fruit $ 50;&lt;BR /&gt;
  fruit='Apple';&lt;BR /&gt;
  fruit2=fruit;&lt;BR /&gt;
  output;&lt;BR /&gt;
  fruit='Passionfruit';&lt;BR /&gt;
  fruit2=fruit;&lt;BR /&gt;
  output;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data Fruit_frmt;&lt;BR /&gt;
  set have;&lt;BR /&gt;
  format fruit2 $f_name.;&lt;BR /&gt;
  attrib fruit3 length=$50.;&lt;BR /&gt;
  fruit3=put(fruit,$f_name.);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=Fruit_frmt;&lt;BR /&gt;
run;</description>
    <pubDate>Thu, 13 May 2010 13:05:41 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2010-05-13T13:05:41Z</dc:date>
    <item>
      <title>Applying a format-Not displaying the entire value for the variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Applying-a-format-Not-displaying-the-entire-value-for-the/m-p/20617#M4279</link>
      <description>I have created a format using proc format. I applied the format to a variable in the data set. But the resultant data set is not displaying the entire contents of the field. It is truncating the value of the variable.&lt;BR /&gt;
It is displaying only 10 characters in the field. proc format;&lt;BR /&gt;
value $f_name &lt;BR /&gt;
 'Apple' = 'A'&lt;BR /&gt;
 'Banana' = 'B'  &lt;BR /&gt;
 'grapes' = 'G' &lt;BR /&gt;
 'Mango' = 'M'   &lt;BR /&gt;
  run;&lt;BR /&gt;
data Fruit_frmt;&lt;BR /&gt;
set sorted_Fruit;&lt;BR /&gt;
format Fruit $f_name.;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
In the variable fruit where ever it does not have match in the proc format, it is truncating the display to 10 charecters. The field length of fruit is 50.&lt;BR /&gt;
Please advise.</description>
      <pubDate>Wed, 12 May 2010 17:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Applying-a-format-Not-displaying-the-entire-value-for-the/m-p/20617#M4279</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-05-12T17:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Applying a format-Not displaying the entire value for the variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Applying-a-format-Not-displaying-the-entire-value-for-the/m-p/20618#M4280</link>
      <description>Share whatever SAS code you are using to display the variable.  It will help a lot with determining the source of your situation.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 12 May 2010 17:04:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Applying-a-format-Not-displaying-the-entire-value-for-the/m-p/20618#M4280</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-05-12T17:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Applying a format-Not displaying the entire value for the variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Applying-a-format-Not-displaying-the-entire-value-for-the/m-p/20619#M4281</link>
      <description>If you do not use an attribute or length statement the new character variable will be set to the length of the first value encountered.</description>
      <pubDate>Wed, 12 May 2010 17:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Applying-a-format-Not-displaying-the-entire-value-for-the/m-p/20619#M4281</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2010-05-12T17:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Applying a format-Not displaying the entire value for the variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Applying-a-format-Not-displaying-the-entire-value-for-the/m-p/20620#M4282</link>
      <description>Hmmm! Even an attrib statement doesn't help.&lt;BR /&gt;
I would have stepped into this trap as well.&lt;BR /&gt;
&lt;BR /&gt;
Any suggestion how to get the "other" cases like "Passionfruit" in the output variable?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc format;&lt;BR /&gt;
  value $f_name default= 40 max=40 min=40&lt;BR /&gt;
    "Apple"  = "A"&lt;BR /&gt;
    "Banana" = "B"&lt;BR /&gt;
    "Grapes" = "G"&lt;BR /&gt;
    "Mango"  = "M"&lt;BR /&gt;
  ;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data have;&lt;BR /&gt;
  length fruit $ 50;&lt;BR /&gt;
  fruit='Apple';&lt;BR /&gt;
  fruit2=fruit;&lt;BR /&gt;
  output;&lt;BR /&gt;
  fruit='Passionfruit';&lt;BR /&gt;
  fruit2=fruit;&lt;BR /&gt;
  output;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data Fruit_frmt;&lt;BR /&gt;
  set have;&lt;BR /&gt;
  format fruit2 $f_name.;&lt;BR /&gt;
  attrib fruit3 length=$50.;&lt;BR /&gt;
  fruit3=put(fruit,$f_name.);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=Fruit_frmt;&lt;BR /&gt;
run;</description>
      <pubDate>Thu, 13 May 2010 13:05:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Applying-a-format-Not-displaying-the-entire-value-for-the/m-p/20620#M4282</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-05-13T13:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Applying a format-Not displaying the entire value for the variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Applying-a-format-Not-displaying-the-entire-value-for-the/m-p/20621#M4283</link>
      <description>When using the format-name in a FORMAT statement (or PUT function), specify a width attribute, as in $F_NAME50. to avoid the truncation.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.

Message was edited by: sbb</description>
      <pubDate>Thu, 13 May 2010 14:59:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Applying-a-format-Not-displaying-the-entire-value-for-the/m-p/20621#M4283</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-05-13T14:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Applying a format-Not displaying the entire value for the variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Applying-a-format-Not-displaying-the-entire-value-for-the/m-p/20622#M4284</link>
      <description>When you specify the width on the format, be sure to specify it when the variable is created.  In your case the FORMAT statement would need to come before the SET statement.  The LENGTH statement would also do the trick.&lt;BR /&gt;
[pre]data Fruit_frmt;&lt;BR /&gt;
format Fruit $f_name50.;&lt;BR /&gt;
*length fruit $50;&lt;BR /&gt;
set sorted_Fruit;&lt;BR /&gt;
run; [/pre]</description>
      <pubDate>Thu, 13 May 2010 17:13:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Applying-a-format-Not-displaying-the-entire-value-for-the/m-p/20622#M4284</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-05-13T17:13:28Z</dc:date>
    </item>
  </channel>
</rss>

