Date: Wed, 27 Aug 2008 12:01:22 -0500
Reply-To: mpajoh@ODOT.ORG
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Masoud Pajoh <mpajoh@ODOT.ORG>
Subject: data step question
Content-Type: text/plain; charset="US-ASCII"
With the danger of oversimplifying a complicated problem, her it is.
This is correct, note the value of diff=30418.09.
1689 data _null_;
1690 set allbids2040(obs=1);
1691 putlog ">>>>>>>>>>>>> " diff=;
1692 if diff<0 then call execute("proc sort
data=allbids2040(where=(estunitprice ~=.)); by DeltaExtended; run;");
1693 else call execute("proc sort
data=allbids2040(where=(estunitprice ~=.)); by decending DeltaExtended;
run;");
1694 run;
>>>>>>>>>>>>> diff=30418.09
NOTE: There were 1 observations read from the data set WORK.ALLBIDS2040.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
Memory 163k
NOTE: CALL EXECUTE generated line.
1 + proc sort data=allbids2040(where=(estunitprice ~=.)); by decending
DeltaExtended; run;
NOTE: Input data set is already sorted, no sorting done.
NOTE: There were 28 observations read from the data set WORK.ALLBIDS2040.
WHERE estunitprice not = .;
NOTE: The data set WORK.ALLBIDS2040 has 28 observations and 31 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.01 seconds
user cpu time 0.00 seconds
system cpu time 0.01 seconds
Memory 101k
Now basically the same code, I think, as part of a macro, does not do
right! Notice the value of >>>>>>>>>>>>> diff=!!!!!!!!!
MACROGEN(BIDSUMMARY): data _null_;
SYMBOLGEN: Macro variable CO resolves to 040
MACROGEN(BIDSUMMARY): set allbids2040(obs=1);
MACROGEN(BIDSUMMARY): putlog ">>>>>>>>>>>>> " diff=;
SYMBOLGEN: Macro variable CO resolves to 040
MACROGEN(BIDSUMMARY): if (diff<0) then call execute("proc sort
data=allbids2040(where=(estunitprice ~=.)); by DeltaExtended; run;");
SYMBOLGEN: Macro variable CO resolves to 040
MACROGEN(BIDSUMMARY): else call execute("proc sort
data=allbids2040(where=(estunitprice ~=.)); by decending DeltaExtended;
run;");
MACROGEN(BIDSUMMARY): run;
>>>>>>>>>>>>> diff=
MACROGEN(BIDSUMMARY): proc sort data=allbids2040(where=(estunitprice
~=.));
MACROGEN(BIDSUMMARY): by DeltaExtended;
MACROGEN(BIDSUMMARY): run;
NOTE: There were 1 observations read from the data set WORK.ALLBIDS2040.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
Memory 162k
NOTE: CALL EXECUTE generated line.
1 + proc sort data=allbids2040(where=(estunitprice ~=.)); by
DeltaExtended; run;
MACROGEN(BIDSUMMARY): proc sort data=allbids2040(where=(estunitprice
~=.));
MACROGEN(BIDSUMMARY): by DeltaExtended;
MACROGEN(BIDSUMMARY): run;
NOTE: There were 28 observations read from the data set WORK.ALLBIDS2040.
WHERE estunitprice not = .;
NOTE: The data set WORK.ALLBIDS2040 has 28 observations and 31 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
Memory 142k
does anyone know why this happens?