BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
katie80
Fluorite | Level 6

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 !!!

1 ACCEPTED SOLUTION

Accepted Solutions
katie80
Fluorite | Level 6

Thanks so much. 

View solution in original post

3 REPLIES 3
Astounding
PROC Star

This is probably easiest:

 

data want;

set have;

length var2 $ 8;

var2 = var1;

run;

katie80
Fluorite | Level 6

Thanks so much. 

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!

How to connect to databases in SAS Viya

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.

Discussion stats
  • 3 replies
  • 818 views
  • 0 likes
  • 2 in conversation