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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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