Help using Base SAS procedures

sql

Reply
N/A
Posts: 0

sql

Hi ,

I need to remove from the output file all ID that have an alpha at the beginning of their id number.

currently in the program ,
provnos = substr(provno,1,15);

Current ID Modify ID
A119966-A85 119966-A85
A119966-B85 119966-B85
A121065-A31 121065-A31
A123206-A18 123206-A18
A123206-B18 123206-B18

Thanks in Advance
Contributor
Posts: 32

Re: sql

Posted in reply to deleted_user
data x;
length currentID$ 15.;
input CurrentID$;
cards;
A119966-A85
A119966-B85
A121065-A31
A123206-A18
A123206-B18
;
run;
data y;
set x;

new = substr(CurrentID,2,12);
run;
N/A
Posts: 0

Re: sql

Ravi,

Can you let me know wat to do in this case if we need to remove just A on the report,

Current ID Modify ID
1196645 889765
789765 879643
A119966-A85 119966-A85
A119966-B85 119966-B85
A121065-A31 121065-A31
A123206-A18 123206-A18
A123206-B18 123206-B18


Thanks,
sudha
Regular Contributor
Posts: 171

Re: sql

Posted in reply to deleted_user
if anyalpha(currentid)=1 then currentid=substr(currentid, 2);
N/A
Posts: 0

Re: sql

Thanks Poling .. Its working
Ask a Question
Discussion stats
  • 4 replies
  • 130 views
  • 0 likes
  • 3 in conversation