BookmarkSubscribeRSS Feed
Kirito1
Quartz | Level 8
PROC REPORT DATA=FINAL_RESULT 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 "<U>Date wise :</U>" JUSTIFY=LEFT;

 

column Emp_Code DATE_OF_APPROVAL N TOTAL_COUNT;

 

define Emp_Code/DISPLAY "Employee Code" width=20  group order order=data style(column)=[font=("zurich BT",11pt)];
define DATE_OF_APPROVAL/DISPLAY "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 Qr Deployed" 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;

I was using the above code to get the desired result but it didn't work the way I wanted it to be.

Kirito1_0-1673504783366.png

The output I want is something like this:

Kirito1_1-1673504970953.png

So How can I get those dates up there as  columns in proc report? Can someone help......

Thanks in advance to all the contributors.

 

 

1 REPLY 1
Kurt_Bremser
Super User

You need to define the date as an ACROSS variable and combine it with the variable which should appear under it:

column emp_code n,date_of_approval;
define emp_code / group;
define n / analysis;
define date_of_approval / across;
run;

This is, of course, untested and just a suggestion. For detailed help, provide example data in a working data step with datalines.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 499 views
  • 0 likes
  • 2 in conversation