Date: Wed, 16 Apr 1997 11:15:56 PDT
Reply-To: "Cubicle #: 500-2S-707" <tcermack@AMERHONDA.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: "Cubicle #: 500-2S-707" <tcermack@AMERHONDA.COM>
Subject: MVS output different from UNIX output
The data step in question (listed at the end of this posting) was
originally running in MVS. Then we converted to UNIX, and this program and
the probability table were sent across to UNIX. The code is identical on
both systems; the tables are identical on both systems. However, the
result is different.
When run in MVS, the "miletabl.ftable" returns, say, obs 42, for a given
input value.
When run in UNIX, the same input value returns obs 43 from the table.
UNIX returns one obs higher than MVS every time, no matter what the input
value.
Note that VALUE is the same in MVS and UNIX for each run, in the above case,
VALUE=43.
If we remove the " +1 " from the VALUE calculation on UNIX, UNIX then
returns obs 42 (which is what we're interested in) and VALUE=42 (which we
don't care about). So, we know HOW to fix it, we just don't know WHY it's
happening.
We're baffled. Anyone know why this is happening?
Many Thanks,
Tracy Cermack
American Honda Motor Co.
tcermack@amerhonda.com
--------------------------------------------- data step
-------------------
DATA SALBYMIL(KEEP=SALES MILE) ;
IF _N_ = 1 THEN SET ONELINE(DROP=PERC);
RETAIN PREVQ;
PREVQ=0;
DO MILE = 5000 TO 50000 BY 5000;
NUMER = 0;
DENOM = 0;
IF MILE < 50000 THEN DO K=1 TO TOBS;
SET SALBYDAY(KEEP=SALEPDAY) POINT=K NOBS=TOBS;
IF TOBS NE K THEN
VALUE=((ROUND(MILE / (TOBS-K),.1))*10) +1 ;
ELSE VALUE = 1101;
IF VALUE GT 1100 THEN PROB = 1;
ELSE IF VALUE LT 0.1 THEN PROB = 0;
ELSE SET MILETABL.FTABLE POINT=VALUE;
NUMER + (SALEPDAY*PROB);
DENOM + SALEPDAY;
END;
IF MILE < 50000 THEN Q = NUMER / DENOM;
ELSE Q=1;
SALES = (SUMSALES-SUMCLAIM) * (Q-PREVQ);
PREVQ=Q;
OUTPUT;
END;
STOP;
RUN;
-------------------------------------------------------------