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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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