Hi,
I have a character variable with length of 9 that starts with 6 digits followed by two letters and ending in one digit: 000000LL0.
I want to get rid of the last digit so that my new variable is of length 8 wihout the last digit, so convert var1 to var2:
| var1 | var2 |
| 000369AM0 | 000369AM |
| 000369AM2 | 000369AM |
| 000369AM7 | 000369AM |
| 000369AM3 | 000369AM |
| 700369AD1 | 700369AD |
| 700369AD5 | 700369AD |
What is the easiest way to do this?
Thanks !!!
Thanks so much.
This is probably easiest:
data want;
set have;
length var2 $ 8;
var2 = var1;
run;
Thanks so much.
Any change you could help me with this question as well?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.