Hello everyone, So the problem I'm having is I get this error ERROR: Function SUBSTR requires a character expression as argument 1. I'm trying to link two datasets based upon the Name and Date of Birth. However, whenever I try to link based on the date of birth I get this ERROR. Here is how I'm creating the DOB variable for HAVE1: dob_c = input(cat(de_bmo, de_bday, de_byr), mmddyy8.); The variable I am linking to is a numeric variable for date of birth in HAVE2. proc sql; create table WANT as select a.*, cat(compress(medrecno),compress(uniqpati),dis_date) as unique_id_ev, b.yod_cert from HAVE2 as a left join HAVE1 as b on compress(a.patiname) = cat(compress(b.de_lname),',',compress(b.de_fname)) and a.bth_date = substr(b.dob_c,1,2)||substr(b.dob_c,4,2)||substr(b.dob_c,7,4) where b.de_fname is not null and cat(compress(medrecno),compress(uniqpati),dis_date) not in (select unique_id_ev from out_2017) and dispos ne '20' and input(a.dis_date,mmddyy8.) < b.deathdate; quit; I'm really not good with PROC SQL coding so any help you can give me here would be appreciated.
... View more