hi ,
can any one tell me how we will write below SQL code in data step by using merge
PROC SQL;
CREATE TABLE merge AS
SELECT A.PATIENT,A.DATE , A.PULSE,
B.PATIENT, B.DOSES, B.AMT FROM VITALS as A , DOSING as B
where A.PATIENT=B.PATIENT and B.AMT ne " ";
quit;
data want;
merge vitals (in=a) dosing (in=b where=(amt ne ""));
by ...;
if a and b then output;
run;
thanks for providing code for same however small change in code and tell me how we can aply condtion in both data sets as
data want;
merge vitals (in=a where=(
A.pulse eq 'y') dosing (in=b where=(amt ne ""));
by ...;
if a and b then output;
run;
PROC SQL;
CREATE TABLE merge AS
SELECT A.PATIENT,A.DATE , A.PULSE,
B.PATIENT, B.DOSES, B.AMT FROM VITALS as A , DOSING as B
where A.PATIENT=B.PATIENT and A.pulse eq 'Y' and B.AMT ne " ";
quit;
helo,
/*prepare some data*/
data classwork;
set sashelp.class(where=(sex="M"));
if mod(_N_,2)=0 then call missing(height);
run;
/*output*/
data want;
merge sashelp.class (in=a) classwork (in=b);
by name;
if a and b and height ne .;
run;
data want;
merge vitals (in=a) dosing (in=b);
by PATIENT;
if a and b;
where amt ne ' ';
run;
thanks
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 save with the early bird rate—just $795!
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.