bikeactuary
bikeactuary

Reputation: 497

Proc sql VALIDATE with CREATE TABLE

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?

Upvotes: 1

Views: 467

Answers (1)

DomPazz
DomPazz

Reputation: 12465

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.

Upvotes: 2

Related Questions