Hi all,
I have a table A with a column amountA, which is character length 11
There is only one row where in this case amountA = "236761", but it could be "99999.09" (there can be decimals)
I want to transform it into numeric 20.2
So I do something like this:
PROC SQL;
CREATE TABLE B AS
SELECT
(input(t1.amountA,comma20.2)) FORMAT=20.2 AS Calculation
FROM A t1;
QUIT;In the output the value is 2367.61 => The amount have been divided by 100...
Whereas I need something like 236761 or 236761.00
Do you know how to manage it?
Thanks
Hi @FP12
If you simply use the below statement it should do the trick (I think :))
(input(t1.amountA,8.)) FORMAT=20.2 AS Calculation
Hope that helps.
Cheers,
Damo
Use 8. informat in your INPUT function instead.
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.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.