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

Hello every one 

I have a small issue which is How to exclude some industry from my sample ?

as we know that SIC variable consists of numbers and alphabets (e.g., K1, G05, .. etc) 

when i use IF sentence 

data real; set rem;
if SIC=j66  then delete;
run;

it does not work 

i get this message 

NOTE: Variable j66 is uninitialized.

please how can do it 


 

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
Opal | Level 21

If you don't put quotes around a value then SAS assumes it is a variable hence the note about the variable not initialised:

data real; set rem;
if SIC='j66'  then delete;
run;

 

View solution in original post

4 REPLIES 4
SASKiwi
Opal | Level 21

If you don't put quotes around a value then SAS assumes it is a variable hence the note about the variable not initialised:

data real; set rem;
if SIC='j66'  then delete;
run;

 

Radwan
Quartz | Level 8
thanks
i got it
it works
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You need to put the string J66 in quotes exactly as it appears in the data:

data real; 
set rem; if sic='J66' then delete; run;

Or what may be quicker:
 

data real; 
set rem (where=(sic ne 'J66')); run;

 

Radwan
Quartz | Level 8
thaaaaaaaanx
it works

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 662 views
  • 0 likes
  • 3 in conversation