SAS Warning: CREATE TABLE statement recursively references target table

SAS allows you to create an operator proc sql create tablewhere the created table recursively refers to itself in the select statement, for example:

proc sql;
     create table t1 as 
     select 
         t1.id
         ,t2.val1 
     from 
         t1
         inner join t2 on t1.id=t2.id
;
quit;

When this expression is executed, a warning message is written to the log.

WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity problem.

This warning can be suppressed with the parameter undo_policy=none. (see Note on using SAS 12062 )

Question:

  • Is it possible to create a table in such a recursive manner, potentially return some unexpected results? Is it possible that this will create different results that will cause the same operation in 2 stages:

     proc sql;
       create table _data_ as 
         select 
           t1.id
           ,t2.val1 
         from 
           t1
           inner join t2 on t1.id=t2.id;
    
         create table t1 as
           select * from &syslast;
    
    quit;
    
  • Is a two-step approach more efficient / safer?

+4
2

, SAS. .

data t1;
 merge t1 t2;
 by id;
run;

SAS , , , t1.sas7bdat t1.sas7bdat. PROC SQL, SAS .

, , , (, Oracle), SAS , .

+2

, , SAS proc sql, . , 100% . , , .

SAS : http://support.sas.com/kb/12/062.html

0

Source: https://habr.com/ru/post/1628859/


All Articles