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. |