<?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: Using Put statement to format an output in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-Put-statement-to-format-an-output/m-p/572871#M161685</link>
    <description>&lt;P&gt;You might want to look at the Report Writing Interface which creates "nice" ods tables instead of the plain text that FILE print uses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jul 2019 17:31:38 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-07-11T17:31:38Z</dc:date>
    <item>
      <title>Using Put statement to format an output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Put-statement-to-format-an-output/m-p/572579#M161586</link>
      <description>&lt;P&gt;Hello programmers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a sas output that i want to format and change into another format using a put statement.&lt;/P&gt;&lt;P&gt;The SAS output and how i want them to look like is in the attached photo.&lt;/P&gt;&lt;P&gt;Died is coded as (Yes/No =1/0). I have attached the codes that i ran. It's giving me all sorts of error and i thing it's a problem with the formatting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data sasoutput;
input tc	Tn $	Value	LowerCL	UpperCL	death	COUNT	PERCENT;
datalines;
1	Trouble with falling asleep	0.9622	0.7409	1.2497	1	424	16.8656
2	Trouble with waking during night	0.9019	0.7003	1.1617	1	424	16.8656
3	Trouble with waking too early	0.856	0.6434	1.139	1	424	16.879
;run;

data null ; set sasoutput; by tc tn; 
options nodate nonumber; 
file print notitles ;
If _N_ =1 then do; 
put @45 'Died '      ;
put @45 '  N'  @50 '  (%)';  
end;
if first.tc then put / tn $33.  @;  
put @35 value valuefm.  @45  Count 4.   @50 '(' percent  5.2 ')' 
                     ;
run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="output.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30934iC6BD9A6D092D316E/image-size/large?v=v2&amp;amp;px=999" role="button" title="output.JPG" alt="output.JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capt1.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30935i3FADCD5DC303E318/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capt1.JPG" alt="Capt1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 01:10:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Put-statement-to-format-an-output/m-p/572579#M161586</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-07-11T01:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using Put statement to format an output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Put-statement-to-format-an-output/m-p/572583#M161589</link>
      <description>&lt;P&gt;Just to clarify, did you create the first data set for the question or is that part of your code? Because it will not work. SAS assumes that the delimiter is space, and you have spaces in the second field (tn), the string with trouble. Also, the variable will only be 8 bytes long, so your full text will be truncated. The rest of your numeric variables will be missing, because SAS will try to put the string "with" into to variable "value" and that will be translated to missing.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 01:19:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Put-statement-to-format-an-output/m-p/572583#M161589</guid>
      <dc:creator>heffo</dc:creator>
      <dc:date>2019-07-11T01:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using Put statement to format an output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Put-statement-to-format-an-output/m-p/572639#M161617</link>
      <description>Thanks! That was indeed helpful.</description>
      <pubDate>Thu, 11 Jul 2019 09:40:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Put-statement-to-format-an-output/m-p/572639#M161617</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-07-11T09:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using Put statement to format an output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Put-statement-to-format-an-output/m-p/572871#M161685</link>
      <description>&lt;P&gt;You might want to look at the Report Writing Interface which creates "nice" ods tables instead of the plain text that FILE print uses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 17:31:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Put-statement-to-format-an-output/m-p/572871#M161685</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-11T17:31:38Z</dc:date>
    </item>
  </channel>
</rss>

