O'Reilly logo

PROC TEMPLATE Made Easy by Kevin Smith

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Putting It All Together

Rather than drill another sashelp.class example through your brain, let’s try something a little more fun: sashelp.cars. The sashelp.cars data set has lots of information about specific makes and models of cars, including engine and drivetrain details, mileage, body type, wheelbase, price, etc. Let’s modify this data set to shop for a new car. We’ll start with looking for only non-convertible sports cars. Here is the data that we are starting with.

DATA cars;
  SET sashelp.cars(WHERE = (type = ‘Sports’ AND 
                            ^(model LIKE ‘%convert%’)));
run;    

PROC TEMPLATE;
DEFINE TABLE mytable;>
END;
RUN;

%render(mytable, cars(OBS = 8));

This is the output from the code above.

The COLUMN statement is used to reduce the number of columns down ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required