filename src temp;
filename src1 temp;
filename src2 temp;
filename src3 temp;
proc http
method='get'
url='https://names.mongabay.com/male_names_alpha.htm'
out=src;
run;
proc http
method='get'
url='https://names.mongabay.com/female_names.htm'
out=src1;
run;
proc http
method='get'
url='https://names.mongabay.com/data/1000.html'
out=src2;
run;
proc http
method='get'
url='https://www.biggestuscities.com/'
out=src3;
run;
data m;
infile src length=len lrecl=32767;
input line $varying32767. len;
line = strip(line);
if len>0;
run;
data m(keep=first_name);
set m;
if find(line,'<tr><td>') then do;
first_name =compress(scan(line, 3,'>'), '</td');
output;
end;
run ;
data f;
infile src1 length=len lrecl=32767;
input line $varying32767. len;
line = strip(line);
if len>0;
run;
data f(keep=first_name);
set f;
if find(line,'<tr><td>') then do;
first_name =compress(scan(line, 3,'>'), '</td');
output;
end;
run ;
data lastnames;
infile src2 length=len lrecl=32767;
input line $varying32767. len;
line = strip(line);
if len>0;
run;
data lastnames(keep=last_name);
set lastnames;
if find(line,'<tr><td>') then do;
last_name=compress(scan(line,3,'>'), '</td class="c1"');
output;
end;
run;
data lastnames;
set lastnames;
if _n_=1 then delete;
run;
data cities;
infile src3 length=len lrecl=32767;
input line $varying32767. len ;
line=strip(line);
if len>0;
run;
data cities;
set cities;
if find(line, '/city/') then do;
pickup=_n_+1;
/* read ahead one line */
set cities (rename=(line=city)) point=pickup;
output;
end;
drop line;
run;
proc sql outobs=2000;
create table firstnames as
select * from m
union
select * from f
order by ranuni(0);
quit;
data want;
call streaminit(27182818);
set firstnames;
do _n_=1 to 1000;
set lastnames nobs=n1 point=p1;
p2=rand('integer',n2);
set cities nobs=n2 point=p2;
r=ranuni(31416);
output;
end;
run;
proc sort data=want out=want(drop=r);
by r;
run;
... View more