sas宏.docVIP

  • 7
  • 0
  • 约 7页
  • 2016-11-27 发布于河南
  • 举报
sas宏

libname kunmingD:\kunming; libname sasdata D:\workshop\sas_data; /******************************************************/ /* 程序:sas_to_ccms */ /* 参数:date */ /* 数据源: */ /* sasdata.playyyyymm */ /* 结果:生成数据表 programyyyymmdd.csv */ /* 作者:PW */ /* 时间:2012-08-13 */ /* 修改内容: */ /* 修改人: */ /* 修改时间: */ /* 修改内容: */ /* 修改人: */ /* 修改时间: */ /******************************************************/ /* 把TXT文件导入到SAS中 */ %macro sas_to_ccms(date); %if %sysfunc(month(date))10 %then %let month=%sysfunc(compress(0%sysfunc(compress(%sysfunc(month(date)))))); %else %let month=%sysfunc(compress(%sysfunc(month(date)))); %if %sysfunc(day(date))10 %then %let day=%sysfunc(compress(0%sysfunc(compress(%sysfunc(day(date)))))); %else %let day=%sysfunc(compress(%sysfunc(day(date)))); %let record_date=%sysfunc(compress(%sysfunc(year(date))))monthday; %let name=%sysfunc(compress(%sysfunc(year(date))))month; %if %sysfunc(month(date))=1 %then %do; %let l_year=%sysfunc(int(%sysfunc(year(date))-1)); %let l_month=12; %end; %else %do; %let l_year=%sysfunc(year(date)); %let temp=%sysfunc(int(%sysfunc(month(date))-1)); %if temp10 %then %let l_month=%sysfunc(compress(0%sysfunc(compress(temp)))); %else %let l_month=%sysfunc(compress(temp)); %end; %let l_name=l_yearl_month; %put l_name; /* %syslput date=date;*/ /* %syslput record_date=record_date;*/ /* %syslput name=name;*/ /* %syslput l_name=l_name;*/ /*rsubmit;*/ proc sql noprint; create table kunming.ccms_log as select distinct count

文档评论(0)

1亿VIP精品文档

相关文档