BookmarkSubscribeRSS Feed
Ronein
Onyx | Level 15

Hello

I want to use proc report to display data.(No need to calculate because input data is ready to display).

I use proc report in order to merge data that repeat in columns:score  Model .(Merging cells)

For this task I use 'group' in define statement.

I see that it is not working well because only in 'score' column it is working  but in 'Model' column it is not working

 

Data tbl;
input Score  Model $ Customers Obligation;
cards;
0	A	5269	700
0	B	563	    2000
2	A	22712	7000
3	A	21412	4000
4	A	16766	3000
5	A	5634	1500
6	A	3169	800
7	A	2964	900
8	A	3033	800
9	A	1026	200
10	A	635	    150
11	A	4522	650
11	B	3	    20
12	A	11198	4000
12	B	53	    30
;
Run;

proc report data=tbl nowd headskip ; 
column Score Model Customers Obligation  ;
define Score / group ;   
define Model / group ;   
run ;
5 REPLIES 5
andreas_lds
Jade | Level 19

So, you don't get the expected output. But what exactly did you expect?

 

From the documentation of HEADSKIP:

  This option affects only the LISTING output. It has no affect on other ODS output.
Ronein
Onyx | Level 15

Thanks for you reply.

I expect that in column "Model"  cells with same value (for example value "A") will be merges into one cell.

 

andreas_lds
Jade | Level 19

@Ronein wrote:

Thanks for you reply.

I expect that in column "Model"  cells with same value (for example value "A") will be merges into one cell.

 


This won't happen because the values of "Score" change - i know no way to persuade ods to merge the cells, would be useful.

Ronein
Onyx | Level 15

So there is not way to do it??

 

ballardw
Super User

@Ronein wrote:

So there is not way to do it??

 


Can you provide what you would expect the output too look like with "merged cells" when there are no duplicates for the combination of score and model?

Perhaps you do not what score in that role. But Proc Report (or tabulate for that matter) aren't likely to have anything to "merge" when the combinations of values to "merge" do not have any duplicates.

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1403 views
  • 0 likes
  • 3 in conversation