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

This may be a very simple question and maybe my newness to SAS is shining through, but I tried to do some research and haven't been able to find an answer. 

I have been working on redoing an existing PROC SQL program to change it to a PROC MEANS program, with great success.  I have already been able to reduce the time it takes the program to run from about 3-4 hours down to 3-4 minutes.  I have hit a bit of a wall though with trying to add one of the variables in the dataset to my CLASS statement.  The name of the existing variable is Channel(Finance Method), which the PROC SQL program seems to be able to handle okay, but my PROC MEANS statement doesn't allow and errors out.  In the PROC SQL command it was simply included with single quotes, which doesn't work for PROC MEANS.

Does anyone have any ideas how I could include this variable in my class statement?  Because of the size of the data set I can't really create a new data set just for this one problem, so I am trying to figure out how to work with the existing data set and read in this variable as part of my program.

The current report actually changes the variable to "Channel" for the final report, so I am okay with manipulating the data.

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

Code: Program

options validvarname=any;
proc means data=x nway;
class 'Channel(Finance Method)'n;
var x;
run;

View solution in original post

1 REPLY 1
Ksharp
Super User

Code: Program

options validvarname=any;
proc means data=x nway;
class 'Channel(Finance Method)'n;
var x;
run;

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1659 views
  • 1 like
  • 2 in conversation