BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

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
Meteorite | Level 14

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
Meteorite | Level 14

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.

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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