BookmarkSubscribeRSS Feed
Tejaswini3
Obsidian | Level 7

I want to combine below table.

In table is as 

ColA

ColB

ColC

India

Yes

15

India

No

17

Europe

Yes

13

Europe

No

20

 

Output should be  

ColD

ColC

India

 

Yes

15

No

17

Europe

 

Yes

13

No

20

Kindly suggst SAS code

3 REPLIES 3
Kurt_Bremser
Super User

Since a dataset with this layout is useless for further analysis work, I ask again (like in your other thread): is this supposed to be a report? And how is such a report to be distributed?

Tejaswini3
Obsidian | Level 7
After generation of final table. Need to use report statment for report generation.
Kurt_Bremser
Super User

There is no REPORT statement, but there is a REPORT procedure.

You can use PROC REPORT directly off your dataset:

data have;
input
  ColA $
  ColB $
  ColC
;
datalines;
India Yes 15
India No 17
Europe Yes 13
Europe No 20
;

proc report data=have;
column cola colb colc;
define cola / group noprint;
define colb / group;
define colc / analysis;
compute before cola / style=[textalign=l];
  line cola $8.;
endcomp;
run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 524 views
  • 0 likes
  • 2 in conversation