Hi I am using proc transreg in a SAS Macro.
The code listed as follows,
%if &cnt_amt>0 %then %do;
ods output boxcox=boxcox;
proc transreg data=data0;
where &response>0;
model BoxCox(&response / lambda=0.05 to 1 by 0.05) = identity(&vars_amt);
run;
data _null_;
set boxcox;
if ci='<';
call symput ('lambda',lambda);
run;
%end; /* %if cnt_amt>0 ... */
%else %let lambda=0.4;
When I run the code on my work computer, the code run perfectly fine and does not give me any error message. However, when I run the code on my personal laptop, the code gives me an error message and the dataset work.boxcox is not generated.
I have been spending two weeks on this issue. Any help will be truly appreciated.
Following up,
Here is the log when the code is running perfectly on my work computer,the dataset boxcox is generated
MPRINT(MIXTRAN): ods exclude all ;
MPRINT(MIXTRAN): ;
MPRINT(MIXTRAN): ** ods exclude all ;
MPRINT(MIXTRAN): ods exclude all ;
MPRINT(MIXTRAN): ;
MPRINT(MIXTRAN): ** ods exclude all ;
SYMBOLGEN: Macro variable TITLES resolves to 4
MPRINT(MIXTRAN): title5 "Starting Estimates for Amount Model" ;
SYMBOLGEN: Macro variable LAMBDA resolves to
MLOGIC(MIXTRAN): %IF condition &lambda eq is TRUE
SYMBOLGEN: Macro variable CNT_AMT resolves to 2
MLOGIC(MIXTRAN): %IF condition &cnt_amt>0 is TRUE
MPRINT(MIXTRAN): ods output boxcox=boxcox;
NOTE: There were 872 observations read from the data set WORK._PERSONS.
NOTE: The data set WORK._PERSONS has 872 observations and 8 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.04 seconds
cpu time 0.03 seconds
MPRINT(MIXTRAN): proc transreg data=data0;
SYMBOLGEN: Macro variable RESPONSE resolves to totaldfe
MPRINT(MIXTRAN): where totaldfe>0;
SYMBOLGEN: Macro variable RESPONSE resolves to totaldfe
SYMBOLGEN: Macro variable VARS_AMT resolves to WEEKEND SEQORDER
MPRINT(MIXTRAN): model BoxCox(totaldfe / lambda=0.05 to 1 by 0.05) = identity(WEEKEND
SEQORDER);
MPRINT(MIXTRAN): run;
**NOTE: The data set WORK.BOXCOX has 20 observations and 7 variables.**
NOTE: There were 936 observations read from the data set WORK.DATA0.
WHERE totaldfe>0;
NOTE: PROCEDURE TRANSREG used (Total process time):
real time 0.08 seconds
cpu time 0.04 seconds
Here is the log when the code is not running well on my laptop. The dataset boxcox is not generated
MPRINT(MIXTRAN): ** ods exclude all ;
SYMBOLGEN: Macro variable TITLES resolves to 4
MPRINT(MIXTRAN): title5 "Starting Estimates for Amount Model" ;
SYMBOLGEN: Macro variable LAMBDA resolves to
MLOGIC(MIXTRAN): %IF condition &lambda eq is TRUE
SYMBOLGEN: Macro variable CNT_AMT resolves to 2
MLOGIC(MIXTRAN): %IF condition &cnt_amt>0 is TRUE
MPRINT(MIXTRAN): ods output boxcox=boxcox;
NOTE: There were 872 observations read from the data set WORK._PERSONS.
NOTE: The data set WORK._PERSONS has 872 observations and 8 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
MPRINT(MIXTRAN): proc transreg data=data0;
SYMBOLGEN: Macro variable RESPONSE resolves to totaldfe
MPRINT(MIXTRAN): where totaldfe>0;
SYMBOLGEN: Macro variable RESPONSE resolves to totaldfe
SYMBOLGEN: Macro variable VARS_AMT resolves to WEEKEND SEQORDER
MPRINT(MIXTRAN): model BoxCox(totaldfe / lambda=0.05 to 1 by 0.05) = identity(WEEKEND SEQORDER);
MPRINT(MIXTRAN): run;
NOTE: There were 936 observations read from the data set WORK.DATA0.
WHERE totaldfe>0;
NOTE: PROCEDURE TRANSREG used (Total process time):
real time 0.10 seconds
cpu time 0.03 seconds
** The dataset boxcox is not generated **
Thank you!