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;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 2555 views
  • 0 likes
  • 2 in conversation