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

Hello programmers,

 

I have a dataset in the form displayed in the pic and i am trying to select only observation in "Label1" that have the "Mean" and "Std Deviation".

 

Here's a syntax of the code i've written but i'm getting error messages.

861  Data moment11; set moment1;
862  If 'N''Skewness''Uncorrected SS' 'Coeff Variation' ne. Label1 then delete;
                                      -----------------
                                      388
                                      200
                                      76
ERROR 388-185: Expecting an arithmetic operator.

ERROR 200-322: The symbol is not recognized and will be ignored.

ERROR 76-322: Syntax error, statement will be ignored.

863  run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.MOMENT11 may be incomplete.  When this step was stopped there were 0
         observations and 12 variables.
WARNING: Data set WORK.MOMENT11 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.04 seconds

1.JPG

Data moment11; set moment1;
If 'N''Skewness''Uncorrected SS' 'Coeff Variation' ne. Label1 then delete;
run;

Please what's wrong with my code? I want to leave only observations with Mean and Std deviation in the dataset.

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

 I want to leave only observations with Mean and Std deviation in the dataset.

 

if label1 in ('Mean','Std Deviation');

Please note that (at least in the above code) capitalization, punctuation, location of spaces, etc. must exactly match the values in LABEL1.

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

 I want to leave only observations with Mean and Std deviation in the dataset.

 

if label1 in ('Mean','Std Deviation');

Please note that (at least in the above code) capitalization, punctuation, location of spaces, etc. must exactly match the values in LABEL1.

--
Paige Miller
ChuksManuel
Pyrite | Level 9

You rock. Thanks!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 980 views
  • 2 likes
  • 2 in conversation