1
votes

I am working in SAS EG and I have code like this:

proc sql;
CREATE TABLE new as
SELECT f1,f2
FROM work.orig
WHERE f1<>'x'
;

This works.

However, when I add a VALIDATE option, like below, I get an error: ERROR 22-322: Syntax error, expecting one of the following: (, SELECT.

ERROR 202-322: The option or parameter is not recognized and will be ignored.

proc sql;
CREATE TABLE new as
VALIDATE
SELECT f1,f2
FROM work.orig
WHERE f1<>'x'
;

How do I use the validate option in proc sql?

1

1 Answers

2
votes

My understanding is that you cannot use the VALIDATE with the CREATE statement.

Validate the underlying SELECT

proc sql;
VALIDATE
SELECT f1,f2
FROM work.orig
WHERE f1<>'x'
;
quit;

If that is successful, then your CREATE statement will work.