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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.