<?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 report : mislaignment issue in column labels and column data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-report-mislaignment-issue-in-column-labels-and-column-data/m-p/330087#M73974</link>
    <description>&lt;P&gt;Hi, PROC PRINTTO is NOT making an RTF file. You are making an ASCII text file that you are opening with Microsoft Word.&lt;BR /&gt;&lt;BR /&gt; A true RTF file is created with ODS RTF. You do not have ODS RTF statements in the code you show here. If you open a true ODS RTF file with Notepad, you see RTF control strings at the top of the file, as shown if I run this code and then open the resulting RTF file with Notepad:&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;ods rtf file='c:\temp\class.rtf';&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc print data=sashelp.class;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;ods rtf close;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;as opposed to using PROC PRINTTO like this:&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc printto print='c:\temp\classreport.txt'; run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc print data=sashelp.class;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc printto; run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;You can compare the 2 outputs by opening each file with Notepad.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ODS RTF file opened with Notepad:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7109i275607E94E3BEC21/image-size/original?v=1.0&amp;amp;px=-1" alt="use_ODS_rtf.png" title="use_ODS_rtf.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC PRINTTO file opened with Notepad:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7110i04501539AC091FC7/image-size/original?v=1.0&amp;amp;px=-1" alt="use_PRINTTO_for_report.png" title="use_PRINTTO_for_report.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;If you actually used ODS RTF, then the file would be rendered correctly whether you were using Word 97, Word 2000 or Word 2013. ODS RTF has been using RTF control syntax ever since Word 97. When you make an ASCII text file with PROC PRINTTO and then open the text file with Word, you generally have to adjust the orientation and the font for the entire document to have the output look as it does in the LISTING window.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;cynthia&lt;/P&gt;</description>
    <pubDate>Mon, 06 Feb 2017 03:29:04 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2017-02-06T03:29:04Z</dc:date>
    <item>
      <title>proc report : mislaignment issue in column labels and column data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-mislaignment-issue-in-column-labels-and-column-data/m-p/330077#M73967</link>
      <description>&lt;P&gt;I used the following code to generate a table, &lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=final nowd headline headskip split='^' missing wrap spacing=1;	

  column (treatment patient_id visit dose rsdtc rsdy assessor1-assessor5 adjudicator best_overall);
	define treatment /"Treatment" order group width=10 left flow spacing=1;
	define patient_id   /"Patient^Number" order group  width=8 center spacing=1;
	define visit      /"Visit"  group order=data width=7 left spacing=1 ;
	define dose      /"Assigned^Dose"  group width=8  spacing=1;
	define rsdtc      /"Assessment^Date" order group width=10 left  spacing=1;
	define rsdy      /"Relative^Study^Day*" order group width=8  left spacing=1 ;
	define assessor1     /"Assessor1" width=9 center spacing=1;
	define assessor2     /"Assessor2" width=9 center spacing=1;
	define assessor3	 /"Assessor3" width=9 center spacing=1 ;
	define assessor4	 /"Assessor4" width=9 center spacing=1;
	define assessor5	 /"Assessor5" width=9 center spacing=1;
	define Adjudicator	 /"Adjudicator**" width=13  center spacing=1 ;
	define best_overall	 /"Best^Overall^Response" width=8 center ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But got misalignment issues in both column labels and column data. Can anyone help? Thanks&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7107iCE2B9BAAD21BB9B4/image-size/original?v=1.0&amp;amp;px=-1" alt="original.png" title="original.png" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 01:43:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-mislaignment-issue-in-column-labels-and-column-data/m-p/330077#M73967</guid>
      <dc:creator>fengyuwuzu</dc:creator>
      <dc:date>2017-02-06T01:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : mislaignment issue in column labels and column data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-mislaignment-issue-in-column-labels-and-column-data/m-p/330078#M73968</link>
      <description>Hi:&lt;BR /&gt;  You did not show all your code. Are you using the ODS LISTING destination? Or, are you making a .LST file or a .TXT file and then opening the file in another software application?&lt;BR /&gt;&lt;BR /&gt;  It does not look like a complete PROC REPORT and your use of HEADLINE, HEADSKIP, SPACING and WIDTH seem to indicate that you are using LISTING output. &lt;BR /&gt; &lt;BR /&gt;cynthia</description>
      <pubDate>Mon, 06 Feb 2017 01:49:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-mislaignment-issue-in-column-labels-and-column-data/m-p/330078#M73968</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-02-06T01:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : mislaignment issue in column labels and column data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-mislaignment-issue-in-column-labels-and-column-data/m-p/330079#M73969</link>
      <description>&lt;P&gt;I am generating a rtf file (a listing). When I opened it with Word, the alignment is strange.&lt;/P&gt;
