BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
animesh123
Obsidian | Level 7

DATA temp;

set org;

if substr(terr,2,1)='9' then delete;

run;

the above code will drop if terr having 2nd letter in 9,

How to make sure to not drop  terr having (lets say) DAL flag as Y

 

thanks

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Please go back to your original message and provide a meaningful title that (briefly) describes the problem you have. Since almost all messages here could be said to want "help with below code", that doesn't make for a good title.

 

I agree with @Anne_A , I don't truly understand what you are looking for here. Can you explain further and/or give a few examples of what the code should do?

--
Paige Miller

View solution in original post

2 REPLIES 2
Anne_A
Quartz | Level 8

Not sure I understand your question. Could what you're looking for be

 

if (substr(terr,2,1)='9' AND DALFLAG ne 'Y') then delete;

 

?

PaigeMiller
Diamond | Level 26

Please go back to your original message and provide a meaningful title that (briefly) describes the problem you have. Since almost all messages here could be said to want "help with below code", that doesn't make for a good title.

 

I agree with @Anne_A , I don't truly understand what you are looking for here. Can you explain further and/or give a few examples of what the code should do?

--
Paige Miller
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
  • 739 views
  • 0 likes
  • 3 in conversation