<?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 Custom PDF/RTF Output in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Custom-PDF-RTF-Output/m-p/600476#M173580</link>
    <description>&lt;P&gt;Given Data A; would like to have output shown below either in PDF/RTF file format. Any help?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data a;&lt;BR /&gt;input ID $ a b c d e f g h;&lt;BR /&gt;cards;&lt;BR /&gt;ABC 1 2 3 4 5 6 7 8&lt;BR /&gt;XYZ 4 3 2 1 8 7 6 5&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output PDF/RTF :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; 4&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (5)&amp;nbsp; (6)&amp;nbsp; (7)&amp;nbsp; (8)&lt;BR /&gt;XYZ&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (8)&amp;nbsp; (7)&amp;nbsp; (6)&amp;nbsp; (5)&lt;/P&gt;</description>
    <pubDate>Wed, 30 Oct 2019 17:44:21 GMT</pubDate>
    <dc:creator>GPatel</dc:creator>
    <dc:date>2019-10-30T17:44:21Z</dc:date>
    <item>
      <title>Custom PDF/RTF Output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Custom-PDF-RTF-Output/m-p/600476#M173580</link>
      <description>&lt;P&gt;Given Data A; would like to have output shown below either in PDF/RTF file format. Any help?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data a;&lt;BR /&gt;input ID $ a b c d e f g h;&lt;BR /&gt;cards;&lt;BR /&gt;ABC 1 2 3 4 5 6 7 8&lt;BR /&gt;XYZ 4 3 2 1 8 7 6 5&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output PDF/RTF :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; 4&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (5)&amp;nbsp; (6)&amp;nbsp; (7)&amp;nbsp; (8)&lt;BR /&gt;XYZ&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (8)&amp;nbsp; (7)&amp;nbsp; (6)&amp;nbsp; (5)&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 17:44:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Custom-PDF-RTF-Output/m-p/600476#M173580</guid>
      <dc:creator>GPatel</dc:creator>
      <dc:date>2019-10-30T17:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Custom PDF/RTF Output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Custom-PDF-RTF-Output/m-p/600480#M173582</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; What code have you tried?? PROC PRINT, PROC REPORT, PROC TABULATE? Other? It might be possible with data manipulation to create a report format that will work for you as you show, but that would probably involve at least a data step and then PROC REPORT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; It's useful to see your data, but would be also useful to know what you've already tried.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 18:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Custom-PDF-RTF-Output/m-p/600480#M173582</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-10-30T18:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Custom PDF/RTF Output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Custom-PDF-RTF-Output/m-p/600483#M173584</link>
      <description>&lt;P&gt;Thanks Cynthia for your response.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data a;&lt;BR /&gt;input ID $ a b c d e f g h;&lt;BR /&gt;cards;&lt;BR /&gt;ABC 1 2 3 4 5 6 7 8&lt;BR /&gt;XYZ 4 3 2 1 8 7 6 5&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;data _null_;&lt;BR /&gt;set a;&lt;BR /&gt;x='(';&lt;BR /&gt;y=')';&lt;BR /&gt;xhy=cats(x,h,y);&lt;BR /&gt;xey=cats(x,e,y);&lt;BR /&gt;xfy=cats(x,f,y);&lt;BR /&gt;xgy=cats(x,g,y);&lt;BR /&gt;by id notsorted;&lt;BR /&gt;file print notitle;&lt;BR /&gt;if (first.id or last.id) then do;&lt;BR /&gt;Put &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/145066"&gt;@10&lt;/a&gt; id &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/162406"&gt;@20&lt;/a&gt; a @35 b &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/290987"&gt;@50&lt;/a&gt; c @65 d / &lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/162406"&gt;@20&lt;/a&gt; xey @35 xfy &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/290987"&gt;@50&lt;/a&gt; xgy @65 xhy&lt;BR /&gt;;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 18:05:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Custom-PDF-RTF-Output/m-p/600483#M173584</guid>
      <dc:creator>GPatel</dc:creator>
      <dc:date>2019-10-30T18:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Custom PDF/RTF Output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Custom-PDF-RTF-Output/m-p/600501#M173598</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Using PUT statements will not work as you envision for PDF or RTF output. Basically when you start, you have 1 row per ID, but your report only has 4 columns going across. If you want "nice" PDF or RTF output, you'll have to move away from PUT statements and use the PUT function to get the parentheses on row 2 for each ID. Then, use PROC REPORT for reporting. I envisioned something more like this, where the DATA step does the restructure and then PROC REPORT just needs to display the records.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I show HTML output in my screen shot, but you can easily create RTF or PDF output by putting an ODS "sandwich" around the PROC REPORT step (and only the PROC REPORT step):&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;ods &lt;FONT color="#FF00FF"&gt;pdf&lt;/FONT&gt; file='c:\temp\final_report.&lt;FONT color="#FF00FF"&gt;pdf&lt;/FONT&gt;';&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;...insert REPORT code here;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;ods &lt;FONT color="#FF00FF"&gt;pdf&lt;/FONT&gt; close;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;ods &lt;FONT color="#FF00FF"&gt;rtf&lt;/FONT&gt; file='c:\temp\final_report.&lt;FONT color="#FF00FF"&gt;rtf&lt;/FONT&gt;';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;...insert REPORT code here;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;ods &lt;FONT color="#FF00FF"&gt;rtf&lt;/FONT&gt; close;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my approach.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="restructure_data_then_report.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33483i064C043A7E85D787/image-size/large?v=v2&amp;amp;px=999" role="button" title="restructure_data_then_report.png" alt="restructure_data_then_report.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this gives you an alternate idea for a solution.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 19:06:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Custom-PDF-RTF-Output/m-p/600501#M173598</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-10-30T19:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Custom PDF/RTF Output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Custom-PDF-RTF-Output/m-p/601430#M173961</link>
      <description>&lt;P&gt;Thanks Cynthia. Appreciated your efforts, time and elegant solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your solutions is accepted.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 16:30:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Custom-PDF-RTF-Output/m-p/601430#M173961</guid>
      <dc:creator>anirdesh</dc:creator>
      <dc:date>2019-11-04T16:30:47Z</dc:date>
    </item>
  </channel>
</rss>

