BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
buddha_d
Pyrite | Level 9

Guys, I have building a report as shown below. Can anyone help me to obtain that? 

data cars (DROP=MODEL);
	set sashelp.cars;
run;

PROC SQL;
	CREATE TABLE HAVE AS 
	SELECT make,origin,type,drivetrain,Cylinders,enginesize,MSRP,invoice,horsepower,
			WEIGHT,WHEELBASE,LENGTH
	FROM CARS
	WHERE MAKE='Audi'
	GROUP BY MAKE,ORIGIN,TYPE,DRIVETRAIN,CYLINDERS
	order by MAKE,ORIGIN,TYPE,DRIVETRAIN,CYLINDERS
	;
QUIT;

I want my output to look like this either in SAS or excel (prior to proc export step).

buddha_d_0-1598677544063.png

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Shmuel
Garnet | Level 18
proc report data=have nofs headline;
   column make origin type drivetrain Cylinders enginesize
          MSRP invoice horsepower WEIGHT WHEELBASE LENGTH;
   define make / order;
   define origin  / order;
   define type  / order;
   define drivetrain  / order;
   define Cylinders  / order;
   define enginesize / display;
   define MSRP / display;
   define invoice / display;
   define horsepower / display;
   define WEIGHT / display;
   define WHEELBASE / display;
   define LENGTH / display;
run;

View solution in original post

2 REPLIES 2
Shmuel
Garnet | Level 18
proc report data=have nofs headline;
   column make origin type drivetrain Cylinders enginesize
          MSRP invoice horsepower WEIGHT WHEELBASE LENGTH;
   define make / order;
   define origin  / order;
   define type  / order;
   define drivetrain  / order;
   define Cylinders  / order;
   define enginesize / display;
   define MSRP / display;
   define invoice / display;
   define horsepower / display;
   define WEIGHT / display;
   define WHEELBASE / display;
   define LENGTH / display;
run;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 2 replies
  • 493 views
  • 1 like
  • 2 in conversation