请选择 进入手机版 | 继续访问电脑版
楼主: 踩云飞
4216 6

哪位大神能详细总结一下dde输出到excel模板 [推广有奖]

  • 0关注
  • 0粉丝

博士生

98%

还不是VIP/贵宾

-

威望
0
论坛币
53 个
通用积分
1.0000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
35189 点
帖子
85
精华
0
在线时间
635 小时
注册时间
2010-3-8
最后登录
2021-9-22

踩云飞 发表于 2016-10-18 14:58:10 |显示全部楼层 |坛友微信交流群

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
将结果自动写入excel模板的指定位置,详细的程序说明,每一步、每个参数都是干什么的,哪位大神能总结一下!
看了网上搜的一些帖子,感觉都比较混乱,不够全面。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:excel模板 EXCEL xcel exce DDE excel 干什么 程序 网上

edzxp 发表于 2016-10-18 23:10:39 |显示全部楼层 |坛友微信交流群
first of all, define areas in EXCEL under Name Manager, then you can treat them as SAS table in a SAS library. The following is an example.

This piece of code can be used in a Macro to do repeated reports automation.

Hope it helps a little bit.


libname pcn_rep pcfiles path="&path_results.\&file_name." unicode=yes;
/*******************************************************************************************/

proc sql;
  drop table pcn_rep.treaty;
  drop table pcn_rep.nontreaty;
  drop table pcn_rep.physician_list;
  drop table pcn_rep.treaty_cut;
  drop table pcn_rep.non_treaty_cut;
quit;

data pcn_rep.treaty;
  set treaty;
run;

data pcn_rep.nontreaty;
  set nontreaty;
run;

data pcn_rep.physician_list;
  set physician_list;
run;

data pcn_rep.treaty_cut;
set treaty_cut;
run;

data pcn_rep.non_treaty_cut;
set non_treaty_cut;
run;

libname pcn_rep clear;

使用道具

xjffr 在职认证  发表于 2016-10-19 09:29:24 |显示全部楼层 |坛友微信交流群

谢谢楼主分享啊!

使用道具

踩云飞 发表于 2016-10-20 13:40:26 |显示全部楼层 |坛友微信交流群
edzxp 发表于 2016-10-18 23:10
first of all, define areas in EXCEL under Name Manager, then you can treat them as SAS table in a SA ...
这个好像不是dde输出吧?我说的是,如果excel模板里已经设好格式,而且需要把数据写到指定的位置,不是整个sheet,这个能做到吗?

使用道具

踩云飞 发表于 2016-10-20 13:41:34 |显示全部楼层 |坛友微信交流群
xjffr 发表于 2016-10-19 09:29
谢谢楼主分享啊!
???

使用道具

踩云飞 发表于 2016-10-25 17:40:03 |显示全部楼层 |坛友微信交流群
up……

使用道具

陈俊军 发表于 2017-7-6 16:03:42 |显示全部楼层 |坛友微信交流群
options noxwait noxsync;
x '"E:\work\消费金融日报\消费金融日报数据源\消费金融日报格式.xlsx"';     /* 该文件为固定的报表模板,可以事先调整好单元格格式、字体颜色,事先写好其他不变的内容 */
data _null_;
rc=sleep(10);               /* sas睡眠10秒,是为了给打开上述文件留时间 */
run;
filename r1 dde 'excel|[消费金融日报格式.xlsx]sheet2!r3c3:r416c32' ;  /* 对某张表某些单元格进行写入 */
data _null_;
set zong;
file r1 notab linesize=2000;    /* DDE默认空格为分隔符,如果一个变量中间有空格将会分开到两个单元格,用notab即可避免,linesize赋予一个足够大的值,则过长的变量不会错行 */
put  sq_history '09'x sq_month '09'x sq_day '09'x  ;
run;

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-19 03:34