BookmarkSubscribeRSS Feed
ohsco2007
Calcite | Level 5

Can someone assist in this error in the following code?

 

Code: 

/*BREAK APART*/
%let indata=LIC_COMPLETE;
%let outlib=WORK;
%let param=RECORD_ID2;

proc sort
data=&indata (keep=&param)
out= lookup
nodupkey;
by &param;
run;

data _null_;
call execute ('data ');
do until (eof1);
set lookup end=eof1;
call execute("&outlib.." !! trim(&param) !! ' ');
end;
call execute ("; set &indata.;");
do until(eof2);
set lookup end=eof2;
call execute("if &param = '" !! trim(&param) !! "' then output &outlib.." !! trim(&param) !! ';');
end;
call execute('run;');
stop;
run;

%let indata=LIC_INCOMPLETE1;
%let outlib=WORK;
%let param=RECORD_ID2;

proc sort
data= &indata (keep=&param)
out= lookup
nodupkey;
by &param;
run;

data _null_;
call execute ('data ');
do until (eof1);
set lookup end=eof1;
call execute("&outlib.." !! trim(&param) !! ' ');
end;
call execute ("; set &indata.;");
do until(eof2);
set lookup end=eof2;
call execute("if &param = '" !! trim(&param) !! "' then output &outlib.." !! trim(&param) !! ';');
end;
call execute('run;');
stop;
run;

%let indata=LIC_INCOMPLETE2;
%let outlib=WORK;
%let param=RECORD_ID2;

proc sort
data=&indata (keep=&param)
out= lookup
nodupkey;
by &param;
run;

data _null_;
call execute ('data ');
do until (eof1);
set lookup end=eof1;
call execute("&outlib.." !! trim(&param) !! ' ');
end;
call execute ("; set &indata.;");
do until(eof2);
set lookup end=eof2;
call execute("if &param = '" !! trim(&param) !! "' then output &outlib.." !! trim(&param) !! ';');
end;
call execute('run;');
stop;
run;

%let indata=LIC_CHECK;
%let outlib=WORK;
%let param=RECORD_ID2;

proc sort
data=&indata (keep=&param)
out= lookup
nodupkey;
by &param;
run;

data _null_;
call execute ('data ');
do until (eof1);
set lookup end=eof1;
call execute("&outlib.." !! trim(&param) !! ' ');
end;
call execute ("; set &indata.;");
do until(eof2);
set lookup end=eof2;
call execute("if &param = '" !! trim(&param) !! "' then output &outlib.." !! trim(&param) !! ';');
end;
call execute('run;');
stop;
run;

%let indata=COVERPAGE2;
%let outlib=WORK;
%let param=RECORD_ID2;

proc sort
data=&indata (keep=&param)
out= lookup
nodupkey;
by &param;
run;

data _null_;
call execute ('data ');
do until (eof1);
set lookup end=eof1;
call execute("&outlib.." !! trim(&param) !! ' ');
end;
call execute ("; set &indata.;");
do until(eof2);
set lookup end=eof2;
call execute("if &param = '" !! trim(&param) !! "' then output &outlib.." !! trim(&param) !! ';');
end;
call execute('run;');
stop;
run;

PROC SORT DATA=LIC_CHECK; BY RECORD_ID; RUN;
DATA RECORD_ID;
SET LIC_CHECK (KEEP = RECORD_ID);
BY RECORD_ID;
IF FIRST.RECORD_ID;
COUNT + 1;
RUN;

 

Errors: 

NOTE: CALL EXECUTE generated line.
1 + data
1714
1715 PROC SORT DATA=LIC_CHECK; BY RECORD_ID; RUN;
-
22
200
ERROR: No SET, MERGE, UPDATE, or MODIFY statement is present.

ERROR 22-322: Syntax error, expecting one of the following: a name,
a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.

ERROR 200-322: The symbol is not recognized and will be ignored.

1 REPLY 1
SASKiwi
PROC Star

Here is your problem statement:

call execute ('data ');

You are submitting the word DATA without a following dataset name and semicolon.

 

Remember you need to put syntactically-correct SAS code within CALL EXECUTE.