<?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 Manipulating Proc Report in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Manipulating-Proc-Report/m-p/853624#M37558</link>
    <description>&lt;P&gt;I was working on a data for which I have to generate a report using sas.&lt;/P&gt;&lt;P&gt;The below code and data screenshot are provided.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC SQL;
CREATE TABLE DESIRED_OUTPUT AS
SELECT  T1.*, T2.*, T3.*, T4.*
FROM FINAL_RESULT1 T1
LEFT JOIN FR3 T2 ON (T1.Emp_Code)=(T2.FIN_EMP_CODE)
LEFT JOIN FRA3 T3 ON (T1.Emp_Code)=(T3.FIN_EMP_CODE)
LEFT JOIN FRU3 T4 ON (T1.Emp_Code)=(T4.FIN_EMP_CODE);
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kirito1_0-1673593188446.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79340iB7A57B4B063CBA01/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kirito1_0-1673593188446.png" alt="Kirito1_0-1673593188446.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now, Desired Output in proc report what I expected is something like below First EMP_code followed by frequency&amp;nbsp; of 10JAN2023 then 11JAN2023 then 12JAN2023 and followed by total of 1JAN2023 till today frequency total.:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MicrosoftTeams-image (1).png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79341i943C0074F1157168/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MicrosoftTeams-image (1).png" alt="MicrosoftTeams-image (1).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The result I am getting is somewhat absurd.....The code for proc report and result are pasted as screenshot:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC REPORT DATA=DESIRED_OUTPUT nowd spanrows
style(report)=[JUST=CENTER OUTPUTWIDTH=95% CELLSPACING=2 BORDERCOLOR=BLACK BORDERWIDTH=2]
STYLE(HEADER)={BORDERCOLOR=BLACK FOREGROUND=WHITE BACKGROUND=MAROON FONT=("zurich BT",11pt)}
STYLE(COLUMN)={TAGATTR="WRAP" JUST=CENTER FONT=("zurich BT",08pt) OUTPUTWIDTH=0.05IN BACKGROUND=LIGHTYELLOW
FOREGROUND=BLACK BORDERCOLOR=BLACK};
TITLE FONT="Zurich BT" bold height=6 "&amp;lt;U&amp;gt;Date wise :&amp;lt;/U&amp;gt;" JUSTIFY=LEFT;


col (Emp_Code) (DATE_OF_APPROVAL) (N) (TOTAL_COUNT) (target);


define Emp_Code/DISPLAY "Employee Code" width=20  group order order=data style(column)=[font=("zurich BT",11pt)];
define DATE_OF_APPROVAL/'' ACROSS NOZERO ORDER=INTERNAL "DOA" width=10 style(column)=[font=("zurich BT",11pt)];
define N/ANALYSIS "Count datewise" format=comma11. style(column)=[TAGATTR="WRAP" JUST=RIGHT font=("zurich BT",11pt)];
define TOTAL_COUNT/ANALYSIS "Total from JAN till date" format=comma11. style(column)=[TAGATTR="WRAP" JUST=RIGHT font=("zurich BT",11pt)];
define target/ANALYSIS "TARGET" format=comma11. style(column)=[TAGATTR="WRAP" JUST=RIGHT font=("zurich BT",11pt)];

rbreak after /summarize ol skip;
compute after;
       if _BREAK_ eq '_RBREAK_' then do; 
        RESPYM = 'Total';
        CALL DEFINE(_ROW_ ,"style","style=[BACKGROUND=MAROON FOREGROUND=WHITE]");
    end;
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;RESULT:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;All I want is for 'N' or 'Count datewise' to show under their respective dates.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kirito1_0-1673593885964.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79342i7BE6EA26E13F0483/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kirito1_0-1673593885964.png" alt="Kirito1_0-1673593885964.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You in advance for all the contributors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jan 2023 07:12:59 GMT</pubDate>
    <dc:creator>Kirito1</dc:creator>
    <dc:date>2023-01-13T07:12:59Z</dc:date>
    <item>
      <title>Manipulating Proc Report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Manipulating-Proc-Report/m-p/853624#M37558</link>
      <description>&lt;P&gt;I was working on a data for which I have to generate a report using sas.&lt;/P&gt;&lt;P&gt;The below code and data screenshot are provided.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC SQL;
