libname ABCDEFGH postgres server="Server_Address.com" port=5432 user=kevin password="P@ssW0rd" database=DBName schema=SchemaName; Data work.my_data_file; Result_1 = trunc(0, 1); Result_2 = trunc(10, 2); Result_3 = trunc(100, 3); Result_4 = trunc(1000, 4); Result_5 = trunc(1000.0353, 5); Result_6 = trunc(1000.0353849432929, 5); Result_7 = trunc(0, 1); Result_8 = trunc(-10, 2); Result_9 = trunc(-100, 3); Result_10 = trunc(-1000, 4); Result_11 = trunc(-1000.0353, 5); Result_12 = trunc(-1000.0353849432929, 5); run; proc print data=my_data_file; run; |
What's happening in the script above?
Variable | Input | Output | Description |
---|---|---|---|
Result 1 | 0, 1 | . | |
Result 2 | 10, 2 | . | |
Result 3 | 100, 3 | 100 | |
Result 4 | 1000, 4 | 1000 | |
Result 5 | 1000.0353, 5 | 1000.0352993 | |
Result 6 | 1000.0353849432929, 5 | 1000.0353832 | |
Result 7 | 0, 1 | . | |
Result 8 | -10, 2 | . | |
Result 9 | -100, 3 | -100 | |
Result 10 | -1000, 4 | -1000 | |
Result 11 | -1000.0353849432929, 5 | -1000.035383 | |
Kevin Regan
Have an article, idea, found a typo, want to contribute? Shoot me an email
Here
Below are links to some Udemy Data Science Courses. I've been using Udemy for a number of years now, and I've found their courses super helpful, maybe you will also.