由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - SAS help : how to macro ods
相关主题
请教一个SAS 数据分配问题sas 代码问题
请教一个SAS Macro的问题【包子】求问个简单sas macro问题
help need for SAS macroNeed advice on SAS macro debugging
SAS macro question一个常见的问题
SAS输出到Excel/pdf请教一道SAS MACRO编程的问题。怎么都不明白。谢谢
Stupid SAS programming style is driving me crazy....请教SAS IML调用DATA step数据的问题
sas macro 问题[Help] Dividing a SAS data set
Weird SAS macro bugs, 包子重谢!请教一个SAS Macro问题。谢谢
相关话题的讨论汇总
话题: ods话题: pdf话题: html话题: macro话题: close
进入Statistics版参与讨论
1 (共1页)
p***r
发帖数: 920
1
I wanna switch easily between two type of ods pdf/html, how can I code a
macro to control the on/off of ods, the manual structure is as following,
what I do so far is keeping quote and unquote which is somewhat tedious.
any suggestoin?
ods listing close;
/*ods html file="&add.\table.xls";*/
ods pdf file="&add.\table.pdf"; options orientation=landscape nodate
nonumber missing=" " papersize="letter";
ods pdf close;
/* ods html close;*/
ods listing;
o****o
发帖数: 8077
2
will this work for u? If so, pls reward me some baozi
%let pdfoff=%str(*);
%let htmloff=%str(*);
ods listing close;
&htmloff. ods html file="&add.\table.xls";
&pdfoff. ods pdf file="&add.\table.pdf";
options orientation=landscape nodate
nonumber missing=" " papersize="letter";
/* yada yada yada */
&pdfoff. ods pdf close;
&htmloff. ods html close;
ods listing;

【在 p***r 的大作中提到】
: I wanna switch easily between two type of ods pdf/html, how can I code a
: macro to control the on/off of ods, the manual structure is as following,
: what I do so far is keeping quote and unquote which is somewhat tedious.
: any suggestoin?
: ods listing close;
: /*ods html file="&add.\table.xls";*/
: ods pdf file="&add.\table.pdf"; options orientation=landscape nodate
: nonumber missing=" " papersize="letter";
: ods pdf close;
: /* ods html close;*/

p***r
发帖数: 920
3
kinda on the right track but I think there should be a better version.

【在 o****o 的大作中提到】
: will this work for u? If so, pls reward me some baozi
: %let pdfoff=%str(*);
: %let htmloff=%str(*);
: ods listing close;
: &htmloff. ods html file="&add.\table.xls";
: &pdfoff. ods pdf file="&add.\table.pdf";
: options orientation=landscape nodate
: nonumber missing=" " papersize="letter";
: /* yada yada yada */
: &pdfoff. ods pdf close;

p***r
发帖数: 920
4
转给用户:oloolo,现金(伪币):20,收取手续费:0.20
p***r
发帖数: 920
5
I'm thinking of just one change can make one on and other off.

【在 o****o 的大作中提到】
: will this work for u? If so, pls reward me some baozi
: %let pdfoff=%str(*);
: %let htmloff=%str(*);
: ods listing close;
: &htmloff. ods html file="&add.\table.xls";
: &pdfoff. ods pdf file="&add.\table.pdf";
: options orientation=landscape nodate
: nonumber missing=" " papersize="letter";
: /* yada yada yada */
: &pdfoff. ods pdf close;

o****o
发帖数: 8077
6
then wrap it into a macro:
%macro switch(type);
%global s1 s2;
%if %upcase(&type) eq HTML %then %do;
%let s1=html;
%let s2=xls;
%end;
%else %if %upcase(&type) eq PDF %then %do;
%let s1=pdf;
%let s2=pdf;
%end;
%mend;
%switch(pdf);
ods listing close;
ods &s1 file="&add.\table.&s2";
options orientation=landscape nodate
nonumber missing=" " papersize="letter";
ods &s1 close;
ods listing;

【在 p***r 的大作中提到】
: I'm thinking of just one change can make one on and other off.
d*******o
发帖数: 493
7
Similar to oloolo's.
%macro odsswitch(switch = );
%if %eval(&switch) = 0 %then %do;
ods html file="&add.\table.xls";
%end;
%else %if %eval(&switch) = 1 %then %do;
ods pdf file="&add.\table.pdf"
%end;
%else %goto exit;
ods _all_ close;
ods listing;
%exit:;
%mend;
1 (共1页)
进入Statistics版参与讨论
相关主题
请教一个SAS Macro问题。谢谢SAS输出到Excel/pdf
请教一个SAS ADV 的题目Stupid SAS programming style is driving me crazy....
请帮忙看3道SAS题。sas macro 问题
A problem from SAS Adv testWeird SAS macro bugs, 包子重谢!
请教一个SAS 数据分配问题sas 代码问题
请教一个SAS Macro的问题【包子】求问个简单sas macro问题
help need for SAS macroNeed advice on SAS macro debugging
SAS macro question一个常见的问题
相关话题的讨论汇总
话题: ods话题: pdf话题: html话题: macro话题: close