<?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 how to write the input to next line when missing value is found in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-write-the-input-to-next-line-when-missing-value-is-found/m-p/30856#M4631</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; You do not say what your required output is:&lt;/P&gt;&lt;P&gt;1) a data set?&lt;/P&gt;&lt;P&gt;2) a report?&lt;/P&gt;&lt;P&gt;3) if a report, what is your destination of choice? (HTML, RTF, PDF, etc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you are posting this to the ODS and Reporting forum, I figure you must want a report, especially since your asks about "writing" to a new line -- which suggests a report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could accomplish a report with a DATA step program, but it would probably be much easier to use a PROC TRANSPOSE to rotate your dataset from "wide" to "long" and then just use PROC PRINT to print the new structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Mar 2012 12:51:28 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2012-03-14T12:51:28Z</dc:date>
    <item>
      <title>how to write the input to next line when missing value is found</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-write-the-input-to-next-line-when-missing-value-is-found/m-p/30855#M4630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My dataset is like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;id&amp;nbsp; record1-record4&lt;/P&gt;&lt;P&gt;1 23 . . .&lt;/P&gt;&lt;P&gt;2 24 34 45 46&lt;/P&gt;&lt;P&gt;3 65 76 . .&lt;/P&gt;&lt;P&gt;4 42 . . .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want O/p as follows,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;id&amp;nbsp; record&lt;/P&gt;&lt;P&gt;1 23&lt;/P&gt;&lt;P&gt;2 24&lt;/P&gt;&lt;P&gt;2 34&lt;/P&gt;&lt;P&gt;2 45&lt;/P&gt;&lt;P&gt;2 46&lt;/P&gt;&lt;P&gt;3 65&lt;/P&gt;&lt;P&gt;3 76&lt;/P&gt;&lt;P&gt;4 42&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any one help me in achieving this please.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2012 03:37:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-write-the-input-to-next-line-when-missing-value-is-found/m-p/30855#M4630</guid>
      <dc:creator>shru</dc:creator>
      <dc:date>2012-03-14T03:37:54Z</dc:date>
    </item>
    <item>
      <title>how to write the input to next line when missing value is found</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-write-the-input-to-next-line-when-missing-value-is-found/m-p/30856#M4631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; You do not say what your required output is:&lt;/P&gt;&lt;P&gt;1) a data set?&lt;/P&gt;&lt;P&gt;2) a report?&lt;/P&gt;&lt;P&gt;3) if a report, what is your destination of choice? (HTML, RTF, PDF, etc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you are posting this to the ODS and Reporting forum, I figure you must want a report, especially since your asks about "writing" to a new line -- which suggests a report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could accomplish a report with a DATA step program, but it would probably be much easier to use a PROC TRANSPOSE to rotate your dataset from "wide" to "long" and then just use PROC PRINT to print the new structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2012 12:51:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-write-the-input-to-next-line-when-missing-value-is-found/m-p/30856#M4631</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-03-14T12:51:28Z</dc:date>
    </item>
    <item>
      <title>how to write the input to next line when missing value is found</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-write-the-input-to-next-line-when-missing-value-is-found/m-p/30857#M4632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your objective is to re-shape an existing SAS data set, here's one way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data new;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set old;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; array all4 {4} record1-record4;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do _n_=1 to 4;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if all4{_n_} &amp;gt; . then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; record = all4{_n_};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; keep id record;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have some other objective in mind, just let us know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2012 15:04:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-write-the-input-to-next-line-when-missing-value-is-found/m-p/30857#M4632</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-03-14T15:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to write the input to next line when missing value is found</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-write-the-input-to-next-line-when-missing-value-is-found/m-p/30858#M4633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FWIW:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _n_=1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dcl hash h(multidata:'y', ordered:'a');&lt;/P&gt;&lt;P&gt; h.definekey('id');&lt;/P&gt;&lt;P&gt; h.definedata('id','record');&lt;/P&gt;&lt;P&gt; h.definedone();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set have end=done;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array r record1-record4;&lt;/P&gt;&lt;P&gt; do over r;&lt;/P&gt;&lt;P&gt; record=r;&lt;/P&gt;&lt;P&gt; if not missing (r) then rc=h.add();&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (done) then h.output(dataset: 'want');&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2012 15:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-write-the-input-to-next-line-when-missing-value-is-found/m-p/30858#M4633</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-03-14T15:25:04Z</dc:date>
    </item>
  </channel>
</rss>

