06-05-2019
ABC73
Calcite | Level 5
Member since
02-27-2017
- 3 Posts
- 1 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by ABC73
Subject Views Posted 3074 02-27-2017 12:37 PM 3080 02-27-2017 10:49 AM 3103 02-27-2017 09:43 AM -
Activity Feed for ABC73
- Liked Re: Invalid numeric data error for Astounding. 02-27-2017 12:38 PM
- Posted Re: Invalid numeric data error on SAS Procedures. 02-27-2017 12:37 PM
- Posted Re: Invalid numeric data error on SAS Procedures. 02-27-2017 10:49 AM
- Posted Invalid numeric data error on SAS Procedures. 02-27-2017 09:43 AM
-
Posts I Liked
Subject Likes Author Latest Post 2
02-27-2017
10:49 AM
Thank you! I think I'm getting closer to a fix. As advised, I defined ICD_cat as a character variable. I am now getting some error messages for another variable, ICD_cat10. See the error below. NOTE: Invalid numeric data, ICD_cat10='3A' , at line 912 column 79. CLM_PRNCPAL_DGNS_CD=D3A090I CD_cat=D3A ICD_other=D ICD_cat10=3A DIAGNOSIS_GROUP=Cancer provst=OH benest=OH clm_yr=2015 fiscal_yr=2016 ICD_cat_num=3 _ERROR_=1 _N_=191179 Here's the corresponding log line: 912 else if fiscal_yr=2016 and (ICD_other='C' or (ICD_other = 'D' and 00<=ICD_cat10<=49) or (ICD_other='D' and 912! (substr(CLM_PRNCPAL_DGNS_CD,2,2))='3A')) then do; DIAGNOSIS_GROUP='Cancer'; end;
... View more
02-27-2017
09:43 AM
I don't understand why when I'm running this code length ICD_cat 3. ICD_other $ 1 ICD_cat10 2. DIAGNOSIS_GROUP $ 50 /*PEPPER_DX_GROUP $ 50 */ provst $ 2 benest $ 2 clm_yr 4. fiscal_yr 4. ICD_cat_num 3.; ICD_cat=substr(clm_prncpal_dgns_cd,1,3); ICD_cat_num=compress(ICD_cat,'','A'); ICD_other=substr(clm_prncpal_dgns_cd,1,1); ICD_cat10=substr(clm_prncpal_dgns_cd,2,2); clm_yr=2015; if month(datepart(CLM_FROM_DT)) < 10 then fiscal_yr=2015; else fiscal_yr=(clm_yr + 1); /*Categorizing ICD-9 diagnosis codes (numeric) into diagnosis groups*/ if clm_prncpal_dgns_cd in ('3310') then do; DIAGNOSIS_GROUP = 'Alzheimers'; end; else if fiscal_yr=2015 and ICD_other = 'V' then do; DIAGNOSIS_GROUP = 'Factors Influence Health'; end; else if fiscal_yr=2015 and ICD_other = 'E' then do; DIAGNOSIS_GROUP = 'External Causes'; end; else if fiscal_yr=2015 and 001<=ICD_cat_num<=139 then do; DIAGNOSIS_GROUP = 'Infection'; end; else if fiscal_yr=2015 and 140<=ICD_cat_num<=239 then do; DIAGNOSIS_GROUP = 'Cancer'; end; else if fiscal_yr=2015 and 240<=ICD_cat_num<=279 then do; DIAGNOSIS_GROUP = 'Endocrine'; end; else if fiscal_yr=2015 and 280<=ICD_cat_num<=289 then do; DIAGNOSIS_GROUP = 'Blood'; end; else if fiscal_yr=2015 and 290<=ICD_cat_num<=319 then do; DIAGNOSIS_GROUP = 'Mental'; end; else if fiscal_yr=2015 and 320<=ICD_cat_num<=389 then do; DIAGNOSIS_GROUP = 'Nervous System'; end; else if fiscal_yr=2015 and 390<=ICD_cat_num<=459 then do; DIAGNOSIS_GROUP = 'Circulatory'; end; else if fiscal_yr=2015 and 460<=ICD_cat_num<=519 then do; DIAGNOSIS_GROUP = 'Respiratory'; end; else if fiscal_yr=2015 and 520<=ICD_cat_num<=579 then do; DIAGNOSIS_GROUP = 'Digestive'; end; else if fiscal_yr=2015 and 580<=ICD_cat_num<=629 then do; DIAGNOSIS_GROUP = 'Genitourinary'; end; else if fiscal_yr=2015 and 630<=ICD_cat_num<=679 then do; DIAGNOSIS_GROUP = 'Childbirth/Pregnancy'; end; else if fiscal_yr=2015 and 680<=ICD_cat_num<=709 then do; DIAGNOSIS_GROUP = 'Skin'; end; else if fiscal_yr=2015 and 710<=ICD_cat_num<=739 then do; DIAGNOSIS_GROUP = 'Musculoskeletal'; end; else if fiscal_yr=2015 and 740<=ICD_cat_num<=759 then do; DIAGNOSIS_GROUP = 'Congenital Anomalies'; end; else if fiscal_yr=2015 and 760<=ICD_cat_num<=779 then do; DIAGNOSIS_GROUP = 'Prenatal'; end; else if fiscal_yr=2015 and 780<=ICD_cat_num<=799 then do; DIAGNOSIS_GROUP = 'Ill-Defined'; end; else if fiscal_yr=2015 and 800<=ICD_cat_num<=999 then do; DIAGNOSIS_GROUP = 'Injury/Poisoning'; end; /*Categorizing ICD-10 diagnosis codes (alphanumeric) into diagnosis groups. ICD-10 became effective October 1, 2015 (FY2016). See http://www.icd10data.com/ICD10CM/Codes*/ else if fiscal_yr=2016 and (ICD_other='A' or ICD_other='B') then do; DIAGNOSIS_GROUP = 'Infection'; end; else if fiscal_yr=2016 and (ICD_other='C' or (ICD_other = 'D' and 00<=ICD_cat10<=49) or (ICD_other='D' and (substr(CLM_PRNCPAL_DGNS_CD,2,2))='3A')) then do; DIAGNOSIS_GROUP='Cancer'; end; else if fiscal_yr=2016 and (ICD_other='D' and 50<=ICD_cat10<=89) then do; DIAGNOSIS_GROUP = 'Blood'; end; else if fiscal_yr=2016 and (ICD_other='E' and (00<=ICD_cat10<=89)) then do; DIAGNOSIS_GROUP = 'Endocrine'; end; else if fiscal_yr=2016 and ICD_other='F' then do; DIAGNOSIS_GROUP = 'Mental'; end; else if fiscal_yr=2016 and ICD_other='G' then do; DIAGNOSIS_GROUP = 'Nervous System'; end; else if fiscal_yr=2016 and (ICD_other='H' and 00<=ICD_cat10<=59) then do; DIAGNOSIS_GROUP = 'Eye and Adnexa'; end; else if fiscal_yr=2016 and (ICD_other='H' and 60<=ICD_cat10<=95) then do; DIAGNOSIS_GROUP = 'Ear and Mastoid Process'; end; else if fiscal_yr=2016 and ICD_other='I' then do; DIAGNOSIS_GROUP = 'Circulatory'; end; else if fiscal_yr=2016 and ICD_other='J' then do; DIAGNOSIS_GROUP = 'Respiratory'; end; else if fiscal_yr=2016 and ICD_other='K' then do; DIAGNOSIS_GROUP = 'Digestive'; end; else if fiscal_yr=2016 and ICD_other='L' then do; DIAGNOSIS_GROUP = 'Skin'; end; else if fiscal_yr=2016 and ICD_other='M' then do; DIAGNOSIS_GROUP = 'Musculoskeletal'; end; else if fiscal_yr=2016 and ICD_other='N' then do; DIAGNOSIS_GROUP = 'Genitourinary'; end; else if fiscal_yr=2016 and ICD_other='O' then do; DIAGNOSIS_GROUP = 'Childbirth/Pregnancy'; end; else if fiscal_yr=2016 and ICD_other='P' then do; DIAGNOSIS_GROUP = 'Prenatal'; end; else if fiscal_yr=2016 and ICD_other='Q' then do; DIAGNOSIS_GROUP = 'Congenital Anomalies'; end; else if fiscal_yr=2016 and ICD_other='R' then DIAGNOSIS_GROUP = 'Ill-Defined'; else if fiscal_yr=2016 and ICD_other in ('S','T') then do; DIAGNOSIS_GROUP = 'Injury/Poisoning'; end; else if fiscal_yr=2016 and (ICD_other='V' or ICD_other='Y') then do; DIAGNOSIS_GROUP = 'External Causes'; end; else if fiscal_yr=2016 and ICD_other='Z' then do; DIAGNOSIS_GROUP='Factors Influence Health'; end; else if ICD_cat = ' ' then do; DIAGNOSIS_GROUP = 'Missing'; end; I get this note/error: NOTE: Invalid numeric data, 'G20' , at line 81 column 17. CLM_FROM_DT=13OCT2015:00:00:00 CLM_PRNCPAL_DGNS_CD=G20 CLM_PRNCPAL_DGNS_VRSN=0 ICD_cat=. ICD_other=G ICD_cat10=20 DIAGNOSIS_GROUP=Nervous System clm_yr=2015 fiscal_yr=2016 ICD_cat_num=. _ERROR_=1 _N_=24 Any suggestions on how I can address this problem? I tried "if/then" statements prior to these "if/then do" statements, but both approaches yield the same SAS note/error. (I'm using SAS 9.4) Thanks
... View more