BookmarkSubscribeRSS Feed
braak
Calcite | Level 5

I'm trying to clean up survey data that I have. There was a question on the survey that had a number of possible answers including "Other (please specify)". I'd like to be able to retrieve all of the responses for those who selected "other", and read what they wrote after "please specify". I just can't figure out what the command should be.

 

 

Appreciate the help!

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

There is no way we can possibly tell you.  Please review the guidance found under the post button, on how to post a quesiton.  Provide test data (in the form of a datastep), and what the output should look like.  Also show what you have done to date, provide log excerpts with any error/warning messages etc.

ballardw
Super User

@braak wrote:

I'm trying to clean up survey data that I have. There was a question on the survey that had a number of possible answers including "Other (please specify)". I'd like to be able to retrieve all of the responses for those who selected "other", and read what they wrote after "please specify". I just can't figure out what the command should be.

 

 

Appreciate the help!


Following is a skeleton program that you must modify:

proc print data=have;
   where questionresponse='Other (please specify)';
   var respondentid variablecontainingothertext;
run;

You have to change the data set name in place of have.

 

You must place the actual name of the variable that contains the "other specify" respons in place of questionresponse. the value in the quotes after the = must contain the value actually appearing in your data set. If it is a numeric code then no quotes, otherwise the text has to match exactly as it appears in your data set.

You must change the name of variablecontainingothertext with your SAS data set variable that contains the text.

I am assuming that you have some sort of respondent id variable, you include that as part of the output as it very often comes up handy for processing. (such as reducing the rambling text in the open end to an actual category that was provided as an answer).

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
  • 2 replies
  • 575 views
  • 1 like
  • 3 in conversation