**************************************************************************************** The following is JCL if you are using an IBM-type mainframe: //JOBCARD //HCCSY06 EXEC SAS8,REGION=1984K, // OPTIONS='ERRORS=0,NOCENTER,NEWS' //WORK DD SPACE=(CYL,(1000,2)) //WORK1 DD SPACE=(CYL,(2000,2)) //LIBRARY DD DISP=SHR,DSN=XXXX.XXXXXXX.FORMATS /* user-defined location of formats */ //IN0 DD DISP=SHR,DSN=XXXX.XXXXXX /*user-defined the location of macros */ //IN1 DD DISP=SHR,DSN=XXXX.PERSON /*the location of person-level file */ //IN2 DD DISP=SHR,DSN=XXXX.DIAG /*the location of the diagnosis file */ //INCOEF DD DISP=SHR,DSN=XXXX.PLANCOEFS /*the location of the file containing all coefficients */ //OUT DD DISP=(NEW,CATLG,KEEP), // DSN=XXX.RXSY06.PERSON, /*the output file containing person-level scores */ // SPACE=(TRK,(20,10),RLSE) //SYSIN DD * ****************************************************************************************** If you are using PC-SAS, you must specify the location of the files on your PC in a libname/filename statement. LIBNAME LIBRARY "location of formats"; FILENAME IN0 "location of macros"; LIBNAME IN1 "location of person-level file"; LIBNAME IN2 "location of diagnosis file"; LIBNAME INCOEF "location of the coefficients file"; LIBNAME OUT "location for the output file"; *********************************************************************** * * DESCRIPTION: * * RXSY06 program creates 84 RXHCC variables (&RXlistY06) and two * score variables for each person who is present in a person file * supplied by a user. * If a person has at least one diagnosis in DIAG file (supplied by a * user) then RXHCC variables are created, otherwise RXHCCs are set to 0 . * Score variables are created using coefficients from the 2 final * models: risk adjustable and new enrollees. * * Assumptions about input files: * - both files are sorted by person ID * * - person level file has the following variables: * :&IDVAR - person ID variable (HICNO for Medicare data) * :DOB - date of birth * :OREC - original reason for entitlement * * - diagnosis level file has the following vars: * :&IDVAR - person ID variable * :DIAG - diagnosis * * The program supplies parameters to a main macro %HCCMY06 that calls * other external macros: * %MAGESEX - create age/sex, originally disabled, disabled vars * %EDITICD9 - perform edits on diagnoses codes * %MLTRXY06 - assign one ICD9 to multiple RXCCs * %RXLBY06 - assign labels to RXHCCs * %HIERY06 - set RXHCC=0 according to hierarchies * %SCORECAL - calculate a score variable * * Format: * $CODE_SX - to go from ICD9 to RXCC (supplied by CODE_SX file) * Program steps: * step1: include external macros * step2: define internal macro variables * step3: merge person and diagnosis files outputting one * record per person for each input person level record * step3.1: declaration section * step3.2: bring regression coefficients * step3.3: merge person and diagnosis file * step3.4: for the first record for a person set CC to 0 * and calculate age * step3.5: if there are any diagnoses for a person * then do the following: * - create RXCC using format $CODE_SX * - perform ICD9 edits using macro EDITICD9 * - create additional RXCC using MLTRXY06 macro * step3.6: for the last record for a person do the * following: * - create demographic variables needed * for regressions (macro MAGESEX) * - create RXHCC using hierarchies (macro HIERY06) * - create RXHCC interaction variables * - create RXHCC and DISABL interaction variables * - set RXHCCs and interaction vars to zero if there * are no diagnoses for a person * - create score for risk adjustable model * - create score for new enrollee model * step4: data checks and proc contents * * USER CUSTOMIZATION: * A user must supply 2 files with the variables described above and * set the following parameters: * INP - SAS input person dataset * IND - SAS input diagnosis dataset * OUTDATA - SAS output dataset * IDVAR - name of person id variable (HICNO for Medicare data) * KEEPVAR - variables to keep in the output dataset * SEDITS - a switch that controls whether to perform edits * on ICD9. 1-YES, 0-NO * DATE_ASOF- asof date to calculate age (February 1 of prediction * year) ***********************************************************************; %LET YY=06 ; * modification of previous software is done for this year; %LET IDVAR=HICNO; * person ID; %LET INPUTVARS=%STR(&IDVAR SEX DOB OREC); *demographic variables; %LET DEMVARS =%STR(AGEF ORIGDS DISABL F0_34 F35_44 F45_54 F55_59 F60_64 F65_69 F70_74 F75_79 F80_84 F85_89 F90_94 F95_GT M0_34 M35_44 M45_54 M55_59 M60_64 M65_69 M70_74 M75_79 M80_84 M85_89 M90_94 M95_GT NEF0_34 NEF35_44 NEF45_54 NEF55_59 NEF60_64 NEF65 NEF66 NEF67 NEF68 NEF69 NEF70_74 NEF75_79 NEF80_84 NEF85_89 NEF90_94 NEF95_GT NEM0_34 NEM35_44 NEM45_54 NEM55_59 NEM60_64 NEM65 NEM66 NEM67 NEM68 NEM69 NEM70_74 NEM75_79 NEM80_84 NEM85_89 NEM90_94 NEM95_GT); *list of HCCs included in models; %LET RXlistY06 =%STR(RXHCC1 RXHCC2 RXHCC3 RXHCC8 RXHCC9 RXHCC10 RXHCC17 RXHCC18 RXHCC19 RXHCC20 RXHCC21 RXHCC24 RXHCC31 RXHCC33 RXHCC34 RXHCC37 RXHCC39 RXHCC40 RXHCC41 RXHCC42 RXHCC43 RXHCC44 RXHCC45 RXHCC47 RXHCC48 RXHCC51 RXHCC52 RXHCC54 RXHCC55 RXHCC57 RXHCC59 RXHCC60 RXHCC65 RXHCC66 RXHCC67 RXHCC75 RXHCC76 RXHCC77 RXHCC78 RXHCC79 RXHCC80 RXHCC81 RXHCC82 RXHCC83 RXHCC85 RXHCC86 RXHCC87 RXHCC91 RXHCC92 RXHCC98 RXHCC99 RXHCC102 RXHCC105 RXHCC106 RXHCC108 RXHCC109 RXHCC110 RXHCC111 RXHCC112 RXHCC113 RXHCC120 RXHCC121 RXHCC122 RXHCC123 RXHCC126 RXHCC129 RXHCC130 RXHCC132 RXHCC134 RXHCC135 RXHCC137 RXHCC138 RXHCC139 RXHCC140 RXHCC144 RXHCC145 RXHCC157 RXHCC158 RXHCC159 RXHCC160 RXHCC165 RXHCC166 RXHCC186 RXHCC187 ); %LET SCOREVARS=%STR(SCORE_RISK SCORE_NEW_ENROLLEE); %INCLUDE IN0('RXMY06.TXT')/SOURCE2; %RXMY06( INP =IN1.PERSON, IND =IN2.DIAG, OUTDATA =OUT.PERSON, IDVAR =&IDVAR, KEEPVAR =&INPUTVARS &SCOREVARS &DEMVARS &RXlistY06, SEDITS =1, DATE_ASOF="1FEB2003"D);