BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
4 REPLIES 4
SAS83
Fluorite | Level 6
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;
deleted_user
Not applicable
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
polingjw
Quartz | Level 8
if anyalpha(currentid)=1 then currentid=substr(currentid, 2);
deleted_user
Not applicable
Thanks Poling .. Its working

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 4 replies
  • 913 views
  • 0 likes
  • 3 in conversation