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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.