While PROC FORMAT helps in dividing dataset in desired categories with PUT() as:
PROC FORMAT;
value Buckets
low -< 1 = 'Bucket 1'
1 -< 30 = 'Bucket 2'
30 -< 60 = 'Bucket 3'
60 -< 90 = 'Bucket 4'
90 -< 120 = 'Bucket 5'
120 -< 150 = 'Bucket 6'
150 -< 180 = 'Bucket 7'
180 -< 210 = 'Bucket 8'
210 -< 240 = 'Bucket 9'
240 -< 270 = 'Bucket 10'
270 -< 300 = 'Bucket 11'
300 -< 330 = 'Bucket 12'
330 -< 360 = 'Bucket 13'
360 - High = 'Bucket 14'
;
run;
Could a dataset be returned to represent all the buckets declared above even no entry exists in the same. Something like:
Bucket 1 | 3615833 |
Bucket 2 | 11899480 |
Bucket 3 | . |
Bucket 4 | 1340713 |
Bucket 5 | 2618488 |
Bucket 6 | . |
Bucket 7 | 8479480 |
Bucket 8 | 11619361 |
Bucket 9 | . |
Bucket 10 | 8103834 |
Bucket 11 | 11894685 |
Bucket 12 | . |
Bucket 13 | 300642 |
Bucket 14 | 1373049 |
Where . represents the bucket to be having no amount belonging to the same.
Thanx in advance.
PRELOADFMT is the option you need when you have a value format as in your example. It can be used in SUMMARY/MEANS, REPORT and TABULATE
Message was edited by: data _null_ for no particular reason.
PRELOADFMT is the option you need when you have a value format as in your example. It can be used in SUMMARY/MEANS, REPORT and TABULATE
Message was edited by: data _null_ for no particular reason.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.