CREATE TABLE DESIRED_OUTPUT AS
SELECT  T1.*, T2.*, T3.*, T4.*
FROM FINAL_RESULT1 T1
LEFT JOIN FR3 T2 ON (T1.Emp_Code)=(T2.FIN_EMP_CODE)
LEFT JOIN FRA3 T3 ON (T1.Emp_Code)=(T3.FIN_EMP_CODE)
LEFT JOIN FRU3 T4 ON (T1.Emp_Code)=(T4.FIN_EMP_CODE);
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kirito1_0-1673593188446.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79340iB7A57B4B063CBA01/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kirito1_0-1673593188446.png" alt="Kirito1_0-1673593188446.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now, Desired Output in proc report what I expected is something like below First EMP_code followed by frequency&amp;nbsp; of 10JAN2023 then 11JAN2023 then 12JAN2023 and followed by total of 1JAN2023 till today frequency total.:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MicrosoftTeams-image (1).png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79341i943C0074F1157168/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MicrosoftTeams-image (1).png" alt="MicrosoftTeams-image (1).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The result I am getting is somewhat absurd.....The code for proc report and result are pasted as screenshot:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC REPORT DATA=DESIRED_OUTPUT nowd spanrows
style(report)=[JUST=CENTER OUTPUTWIDTH=95% CELLSPACING=2 BORDERCOLOR=BLACK BORDERWIDTH=2]
STYLE(HEADER)={BORDERCOLOR=BLACK FOREGROUND=WHITE BACKGROUND=MAROON FONT=("zurich BT",11pt)}
STYLE(COLUMN)={TAGATTR="WRAP" JUST=CENTER FONT=("zurich BT",08pt) OUTPUTWIDTH=0.05IN BACKGROUND=LIGHTYELLOW
FOREGROUND=BLACK BORDERCOLOR=BLACK};
TITLE FONT="Zurich BT" bold height=6 "&amp;lt;U&amp;gt;Date wise :&amp;lt;/U&amp;gt;" JUSTIFY=LEFT;


col (Emp_Code) (DATE_OF_APPROVAL) (N) (TOTAL_COUNT) (target);


define Emp_Code/DISPLAY "Employee Code" width=20  group order order=data style(column)=[font=("zurich BT",11pt)];
define DATE_OF_APPROVAL/'' ACROSS NOZERO ORDER=INTERNAL "DOA" width=10 style(column)=[font=("zurich BT",11pt)];
define N/ANALYSIS "Count datewise" format=comma11. style(column)=[TAGATTR="WRAP" JUST=RIGHT font=("zurich BT",11pt)];
define TOTAL_COUNT/ANALYSIS "Total from JAN till date" format=comma11. style(column)=[TAGATTR="WRAP" JUST=RIGHT font=("zurich BT",11pt)];
define target/ANALYSIS "TARGET" format=comma11. style(column)=[TAGATTR="WRAP" JUST=RIGHT font=("zurich BT",11pt)];

rbreak after /summarize ol skip;
compute after;
       if _BREAK_ eq '_RBREAK_' then do; 
        RESPYM = 'Total';
        CALL DEFINE(_ROW_ ,"style","style=[BACKGROUND=MAROON FOREGROUND=WHITE]");
    end;
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;RESULT:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;All I want is for 'N' or 'Count datewise' to show under their respective dates.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kirito1_0-1673593885964.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79342i7BE6EA26E13F0483/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kirito1_0-1673593885964.png" alt="Kirito1_0-1673593885964.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You in advance for all the contributors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 07:12:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Manipulating-Proc-Report/m-p/853624#M37558</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2023-01-13T07:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Manipulating Proc Report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Manipulating-Proc-Report/m-p/853646#M37559</link>
      <description>&lt;P&gt;We cannot code against screen shots. How you build your data set if we do not have the data to start with is next to irrelevant.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;/&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nesting columns is not really proc reports strong point, i.e. N (or Count whatever) within date for example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See if this gets anywhere near close.&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=desired_output;
   class emp_code date_of_approval;
   var target;
   table empcode,
         (date_of_approval='DOA' All='Total From Jan')*n=' '
          target*sum=' '
   ;
run;&lt;/PRE&gt;
&lt;P&gt;Caution: If you use variable names like N it becomes doubly important to provide example data as we can't tell when you are using your variable or the Statistic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 10:28:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Manipulating-Proc-Report/m-p/853646#M37559</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-01-13T10:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Manipulating Proc Report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Manipulating-Proc-Report/m-p/853653#M37560</link>
      <description>&lt;P&gt;As requested by me earlier, and by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; as well, we need data as working SAS data step code. We cannot write working code from screen captures. Please do not ignore these requests further. We're trying to help you, but you have to help us.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can nest average and N under the year in PROC REPORT, if your data is set up properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example: if you have a column named YEAR and a column named MEAN and a column named TOTAL_COUNT, then in PROC REPORT you could use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;columns emp_code year,(mean total_count);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where YEAR is defined as an across variable.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 11:04:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Manipulating-Proc-Report/m-p/853653#M37560</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-01-13T11:04:28Z</dc:date>
    </item>
  </channel>
</rss>

