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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 666 views
  • 0 likes
  • 3 in conversation