实际上,我正试图为下面的代码创建一个宏,因此在proc sql中,我不需要创建两个不同的代码,因为它是从proc import中提取的,并在proc sql中创建两个数据集,
任何帮助都将不胜感激:)
%macro import(market);
FILENAME REFFILE "PLANNING\BASE_PORTFOLIO\BS_PORT/Test/&market..csv";
PROC IMPORT DATAFILE=REFFILE DBMS=CSV OUT=&market.
(KEEP= a b c)
REPLACE;
/*GETNAMES=YES;*/
RUN;
%mend import;
%import (InputFile1);
%import (InputFile2);
PROC SQL;
CREATE TABLE Outfile1 AS
SELECT a,b,c
FROM &market. t1 /*INPUT FILE READ VM*/
GROUP BY a,b,c,
QUIT;
PROC SQL;
CREATE TABLE Outfile2 AS
SELECT a,b,c
FROM &market. t1 /*INPUT FILE READ VM*/
GROUP BY a,b,c,
QUIT;
1条答案
按热度按时间soat7uwm1#
market
是只存在于宏本身中的局部宏变量。添加out
参数,并将sql语句放在宏中。