Assuming dataset table1 has field1, how can I use proc contents inside proc report? Or is there any way to display all the columns of the dataset without actually specifying the field names?
PROC REPORT data=table1 nowd split='\' nocenter;
COLUMN
(
proc contents data = table1 varnum short;
run;
)
by fieldname1;
TITLE1 "Comparison";
RUN;
You don't specify any, defaults are an awesome thing.
proc sort data=sashelp.class out=class;
by sex;
proc report data=class;
by sex;
run;
If you don't specify any, it defaults to all variables, similar to PROC REPORT.
@bhu wrote:
Assuming dataset table1 has field1, how can I use proc contents inside proc report? Or is there any way to display all the columns of the dataset without actually specifying the field names?
PROC REPORT data=table1 nowd split='\' nocenter;
COLUMN
(
proc contents data = table1 varnum short;
run;)
by fieldname1;
TITLE1 "Comparison";
RUN;
You don't specify any, defaults are an awesome thing.
proc sort data=sashelp.class out=class;
by sex;
proc report data=class;
by sex;
run;
If you don't specify any, it defaults to all variables, similar to PROC REPORT.
@bhu wrote:
Assuming dataset table1 has field1, how can I use proc contents inside proc report? Or is there any way to display all the columns of the dataset without actually specifying the field names?
PROC REPORT data=table1 nowd split='\' nocenter;
COLUMN
(
proc contents data = table1 varnum short;
run;)
by fieldname1;
TITLE1 "Comparison";
RUN;
Awesome Reeza. Thank you a lot for such an easy solution. I have changed the accepted solution to your reply.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
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.