<?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 New variable to do report alignment in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/New-variable-to-do-report-alignment/m-p/666058#M199231</link>
    <description>&lt;P&gt;Dear experts.&lt;/P&gt;&lt;P&gt;I have a requirement to create a new variable to use it in my proc report to do the alignment as per data&lt;/P&gt;&lt;P&gt;the requirement is&lt;/P&gt;&lt;P&gt;I want to create pnum variable&amp;nbsp; to get each test in one page in the report (i.e in one page different tests should not come) but in one page it can accommodate only 5 records .So that Iam creating pnum for first 5 test as 1 and next till the end of same test should be 2 .&amp;nbsp;&lt;/P&gt;&lt;P&gt;same like for the next test "urin" first 5 is 3 and the rest is 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;like that i have so many tests ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if i create a variable like this I can use that in the report as page break&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;x&amp;nbsp; test&amp;nbsp; &amp;nbsp; r&amp;nbsp; pnum&lt;/P&gt;&lt;P&gt;1 blood 1&amp;nbsp; &amp;nbsp;1&lt;BR /&gt;1 blood 2&amp;nbsp; &amp;nbsp;1&lt;BR /&gt;1 blood 3&amp;nbsp; &amp;nbsp;1&lt;BR /&gt;1 blood 4&amp;nbsp; &amp;nbsp;1&lt;BR /&gt;1 blood 5&amp;nbsp; &amp;nbsp;1&lt;BR /&gt;1 blood 6&amp;nbsp; &amp;nbsp;2&lt;BR /&gt;1 blood 7&amp;nbsp; &amp;nbsp;2&lt;BR /&gt;1 blood 8&amp;nbsp; &amp;nbsp;2&lt;BR /&gt;2 urin&amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp;3&lt;BR /&gt;2 urin 10&amp;nbsp; &amp;nbsp;3&lt;BR /&gt;2 urin 11&amp;nbsp; &amp;nbsp;3&lt;BR /&gt;2 urin 12&amp;nbsp; &amp;nbsp;3&lt;BR /&gt;2 urin 13&amp;nbsp; &amp;nbsp;3&lt;BR /&gt;2 urin 14&amp;nbsp; &amp;nbsp;4&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jun 2020 12:36:24 GMT</pubDate>
    <dc:creator>ambadi007</dc:creator>
    <dc:date>2020-06-30T12:36:24Z</dc:date>
    <item>
      <title>New variable to do report alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/New-variable-to-do-report-alignment/m-p/666058#M199231</link>
      <description>&lt;P&gt;Dear experts.&lt;/P&gt;&lt;P&gt;I have a requirement to create a new variable to use it in my proc report to do the alignment as per data&lt;/P&gt;&lt;P&gt;the requirement is&lt;/P&gt;&lt;P&gt;I want to create pnum variable&amp;nbsp; to get each test in one page in the report (i.e in one page different tests should not come) but in one page it can accommodate only 5 records .So that Iam creating pnum for first 5 test as 1 and next till the end of same test should be 2 .&amp;nbsp;&lt;/P&gt;&lt;P&gt;same like for the next test "urin" first 5 is 3 and the rest is 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;like that i have so many tests ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if i create a variable like this I can use that in the report as page break&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;x&amp;nbsp; test&amp;nbsp; &amp;nbsp; r&amp;nbsp; pnum&lt;/P&gt;&lt;P&gt;1 blood 1&amp;nbsp; &amp;nbsp;1&lt;BR /&gt;1 blood 2&amp;nbsp; &amp;nbsp;1&lt;BR /&gt;1 blood 3&amp;nbsp; &amp;nbsp;1&lt;BR /&gt;1 blood 4&amp;nbsp; &amp;nbsp;1&lt;BR /&gt;1 blood 5&amp;nbsp; &amp;nbsp;1&lt;BR /&gt;1 blood 6&amp;nbsp; &amp;nbsp;2&lt;BR /&gt;1 blood 7&amp;nbsp; &amp;nbsp;2&lt;BR /&gt;1 blood 8&amp;nbsp; &amp;nbsp;2&lt;BR /&gt;2 urin&amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp;3&lt;BR /&gt;2 urin 10&amp;nbsp; &amp;nbsp;3&lt;BR /&gt;2 urin 11&amp;nbsp; &amp;nbsp;3&lt;BR /&gt;2 urin 12&amp;nbsp; &amp;nbsp;3&lt;BR /&gt;2 urin 13&amp;nbsp; &amp;nbsp;3&lt;BR /&gt;2 urin 14&amp;nbsp; &amp;nbsp;4&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 12:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/New-variable-to-do-report-alignment/m-p/666058#M199231</guid>
      <dc:creator>ambadi007</dc:creator>
      <dc:date>2020-06-30T12:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: New variable to do report alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/New-variable-to-do-report-alignment/m-p/666075#M199234</link>
      <description>&lt;P&gt;Hi &lt;A class="trigger-hovercard" style="color: #007dc3;" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76823" target="_blank"&gt;ambadi007&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can do this as shown in the code example below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data A;
   length x 8 test $10;
   input x test;
   datalines;
1 blood
1 blood
1 blood
1 blood
1 blood
1 blood
1 blood
1 blood
2 urin 
2 urin
2 urin
2 urin
2 urin
2 urin
;

proc sort data=A out=B;
   by x;
run;

data C (drop=count);
   set B;
   by x;
   r = _n_;
   if first.x then count=0;
   count + 1;
   if mod(count-1, 5)=0 then pnum + 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 13:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/New-variable-to-do-report-alignment/m-p/666075#M199234</guid>
      <dc:creator>LeonidBatkhan</dc:creator>
      <dc:date>2020-06-30T13:37:19Z</dc:date>
    </item>
  </channel>
</rss>

