3
else if City1^='' and State1^='' then Address1=tranwrd(left(trim(City1)),
" ","+")||","||left(trim(State1));
else if State1^='' and Zip1^=. then Address1=left(trim(State1))||"+"||
left(strip(put(Zip1,best12.)));
else if Zip1^=. then Address1=left(strip(put(Zip1,best12.)));
else if Address^='' then Address1=tranwrd(left(trim(Address))," ","+");
else if City1^='' then Address1=tranwrd(left(trim(City1))," ","+");
else if State1^='' then Address1=left(trim(State1));
*Format ending address;
if Hospital_Address^='' and HCity^='' and HState^='' and HZip^=. then
Address2=tranwrd(left(trim(Hospital_Address))," ","+")||"+"||
tranwrd(left(trim(HCity))," ","+")||","||left(trim(HState))||"+"||
left(strip(put(HZip,best12.)));
else if Hospital_Address^='' and HState^='' and HZip^=. then
Address2=tranwrd(left(trim(Hospital_Address))," ","+")||
"+"||left(trim(HState))||"+"||left(strip(put(HZip,best12.)));
else if Hospital_Address^='' and HCity^='' and HZip^=. then
Address2=tranwrd(left(trim(Hospital_Address))," ","+")||
",+"||tranwrd(left(trim(HCity))," ","+")||"+"||
left(strip(put(HZip,best12.)));
else if Hospital_Address^='' and HCity^='' and HState^='' then
Address2=tranwrd(left(trim(Hospital_Address))," ","+")||
",+"||tranwrd(left(trim(HCity))," ","+")||","||left(trim(HState));
else if HCity^='' and HState^='' and HZip^=. then
Address2=tranwrd(left(trim(HCity))," ","+")||","||left(trim(HState))||
"+"||left(strip(put(HZip,best12.)));
else if Hospital_Address^='' and HCity^='' then
Address2=tranwrd(left(trim(Hospital_Address))," ","+")||",+"||
tranwrd(left(trim(HCity))," ","+");
else if Hospital_Address^='' and HState^='' then
Address2=tranwrd(left(trim(Hospital_Address))," ","+")||"+"||
left(trim(HState));
else if Hospital_Address^='' and HZip^=. then
Address2=tranwrd(left(trim(Hospital_Address))," ","+")||"+"||
left(strip(put(HZip,best12.)));
else if HCity^='' and HZip^=. then Address2=tranwrd(left(trim(HCity)),
" ","+")||"+"||left(strip(put(HZip,best12.)));
else if HCity^='' and HState^='' then Address2=tranwrd(left(trim(HCity)),
" ","+")||","||left(trim(HState));
else if HState^='' and HZip^=. then
Address2=left(trim(HState))||"+"||left(strip(put(HZip,best12.)));
else if HZip^=. then Address2=left(strip(put(HZip,best12.)));
else if Hospital_Address^='' then
Address2=tranwrd(left(trim(Hospital_Address))," ","+");
else if HCity^='' then Address2=tranwrd(left(trim(HCity))," ","+");
else if HState^='' then Address2=left(trim(HState));
*Assign macro variable obsnum=number of observations in the data set;
call symput('obsnum',obsnum);
run;