<?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: label name display in output in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/label-name-display-in-output/m-p/18623#M3697</link>
    <description>Hello Cg,&lt;BR /&gt;
&lt;BR /&gt;
See the example.&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
input sex$ age;&lt;BR /&gt;
cards;&lt;BR /&gt;
m 25&lt;BR /&gt;
f 60&lt;BR /&gt;
f 56&lt;BR /&gt;
m 65&lt;BR /&gt;
u 52&lt;BR /&gt;
;&lt;BR /&gt;
proc format;&lt;BR /&gt;
value $sexes m = 'male'&lt;BR /&gt;
             f = 'female' &lt;BR /&gt;
	     u = 'unknown'  &lt;BR /&gt;
			 ;&lt;BR /&gt;
proc print;&lt;BR /&gt;
format sex $sexes.;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
or&lt;BR /&gt;
u can do as per daniel suggestion.</description>
    <pubDate>Wed, 15 Apr 2009 12:08:26 GMT</pubDate>
    <dc:creator>venkatesh</dc:creator>
    <dc:date>2009-04-15T12:08:26Z</dc:date>
    <item>
      <title>label name display in output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/label-name-display-in-output/m-p/18620#M3694</link>
      <description>How can I display the entire name of my variables when they are in output. For example in my data step I put &lt;BR /&gt;
if sex = 'M' then gender = 'male';&lt;BR /&gt;
if sex = 'F' then gender = 'female';&lt;BR /&gt;
if sex = 'U' then gender = 'unknown';&lt;BR /&gt;
&lt;BR /&gt;
when this was outputed it showed up as &lt;BR /&gt;
&lt;U&gt;gender&lt;/U&gt;&lt;BR /&gt;
fema&lt;BR /&gt;
male&lt;BR /&gt;
unkn&lt;BR /&gt;
&lt;BR /&gt;
How can I get the entire word to show up in the output?</description>
      <pubDate>Tue, 14 Apr 2009 22:49:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/label-name-display-in-output/m-p/18620#M3694</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-14T22:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: label name display in output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/label-name-display-in-output/m-p/18621#M3695</link>
      <description>Actually, I think the data is correctly displayed...&lt;BR /&gt;
&lt;BR /&gt;
I suspect you have created the GENDER variable in the input dataset without preassigning to it, the maximum possbible length.&lt;BR /&gt;
You see, if you do not explicitly define a variable size, SAS will assume one of two things.&lt;BR /&gt;
If it is a numerical var, it will be defined with the maximum length, being 8 bytes.&lt;BR /&gt;
If it is a character var, it will be defined with the size of the first value assigned to it during execution.&lt;BR /&gt;
&lt;BR /&gt;
In your case, I suspect the first value assigned to GENDER was 'male' which is 4 bytes long. From there, all other values where truncated to that size.&lt;BR /&gt;
&lt;BR /&gt;
For example,&lt;BR /&gt;
&lt;BR /&gt;
data YOURDATA;&lt;BR /&gt;
GENDER='male'; output; /* first assignment defines variables size = 4 bytes */&lt;BR /&gt;
GENDER='female'; output; /* truncated, GENDER='fema' */&lt;BR /&gt;
GENDER='unknown'; output; /* truncated, GENDER='unkn' */;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
to avoid this explicitly define the variable size with the LENGTH statement.&lt;BR /&gt;
&lt;BR /&gt;
data YOURDATA;&lt;BR /&gt;
length GENDER $7; /* define GENDER as a 7 byte char variable */&lt;BR /&gt;
GENDER='male'; output;&lt;BR /&gt;
GENDER='female'; output;&lt;BR /&gt;
GENDER='unknown'; output;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Greetings from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos at &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
      <pubDate>Wed, 15 Apr 2009 07:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/label-name-display-in-output/m-p/18621#M3695</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2009-04-15T07:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: label name display in output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/label-name-display-in-output/m-p/18622#M3696</link>
      <description>If you don't want to be concerned about column length, using a user defined format could be an alternative.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Wed, 15 Apr 2009 11:25:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/label-name-display-in-output/m-p/18622#M3696</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-04-15T11:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: label name display in output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/label-name-display-in-output/m-p/18623#M3697</link>
      <description>Hello Cg,&lt;BR /&gt;
&lt;BR /&gt;
See the example.&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
input sex$ age;&lt;BR /&gt;
cards;&lt;BR /&gt;
m 25&lt;BR /&gt;
f 60&lt;BR /&gt;
f 56&lt;BR /&gt;
m 65&lt;BR /&gt;
u 52&lt;BR /&gt;
;&lt;BR /&gt;
proc format;&lt;BR /&gt;
value $sexes m = 'male'&lt;BR /&gt;
             f = 'female' &lt;BR /&gt;
	     u = 'unknown'  &lt;BR /&gt;
			 ;&lt;BR /&gt;
proc print;&lt;BR /&gt;
format sex $sexes.;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
or&lt;BR /&gt;
u can do as per daniel suggestion.</description>
      <pubDate>Wed, 15 Apr 2009 12:08:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/label-name-display-in-output/m-p/18623#M3697</guid>
      <dc:creator>venkatesh</dc:creator>
      <dc:date>2009-04-15T12:08:26Z</dc:date>
    </item>
  </channel>
</rss>

