sql - Proc Sql Select Into 正在创建一个我无法调用的临时变量
问题描述
我正在尝试使用 proc sql select into 创建一个变量,然后尝试稍后调用。这个变量是平均价格(BlockPrice)。
proc sql;
create table Block_Price_Calc as
select mean(Price) Into : BlockPrice
from Data1
Where As_Of_Date >= '31MAR2015'd and As_Of_Date < '07APR2015'd;
quit;
%put &BlockPrice;
proc sql;
create table Want as
select *,
(&BlockPrice) as Block
from Data2;
quit;
变量 BlockPrice 未被识别,它似乎被存储为临时变量。有什么想法吗?
解决方案
INTO子句不能在 CREATE TABLE 语句中使用。
proc sql;
select mean(Price) Into : BlockPrice
from Data1
Where As_Of_Date >= '31MAR2015'd and As_Of_Date < '07APR2015'd;
quit;
推荐阅读
- react-native - create-react-native-app - 弹出不创建 index.js
- kubernetes-helm - helm 模板:如何将模板的结果分配给变量
- python - 如何在数据框熊猫中将一列拆分为两列?
- python - 如何在网上刮掉所有击球手的名字?
- opendaylight - opendaylight 是一个死项目吗?
- android - Android Studio - 签名的 SDK,任务失败“android:mergeReleaseResources”
- c# - c#从二进制文件反序列化加密对象时出现异常
- c++ - 尝试编译此代码时遇到问题
- ios - 如何使用 RegEx 测试阿拉伯语中的阿联酋号码?
- reactjs - 可以篡改反应状态以绕过安全措施吗?