I am having a hard time stacking my data sets. I have created three data sets but, when I go to stack them vertically, one of the data sets gets dropped and only two of my data sets get stacked. Here is what I have for code: DATA WORK.Contact_IA; Set HypImpt.IowaResidents (rename= (ZipCd = ZipCdtoo ) ); keep SSN Inits City StateCd ZipCd; length inits $3.; Inits = SUBSTR(Initials, 3, 2)||SUBSTR(Initials, 1, 1); City = propcase(City); StateCd = "IA"; ZipCd = PUT(ZipCdtoo, 5.); 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; proc contents data = work.contact_ia; run; proc print data = work.contact_ia; run; * Creating data for Mississippi *; DATA WORK.Contact_MS; set hypimpt.ms_citizens (rename = (SocSecNum = SSN)) ; inits = substr(Firstinit,1,1) || substr(middleinit, 1,1) ||substr(lastinit, 1,1); StateCd= 'MS'; City = SCAN(CityState, 1, ','); keep ssn inits StateCd City Zipcd; label SSN = 'Social Security Number' Inits = "Subject Initials" City = 'City' StateCd= 'State Code' ZipCd = 'Zip Code'; format StateCd $StateCd.; run; Proc sort data = work.contact_MS; by SSN; run; proc contents data = hypimpt.ms_citizens ; run; proc print data = hypimpt.ms_citizens; run; * Creating data for Utah *; DATA WORK.Contact_UT; retain SSN Inits City StateCd ZipCd; set hypimpt.ut_records (rename = (inits= inits2 Zipcode= ZipCd)); SSNold = put(id, z9.); part1 = substr(SSNold, 1, 3); part2 = substr(SSNold, 4, 2); part3 = substr(SSNold, 6, 4); length SSN $11.; SSN = Catx('-', part1, part2, part3); length inits $3.; inits = tranwrd(compress(inits2, '.'), ' ', '-'); 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; * Creating Combined Data Set *; DATA HypTabs.Contact; SET WORK.Contact_IA WORK.Contact_MS WORK.Contact_UT; run;
... View more