Hello,
Everything works until I attempt to merge. No error is given. fiveb has 0 observations.
%mysort4(nypop,nypop_s,A);
%mysort4(nonnycvotes,nonnycvotes_s,A);
data nypop_s; set nypop_s; run;
proc print data=nypop_s(firstobs= 1 obs= 10) label; run;
data nonnycvotes_s; set nonnycvotes_s (rename=( L=L2 M=M2 U=U2) );
run;
proc print data=nonnycvotes_s(firstobs= 1 obs= 10) label; run;
data fiveb;
merge nypop_s (in=makeup1) nonnycvotes_s (in=makeup2);
by A;
if makeup1 and makeup2;
run;
Thank you.
Mary A. Marion
@MaryA_Marion wrote:
Hello,
Everything works until I attempt to merge. No error is given. fiveb has 0 observations.
%mysort4(nypop,nypop_s,A);
%mysort4(nonnycvotes,nonnycvotes_s,A);
data nypop_s; set nypop_s; run;
proc print data=nypop_s(firstobs= 1 obs= 10) label; run;
data nonnycvotes_s; set nonnycvotes_s (rename=( L=L2 M=M2 U=U2) );
run;
proc print data=nonnycvotes_s(firstobs= 1 obs= 10) label; run;
data fiveb;
merge nypop_s (in=makeup1) nonnycvotes_s (in=makeup2);
by A;
if makeup1 and makeup2;
run;
Thank you.
Mary A. Marion
With this code:
data fiveb; merge nypop_s (in=makeup1) nonnycvotes_s (in=makeup2); by A; if makeup1 and makeup2; run;
most likely there are NO matching values of the variable A in the two sets.
Consider that the first value in the nonnycvoters has a value of "Albany" and the first in nypopulation is "Albany County" it is pretty obvious that the values do not match.
@MaryA_Marion wrote:
Hello,
Everything works until I attempt to merge. No error is given. fiveb has 0 observations.
%mysort4(nypop,nypop_s,A);
%mysort4(nonnycvotes,nonnycvotes_s,A);
data nypop_s; set nypop_s; run;
proc print data=nypop_s(firstobs= 1 obs= 10) label; run;
data nonnycvotes_s; set nonnycvotes_s (rename=( L=L2 M=M2 U=U2) );
run;
proc print data=nonnycvotes_s(firstobs= 1 obs= 10) label; run;
data fiveb;
merge nypop_s (in=makeup1) nonnycvotes_s (in=makeup2);
by A;
if makeup1 and makeup2;
run;
Thank you.
Mary A. Marion
With this code:
data fiveb; merge nypop_s (in=makeup1) nonnycvotes_s (in=makeup2); by A; if makeup1 and makeup2; run;
most likely there are NO matching values of the variable A in the two sets.
Consider that the first value in the nonnycvoters has a value of "Albany" and the first in nypopulation is "Albany County" it is pretty obvious that the values do not match.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.