proc sql;
%tdlink;
create table tvest1 as
select *
from connection to teradata
(
SELECT t1.Subst_Corp_Name as "单位名称"
,t1.Subst_Salary_Cnt as "代发工资笔数"
,t1.Subst_Salary_Amt as "代发工资金额"
,t1.Int_Org_Num as "网点号"
,case when t1.Biz_Type_Num = 'T24001' then '主机代发工资'
when t1.Biz_Type_Num = 'T24002' then '网银代发工资'
else '为空' end as "渠道"
from dwsumview.C03_SUBST_SALARY t1
where t1.data_dt = '2018-03-01'
and substr(t1.Int_Org_Num,4,4) = '1508'
);
disconnect from teradata;
quit;