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

Hi, I have percentage data but in character format. I'm using this code to transform it:

data monic.fondorfdol;

set work.fondorfdol;

tir1=input(tir,percent5.5);

run;

But I don't get the exact number, for example, these are original values:

5.8077%

1.7514%

After the transformation, I get:

5.807

1.751

It's not necessary the percetange symbol, but I want to have all decimal numbers, is it possible?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

data monic.fondorfdol;

  set work.fondorfdol;

  tir1=input(tir,percent.);

run;

View solution in original post

3 REPLIES 3
art297
Opal | Level 21

data monic.fondorfdol;

  set work.fondorfdol;

  tir1=input(tir,percent.);

run;

fri0
Quartz | Level 8

Thank you very much, I always thought that I have to specify the width of the value.

art297
Opal | Level 21

The number after the period in an informat isn't the number of decimal places. According to the documentation: the number specifies an optional decimal scaling factor in the numeric informats. SAS divides the input data by 10 to the power of d.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3 replies
  • 812 views
  • 1 like
  • 2 in conversation