Learning SAS? Welcome to the exclusive online community for all SAS learners.

Data Step not producing results

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Data Step not producing results

Hi everyone, I am working on lessons from SAS Programming 1 Essentials on SAS University and have encountered a problem and hoping someone can help me.


Scenario:

In lesson 6, practice question Level 1, I was able to produce the required results for questions 1-5. However, from question 6 through 8 I wasn't able. When I compare the codes I entered with the solutions provided I can't figure out why my method doesn't work.


For example the following is what I inputed:

/*QUESTION #6*/

DATA WORK.YOUNGADULT;

  SET ORION.CUSTOMER_DIM;

  WHERE CUSTOMER_GENDER='F' AND

   CUSTOMER_AGE BETWEEN 18 AND 36 AND

   CUSTOMER_GROUP CONTAINS 'GOLD';

RUN;

The solution provided by SAS is as follows:

data work.youngadult;

  set orion.customer_dim;

  where Customer_Gender='F' and

   Customer_Age between 18 and 36 and
  Customer_Group contains 'Gold'
;

run;

With my coding I am told I have 0 observations and 11 variables. The correct answer is having 5 observations and 11 variables.

Can anyone tell me what I am doing wrong? Is this because I am using all caps?

Your input and help would be appreciated. If there is any clarification needed please let me know.

Thanks


Accepted Solutions
Solution
‎10-20-2014 07:29 PM
Regular Contributor
Posts: 175

Re: Data Step not producing results

The contains operator is case-sensitive - if you change the word 'GOLD" to 'Gold' you should be fine.

View solution in original post


All Replies
Solution
‎10-20-2014 07:29 PM
Regular Contributor
Posts: 175

Re: Data Step not producing results

The contains operator is case-sensitive - if you change the word 'GOLD" to 'Gold' you should be fine.

New Contributor
Posts: 2

Re: Data Step not producing results

Thanks Chris!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 310 views
  • 0 likes
  • 2 in conversation