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).
Thanks in advance
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;
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;
Thanks Shmuel
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.