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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 202 views
  • 0 likes
  • 3 in conversation