Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have multiple tables called var1, var2, var3 and want to join them to my table new1.

(我有多个名为var1,var2,var3的表,并希望将它们加入到我的表new1中。)

I would like something like the code below so that I can specify the number of var tables.

(我想要类似以下代码的内容,以便可以指定var表的数量。)

Any help to get the something working in the format below will be great.

(以下面的格式进行操作的任何帮助都将非常有用。)

%macro sqlloop(start,end); 
   PROC SQL; 
     %DO tab_=&start. %TO &end.; 
       CREATE TABLE fin as 
       SELECT * FROM new1 a join varx&tab_. b
                            on a.obs=b.obs; 
     %END; 
   QUIT;
%mend; 

%sqlloop(start=1, end=3)
  ask by S Kohli translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
639 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...