&lt;P&gt;Now I choose "File' -- 'Options' -- "Advanced" -- bottom shows word 97 format; after I changed to word 2010 for the "layout the document as if created in word 2010", the alignment is perfect. it seems SAS default output rtf is word 97 version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to set the word version 2010 once for all? It seems I have to re-set it in each .rtf file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options formchar="|----|+|---+=|-/&amp;lt;&amp;gt;" pageno=1 nonumber nocenter nodate ps=46 ls=134 nobyline ;

filename tmpfile temp;

proc printto new print=tmpfile;
run;

proc report data=final nowd headline headskip split='^' missing wrap spacing=1;	

  column (treatment patient_id visit dose rsdtc rsdy assessor1-assessor5 adjudicator best_overall);
	define treatment /"Treatment" order group width=10 left flow spacing=1;
	define patient_id   /"Patient^Number" order group  width=8 center spacing=1;
	define visit      /"Visit"  group order=data width=7 left spacing=1 ;
	define dose      /"Assigned^Dose"  group width=8  spacing=1;
	define rsdtc      /"Assessment^Date" order group width=10 left  spacing=1;
	define rsdy      /"Relative^Study^Day*" order group width=8  left spacing=1 ;
	define assessor1     /"Assessor1" width=9 center spacing=1;
	define assessor2     /"Assessor2" width=9 center spacing=1;
	define assessor3	 /"Assessor3" width=9 center spacing=1 ;
	define assessor4	 /"Assessor4" width=9 center spacing=1;
	define assessor5	 /"Assessor5" width=9 center spacing=1;
	define Adjudicator	 /"Adjudicator**" width=13  center spacing=1 ;
	define best_overall	 /"Best^Overall^Response" width=8 center ;
	
compute before _page_;
	line @1 "14.6-28.1";
	line @1 'Listing of xxxx';
	line @1 ' ';
 line @1 134*'--';

endcomp;


  compute after _page_;
   line @1 134*'-';
   line @1 " ";
   line @1 "Program Location:  &amp;amp;curpathname./programs/stat/tfl/&amp;amp;pgmname..sas";
   line @1 "Data location: &amp;amp;sdtm_def";
   line @1 "Date/Time Report Produced: &amp;amp;sysdate. / &amp;amp;systime.";
  endcomp;
run;

proc printto print=print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 04:51:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-mislaignment-issue-in-column-labels-and-column-data/m-p/330079#M73969</guid>
      <dc:creator>fengyuwuzu</dc:creator>
      <dc:date>2017-02-06T04:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : mislaignment issue in column labels and column data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-mislaignment-issue-in-column-labels-and-column-data/m-p/330087#M73974</link>
      <description>&lt;P&gt;Hi, PROC PRINTTO is NOT making an RTF file. You are making an ASCII text file that you are opening with Microsoft Word.&lt;BR /&gt;&lt;BR /&gt; A true RTF file is created with ODS RTF. You do not have ODS RTF statements in the code you show here. If you open a true ODS RTF file with Notepad, you see RTF control strings at the top of the file, as shown if I run this code and then open the resulting RTF file with Notepad:&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;ods rtf file='c:\temp\class.rtf';&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc print data=sashelp.class;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;ods rtf close;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;as opposed to using PROC PRINTTO like this:&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc printto print='c:\temp\classreport.txt'; run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc print data=sashelp.class;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc printto; run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;You can compare the 2 outputs by opening each file with Notepad.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ODS RTF file opened with Notepad:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7109i275607E94E3BEC21/image-size/original?v=1.0&amp;amp;px=-1" alt="use_ODS_rtf.png" title="use_ODS_rtf.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC PRINTTO file opened with Notepad:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7110i04501539AC091FC7/image-size/original?v=1.0&amp;amp;px=-1" alt="use_PRINTTO_for_report.png" title="use_PRINTTO_for_report.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;If you actually used ODS RTF, then the file would be rendered correctly whether you were using Word 97, Word 2000 or Word 2013. ODS RTF has been using RTF control syntax ever since Word 97. When you make an ASCII text file with PROC PRINTTO and then open the text file with Word, you generally have to adjust the orientation and the font for the entire document to have the output look as it does in the LISTING window.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 03:29:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-mislaignment-issue-in-column-labels-and-column-data/m-p/330087#M73974</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-02-06T03:29:04Z</dc:date>
    </item>
  </channel>
</rss>

