由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - macro问题诚心求教非常感谢--continue question
相关主题
macro问题诚心求教非常感谢question about using sas macro variable and do loop
诚心求教一个macro问题 很费解请教这种freq 该用什么code算(sas)?Thanks!
help. sas macroPlease help with a SAS macro
求助:一个SAS小程序How to the macro regression with if?
help for a sas question请帮忙看3道SAS题。
请问SAS ADV 130中74 和80题请教:sas 循环
sas题目恳请前辈指点!!sas question
what is worng with following Macro? Thanks一个关于macro的问题,多谢。
相关话题的讨论汇总
话题: data话题: 30000话题: 15000
进入Statistics版参与讨论
1 (共1页)
l*******a
发帖数: 107
1
I want to save the log output into a sas file,
but in ths test.sas, the ouput is only like this:
this is the data
Please read this in details
How can I get all of the output in the saved sas file like this:
this is the data
Please read this in details
if FundingAmountlength=0-15000 then FundingAmountprice=0.217
if ObjectAmountlength=15000-30000 then ObjectAmountprice=0.318
if FundingAmountlength=30000-60000 then FundingAmountprice=0.519
Thanks!!!
%macro gg(name, length, price);
%put if &name.length=&length then &name.price=&price;
%mend;
data one;
input variableName $14. variableLength : $12. price;
datalines;
FundingAmount 0-15000 0.217
ObjectAmount 15000-30000 0.318
FundingAmount 30000-60000 0.519
;
run;
data two;
filename X "C:\desktop\test.sas";
file X;
set one;
if _n_=1 then do;
put 'this is the data';
put 'Please read this in details';
end;
call execute('%gg('||variableName||', '||variableLength||', '||price||')');
run;
l*******a
发帖数: 107
2
Could you please help me this out?
Thanks very much!
f******u
发帖数: 250
3
don't know if it works;
PROC PRINTTO log="C:\desktop\test.sas" NEW;
RUN;
your file;
PROC PRINTTO log=log;
RUN;
a***d
发帖数: 336
4
run the following once:
options mprint;

【在 l*******a 的大作中提到】
: I want to save the log output into a sas file,
: but in ths test.sas, the ouput is only like this:
: this is the data
: Please read this in details
: How can I get all of the output in the saved sas file like this:
: this is the data
: Please read this in details
: if FundingAmountlength=0-15000 then FundingAmountprice=0.217
: if ObjectAmountlength=15000-30000 then ObjectAmountprice=0.318
: if FundingAmountlength=30000-60000 then FundingAmountprice=0.519

l*******a
发帖数: 107
5
Thanks for all your reply.
But both method did not work....Anyboday know that what's the reason?
Thanks.
f******u
发帖数: 250
6
you can edit the new log.

【在 l*******a 的大作中提到】
: Thanks for all your reply.
: But both method did not work....Anyboday know that what's the reason?
: Thanks.

a***d
发帖数: 336
7
it works ah..
options mprint;
filename clog "C:\desktop\test.txt";
proc printto log=clog;run;
data two;
set one;
if _n_=1 then do;
put 'this is the data';
put 'Please read this in details';
end;
call execute('%gg('||variableName||', '||variableLength||', '||price||')');
run;
proc printto; run;

【在 l*******a 的大作中提到】
: Thanks for all your reply.
: But both method did not work....Anyboday know that what's the reason?
: Thanks.

f******u
发帖数: 250
8
SAS uses clause "file print" to output put statement but I don't why this is
not working for Macro's %put.
data one;
input variableName $14. variableLength : $12. price;
datalines;
FundingAmount 0-15000 0.217
ObjectAmount 15000-30000 0.318
FundingAmount 30000-60000 0.519
;
run;
data two;
set one;
file print;
put 'this is the data';
put 'Please read this in details';
call execute('%gg('||variableName||', '||variableLength||', '||price||')');
run;
l*******a
发帖数: 107
9
Thanks for your reply.
How to edit the new log?
Thanks.
1 (共1页)
进入Statistics版参与讨论
相关主题
一个关于macro的问题,多谢。help for a sas question
一道ADV 130 题目请问SAS ADV 130中74 和80题
请问SAS advanced macro global 和localsas题目恳请前辈指点!!
proc iml help!what is worng with following Macro? Thanks
macro问题诚心求教非常感谢question about using sas macro variable and do loop
诚心求教一个macro问题 很费解请教这种freq 该用什么code算(sas)?Thanks!
help. sas macroPlease help with a SAS macro
求助:一个SAS小程序How to the macro regression with if?
相关话题的讨论汇总
话题: data话题: 30000话题: 15000