BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

 

proc freq data=rawdata noprint;
table year_cat * A--P  / trend norow nocol nopercent out=Output_of_trend;
run;

 

Dear all,

 

I have a code as written above.  I would like to produce the count result of all the variables from A to P such that it all gets to store in  output year_cat dataset. Is there any direct ODS option or any other method in sas to avail that.

under year-cat column i have multiple year categories like (2010-2012), (2013-2014), (2015-2018), (2019-2020)...... and multiple columns like A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P . So i have used A--P. But when i run the code it only captures results produced from year_cat*P in my output dataset where as in the result window it captures for all the variables from A to P.

 

Kindly share if any one knows any shortcut way by ODS or any other options   

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @sahoositaram555,

 

The ODS output datasets will contain the information from all tables year_cat * A, ..., year_cat * P.

 

ods select none;
ods output crosstabfreqs=freqs(drop=_table_ percent rowpercent colpercent)
           trendtest=trendtests;
proc freq data=rawdata;
table year_cat * A--P  / trend;
run;
ods select all;

View solution in original post

1 REPLY 1
FreelanceReinh
Jade | Level 19

Hello @sahoositaram555,

 

The ODS output datasets will contain the information from all tables year_cat * A, ..., year_cat * P.

 

ods select none;
ods output crosstabfreqs=freqs(drop=_table_ percent rowpercent colpercent)
           trendtest=trendtests;
proc freq data=rawdata;
table year_cat * A--P  / trend;
run;
ods select all;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 1 reply
  • 2915 views
  • 0 likes
  • 2 in conversation