As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


ICD-9 format

From sasCommunity
Jump to: navigation, search
******************************************************************  ;
*** Program:  ICD9_FORMAT.SAS                            ********** ;
*** Created: 3/27/2007 by Rodney Presley                 ********** ;
*** Modified:                            ************************** ;
*** Thanks to Jenine Milum who provided the ICD9 sas file.        * ;
*** The ICD9 codes are in the public domain, as I understand it,  * ;
*** so use this code and the associated file as you need. ********* ;
*** RJF2 3/27/2007 4:26PM polishing to remove label ne ' '        * ;
 
** define the library where you have the ICD9_picklist stored   *** ;
** libname Library '\\... path information... \Library';
 
** create CNTLIN data set for proc format to generate descriptor format;
 
%Let outLibref = work;
*Let outLibref = Library;
 
DATA   Cntl_1 / view = Cntl_1;
length label $100 ;
retain Fmtname 'icd_des'
       Type    'c';
do until(EndoFile);
   set Library.icd9_picklist
      (rename = (icd9_code = start
                 icd9_desc = label))
       end    = EndoFile;
   if label ne ' ' then output;
   end;
hlo   = 'O';
label = '** ICD9 desc label NOT Found **';
output;
stop;
run;
 
PROC Format library = &OutLibref.
            cntlin  = cntl_1;
 
run;
 
** create CNTLIN data set for proc format to generate group format.
   Note that many ICD9 codes do not have an associated ICD9_GROUP.  ** ;
 
DATA   Cntl_2 / view = Cntl_2;
length label $100 ;
retain fmtname 'icd_grp'
       type     'c';
do until(EndoFile);
   set Library.icd9_picklist
      (rename = (icd9_code  = start
                 icd9_group = label))
       end    = EndoFile;
   if label ne ' ' then output;
   end;
hlo='O';
label='** ICD9 group label NOT Found **';
output;
stop;
run;
 
PROC Format library = &OutLibref.
            cntlin  = cntl_2
            fmtlib;
run;

References