Errors might occur in SAS® 9.3 when you use the INSERT statement in PROC SQL


Using the SQL procedure with INSERT statement syntax, which lists the column names in parentheses, might cause a Read Access Violation to occur. The problem occurs when a column name is misspelled or when the column name does not exist in the target table.

The correct behavior is for an error similar to the following to be written to the SAS log:

ERROR: The following columns were not found in the contributing tables: YYY.
 

See the Full Code section for sample code.

Full Code

This example intentionally causes a Read Access Violation to occur in SAS 9.3.

data one;                 
 x='a'; y='b';            
run;                      
                          
data two;                 
 x='c'; y='d';            
run;                      

/** column Y2 does not exist in table ONE **/                           
proc sql;                 
 insert into one (x, y2)  
 select x                 
       ,y                 
 from two;                
quit;