Dear Community,
I would like to use the SIZEKMG. format (quite obviously to show file sizes) but I seem to encounter a limitation: when the value becomes "bigger" (example attached) the shown value (both when opening the dataset and when generating a report) is made of * only.
Any hint?
Many thanks in advance
Anne.
data have;
format size sizekmg22.;
input size;
cards4;
5744099328
1785724928
28157399040
1741762461696
17674880794624
;;;;
run;
Hi @Anne_A
I ran into the same problem, so I made this custom format:
proc format library=library;
picture sizekmgt (round default=8)
low - 1023 = '0009 bt'
1024 - 1048575 = '009.9 KB' (mult = %sysevalf(10/1024))
1048576 - 1073741823 = '009.9 MB' (mult = %sysevalf(10/1048576))
1073741824 - 1099511627775 = '009.9 GB' (mult = %sysevalf(10/1073741824))
1099511627776 - high = '009.9 TB' (mult = %sysevalf(10/1099511627776))
;
run;
Generally, the first step I would recommend in situations like this is to check the documentation.
Hi @PaigeMiller ,
Actually I had checked the documentation. Your comment seems to imply I should find relevant info in there, but even after looking again I don't see any. Is there anything I should have noticed?
Hi @Anne_A
I ran into the same problem, so I made this custom format:
proc format library=library;
picture sizekmgt (round default=8)
low - 1023 = '0009 bt'
1024 - 1048575 = '009.9 KB' (mult = %sysevalf(10/1024))
1048576 - 1073741823 = '009.9 MB' (mult = %sysevalf(10/1048576))
1073741824 - 1099511627775 = '009.9 GB' (mult = %sysevalf(10/1073741824))
1099511627776 - high = '009.9 TB' (mult = %sysevalf(10/1099511627776))
;
run;
Awesome! Thank you so much @ErikLund_Jensen 😊!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.