Date: Wed, 14 Feb 1996 16:06:14 PST
Reply-To: TWB2%Rates%FAR@GO50.COMP.PGE.COM
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: TWB2%Rates%FAR@GO50.COMP.PGE.COM
Subject: More Communications Decency Act Violations
I am debugging a datastep. It is, I must admit, indecently complex and not
suitable for the minds of children--our company probably violated the CDA just
piping the source from our mainframe to my terminal. This datastep begins by
merging three datasets (no keep lists--obscene). Then if _N_ is 1 it sets a
fourth dataset. After that, it checks a classification variable and sets one
of three datasets, using a key (indexed). Next, it calculates some variables.
Finally, it either writes out the results to a dataset or discards the record.
Omitting bunches of stuff, the code looks like:
DATA RESULT;
*debug; put 'B4 MERGE' id= myvar=;
MERGE ... ;
BY ID;
IF _N_ EQ 1 THEN SET ... ;
IF CLASS EQ '1' THEN SET ONE KEY=AKEY;
ELSE IF CLASS EQ '2' THEN SET TWO KEY=BKEY;
MYVAR=...;
IF THIS EQ THAT THEN DELETE;
*debug; put 'AT END' id= myvar=;
RUN;
Here is my problem: nearing the end of the second ob, the final debug line
displays the id and myvar, and myvar is zero. The next statement "executed"
is the RUN, followed by the DATA statement at the top. Then the first debug
line executes. The value of id is unchanged (this is correct, the variable is
SET so it is not reinitialized by default), but the value of myvar is
586.97973633. No executable statements have occurred since the previous debug
statement, but the value has changed. Any thoughts? Does anyone recognize
586.97973633 (if that is your number, you can have it back!)? This is running
in 6.08 on MVS.
Tim Berryhill - Contract Programmer and General Wizard
TWB2@PGE.COM
Frequently at Pacific Gas & Electric Co., San Francisco
The correlation coefficient between their views and
my postings is slightly less than 0
|