如何在 sas 数据步骤中获取当前 table 名称?
How to get current table name inside sas data step?
我需要加入一些 table 并创建一个带有一些标记的新列以指示数据来自 table。
我有 tbl_202101、tbl_202102 ... tbl_202109。我需要加入所有,添加一个新列table_origin,例如,表示各自的table。
DATA FINAL_TABLE;
SET TBL_202101 - TBL_202109;
/* Here I don't know how to identify the current table */
table_origin = CASE
WHEN *CURRENT TABLE* = TBL_202101 THEN 202101
WHEN *CURRENT TABLE* = TBL_202102 THEN 202102
AND GO ON...
RUN;
我该怎么做?
设置语句选项
INDSNAME=variable
creates and names a variable that stores the name of the SAS data set
from which the current observation is read. The stored name can be a data
set name or a physical name. The physical name is the name by which the
operating environment recognizes the file.
我需要加入一些 table 并创建一个带有一些标记的新列以指示数据来自 table。
我有 tbl_202101、tbl_202102 ... tbl_202109。我需要加入所有,添加一个新列table_origin,例如,表示各自的table。
DATA FINAL_TABLE;
SET TBL_202101 - TBL_202109;
/* Here I don't know how to identify the current table */
table_origin = CASE
WHEN *CURRENT TABLE* = TBL_202101 THEN 202101
WHEN *CURRENT TABLE* = TBL_202102 THEN 202102
AND GO ON...
RUN;
我该怎么做?
设置语句选项
INDSNAME=variable
creates and names a variable that stores the name of the SAS data set
from which the current observation is read. The stored name can be a data
set name or a physical name. The physical name is the name by which the
operating environment recognizes the file.