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

Evening all.

 

I have a data file called "hartland". There are 135 records, but I noticed that 33 of them have a "." in my PERMNO column. How do I remove these items and get my file down to 102 records?

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20
data filtered;
set temp.hartland;
if not index(PERMNO ,'.');
run;

View solution in original post

7 REPLIES 7
novinosrin
Tourmaline | Level 20
if not index(PERMNO ,'.');
anweinbe
Quartz | Level 8
data temp.hartland;
if not index (permno , '.');
run;

?
novinosrin
Tourmaline | Level 20
data filtered;
set temp.hartland;
if not index(PERMNO ,'.');
run;
anweinbe
Quartz | Level 8
Still showing 135 records and they are still there. Very odd.
novinosrin
Tourmaline | Level 20

Post your sample data plz

anweinbe
Quartz | Level 8

The last column has the "." in it. This is what I want to remove.

 

I put in this code:

 

 

data filtered;
set temp.hartland;
if not index(PERMNO ,'.');
run;

 

 

1Transcept Pharmaceuticals Inc.TSPTNovacea Inc.Marketwire01SEP2008H258920082.6232908319. 
anweinbe
Quartz | Level 8
It worked. I'm sorry Novinosrin! I looked at the wrong output file.

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
  • 7 replies
  • 721 views
  • 3 likes
  • 2 in conversation