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-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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