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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

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