Help using Base SAS procedures

Removing asterick from the field

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 90
Accepted Solution

Removing asterick from the field

Hi ,

I have a field name called provno,

PROVNO

123456789

*67890077

*67890642

879645700

098754376

*90875535

Some of the provno  starts with *, i need to eliminate those * from the provno.

Output should be ,

123456789

67890077

67890642

879645700

098754376

90875535

Thanks


Accepted Solutions
Solution
‎09-16-2011 11:36 PM
Super User
Posts: 10,041

Removing asterick from the field

data x;
input PROVNO $10.;
cards;
123456789
*67890077
*67890642
879645700
;
run;
proc sql;
 select *
  from x
   where provno net '*';
quit;

Ksharp

View solution in original post


All Replies
Trusted Advisor
Posts: 1,301

Removing asterick from the field

compress(provno,'*');

Frequent Contributor
Posts: 90

Removing asterick from the field

In case if i want to remove whole provno that starts with * means ?

Please let me know.

Thanks

Frequent Contributor
Posts: 90

Removing asterick from the field

Yes i got it.. i have used not equal function as below,

proc sql;

select provno from test

where substr(provno,1,1) <> '*';

quit;

Solution
‎09-16-2011 11:36 PM
Super User
Posts: 10,041

Removing asterick from the field

data x;
input PROVNO $10.;
cards;
123456789
*67890077
*67890642
879645700
;
run;
proc sql;
 select *
  from x
   where provno net '*';
quit;

Ksharp

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 129 views
  • 3 likes
  • 3 in conversation