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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 2374 views
  • 0 likes
  • 2 in conversation