SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Data Manipulation

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 11
Accepted Solution

Data Manipulation

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


Accepted Solutions
Solution
‎11-17-2015 05:29 PM
Occasional Contributor
Posts: 11

Re: Data Manipulation

Thanks so much. 

View solution in original post


All Replies
Super User
Posts: 5,093

Re: Data Manipulation

This is probably easiest:

 

data want;

set have;

length var2 $ 8;

var2 = var1;

run;

Solution
‎11-17-2015 05:29 PM
Occasional Contributor
Posts: 11

Re: Data Manipulation

Thanks so much. 

Occasional Contributor
Posts: 11

Re: Data Manipulation

[ Edited ]
☑ This topic is solved.

Need further help from the community? Please ask a new question.

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