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

Hi,

How can I delete fist zero in variable ID_var it is charecter variable.

 

This is i have

IDDPLID_var
1233964309980000000010000100
1234531323310000000010006377
1237805397910000000010042044
140434413280000000010049190

This I want

IDD

PL

ID_var

1233964

30998

10000100

1234531

32331

10006377

1237805

39791

10042044

140434

41328

10049190

Does anybody know?

1 ACCEPTED SOLUTION
6 REPLIES 6
FredrikE
Rhodochrosite | Level 12

Try this:

data test;

length id_var $32;

input id_var;

id_var = strip(put(input(id_var,32.),32.));

datalines;

0000000010000100

0000000010006377

0000000010042044

0000000010049190

;

run;

jopo12345678
Calcite | Level 5

I would like to change it to numeric variable without datalines statement.

kiranv_
Rhodochrosite | Level 12
jopo12345678
Calcite | Level 5

I would like to change it to numeric variable...is there any option?

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
  • 6 replies
  • 1030 views
  • 1 like
  • 4 in conversation