I am trying to combine three data sets: Src_iowaresidents, Src_ms_citizens and Src_utah_records into one data set called Work.Contacts. Each data set by itself is working fine, but when I combine them together something goes wrong. Each data set looks like this: PS. Sorry parts of it are in all caps. My professor prefers it that way. OPTIONS FMTSEARCH = (HypTabs.HypFormats WORK LIBRARY); DATA WORK.Contact_IA; RETAIN SSN Inits City StateCd ZipCd; SET HypTabs.Src_IowaResidents (RENAME =(ZipCd = ZipCdSrc)); Inits = SUBSTR(Initials, 3, 2)||SUBSTR(Initials, 1, 1); City = PROPCASE(City); StateCd = "IA"; ZipCd = PUT(ZipCdSrc, 5.); KEEP SSN Inits City StateCd ZipCd; LABEL SSN = "Social Security Number" Inits = "Subject Initials" City = "City" StateCd = "State Code" ZipCd = "Zip Code"; FORMAT StateCd $StateCd.; RUN; PROC SORT; BY SSN; RUN; DATA WORK.Contact_MS; RETAIN SSN Inits City StateCd ZipCd; SET HypTabs.Src_MS_Citizens (RENAME =(SocSecNum = SSN)); Inits = COMPRESS(CATS(FirstInit, MiddleInit, LastInit), '.'); City = SCAN(CityState, 1, ','); StateCd = "MS"; KEEP SSN Inits City StateCd ZipCd; LABEL SSN = "Social Security Number" Inits = "Subject Initials" City = "City" StateCd = "State Code" ZipCd = "Zip Code"; FORMAT StateCd $StateCd.; RUN; PROC SORT; BY SSN; RUN; DATA WORK.Contact_UT; RETAIN SSN Inits City StateCd ZipCd; SET HypTabs.Src_UT_Records ( RENAME = ( Inits = InitsTemp ZipCode = ZipCd ) ); SSN1 = INPUT(ID, 12.); SSN = PUT(SSN1, SSN11.); Inits = COMPRESS(InitsTemp, '.'); City = SCAN(CitySt, 1, ','); StateCd = "UT"; KEEP SSN Inits City StateCd ZipCd; LABEL SSN = "Social Security Number" Inits = "Subject Initials" City = "City" StateCd = "State Code" ZipCd = "Zip Code"; FORMAT StateCd $StateCd.; RUN; PROC SORT; BY SSN; RUN; DATA WORK.Contact (LABEL = "Contact Information"); SET HypTabs.Src_IowaResidents HypTabs.Src_MS_Citizens HypTabs.Src_UT_Records; KEEP SSN Inits City StateCd ZipCd; RUN;
... View more