/***************************************************************************************************************** SAS file name: multilabel_option File location: _________________________________________________________________________________________________________________ Purpose: To demonstrate the use of the Multilabel Option in PROC FORMAT Author: Peter Clemmensen Creation Date: 20/02/2019 This program supports the example page "Creating Multilabel Formats in SAS with PROC FORMAT" on SASnrd.com *****************************************************************************************************************/ /* Example Data */ data creditdata; array first_names{20} $20 _temporary_ ("Paul", "Allan", "Thomas", "Michael", "Chris", "David", "John", "Jerry", "James", "Robert", "William", "Richard", "Bob", "Daniel", "Paul", "George", "Larry", "Eric", "Charles", "Stephen"); array last_names{20}$20 _temporary_ ("Smith", "Johnson", "Williams", "Jones", "Brown", "Miller", "Wilson", "Moore", "Taylor", "Hall", "Anderson", "Jackson", "White", "Harris", "Martin", "Thompson", "Robinson", "Lewis", "Walker", "Allen"); call streaminit(123); do ID=1 to 1e5; first_name=first_names[ceil(rand("Uniform")*20)]; last_name=last_names[ceil(rand("Uniform")*20)]; creditrate=rand('integer', 1, 10); output; end; format ID z6.; run; /* Create a multilabel format */ proc format library=work; value appr (multilabel default=20 notsorted) 1-2 = 'Strong approval' 3-6 = 'Weak Approval' 1-6 = 'Approval' 7-8 = 'Weak Decline' 9-10 = 'Strong Decline' 7-10 = 'Denial' ; run; /* Create a summary table of credit rates with the appr multilabel format */ proc means data=creditdata n maxdec=1 nonobs; class creditrate / mlf preloadfmt order=data; format creditrate appr.; run;