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

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;

SIZEKMG.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
ErikLund_Jensen
Rhodochrosite | Level 12

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;

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

Generally, the first step I would recommend in situations like this is to check the documentation.

 

SIZEKMG FORMAT

 

 

--
Paige Miller
Anne_A
Quartz | Level 8

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?

ErikLund_Jensen
Rhodochrosite | Level 12

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;
Anne_A
Quartz | Level 8

Awesome! Thank you so much @ErikLund_Jensen 😊!

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

How to Concatenate Values

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 361 views
  • 3 likes
  • 3 in conversation