Date: Wed, 30 Dec 1998 13:40:31 -0800
Reply-To: "E. S." <sasq98@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: "E. S." <sasq98@YAHOO.COM>
Subject: Re: Differences between PC and Mainframe SAS(Why doesn't NOBS wo
rk?)
Content-Type: text/plain; charset=us-ascii
Well, I must make a confession at this point. I was borrowing some
code from and old program to test whether I had an empty dataset as a
result of a conditional statement in the data step executed
previously. I totally missed the line before the "data _null" step in
the original program:
PROC CONTENTS NOPRINT DATA=COMBO OUT=SEARCH;
Tim is right, as well as a couple of other people who have pointed to
me that the original code would not have run CORRECTLY even in the
mainframe. The code runs fine because the search dataset is the
output of the CONTENTS procedure.
Sorry for the cofusion and thanks for all the advise I have received
from the list.
Ed.
---"Berryhill, Timothy" <TWB2@pge.com> wrote:
>
> Ed, The basis of your confusion is the idea that the original code
would run
> CORRECTLY on a mainframe. The original code, referring to NOBS
without
> using the NOBS option on a SET statement, would not run CORRECTLY on a
> mainframe, or on any other SAS platform.
>
> Tim Berryhill - Contract Programmer and General Wizard
> TWB2@PGE.COM or http://www.aartwolf.com/twb.html
> Frequently at Pacific Gas & Electric Co., San Francisco
> The correlation coefficient between their views and
> my postings is slightly less than 0
>
> > ----------
> > From: E. S.[SMTP:sasq98@YAHOO.COM]
> > Reply To: E. S.
> > Sent: Wednesday, December 30, 1998 11:56 AM
> > To: SAS-L@UGA.CC.UGA.EDU
> > Subject: Differences between PC and Mainframe SAS(Why doesn't NOBS
> > work?)
> >
> > Well, that IS very interesting!
> > I wonder how many other "subtle" differences there are between SAS
PC
> > and the mainframe. I personally am just recently starting to use
SAS
> > on the PC, so if you know of anything else that will give me major
> > headaches I'll appreciate it if you'd let me know.
> > Right now for example I just noticed that the time printed in my
> > output on SAS PC is not the same time as inmy system. As a matter
of
> > fact, is off by 6 hours or so! Is there a way to change the time so
> > it'll be read directly from the PC? I know the mainframe version
> > picks the time from the system.
> > Thanks again,
> > Ed
> >
> > ---Victor Kamensky <kamensky@aecom.yu.edu> wrote:
> > >
> > > Hi,Ed!
> > > You found a difference between PC and mainframe SAS.
> > > Your code does not work on PC because of the following reasons:
> > > a) you did not specify NOBS= option in the SET statement.
> > > b) If you SET data set with 0 observarions, DATA step
> > > terminates and subsequent statements are not executed.
> > >
> > > As your code works on mainframe, mainframe SAS works
> > > differently
> > > a) nobs variable is created automatically.
> > > b)data step does not terminate if you set
> > > a date set with 0 observations.
> > > Now you tell me if this is true for mainframe SAS
> > > (I only use PC).
> > >
> > > Obviously it is not the only difference betwee
> > > SAS language on different platforms.
> > > Did someone listed/documented such things?
> > >
> > > Victor Kamensky
> > > Programmer
> > > Albert Einstein College of Medicine
> > >
> > >
> > >
> > > At 08:54 AM 12/30/98 -0800, you wrote:
> > > >Well, first of all: Thanks Victor!
> > > >This change in the code worked. I'll try to make some sense as
of
> > > >why...
> > > >Ed
> > > >
> > > >---Victor Kamensky <kamensky@aecom.yu.edu> wrote:
> > > >>
> > > >> Hi,Ed!
> > > >> That's the PC modification of your program!
> > > >> Victor Kamensky
> > > >> Programmer
> > > >> Albert Einstein College of Medicine
> > > >> 4061 DATA SEARCH;RUN;
> > > >> NOTE: The data set WORK.SEARCH has 1 observations and 0
variables.
> > > >> NOTE: The DATA statement used 0.05 seconds.
> > > >> 4062 data _null_;
> > > >> 4063 if nobs=0 then put
> > > >> 4064 'EMPTY DATA SET!!!';
> > > >> 4065 set search NObS=NOBS;
> > > >> 4066 run;
> > > >> NOTE: The DATA statement used 0.11 seconds.
> > > >>
> > > >> 4067 DATA SEARCH;STOP;RUN;
> > > >> NOTE: The data set WORK.SEARCH has 0 observations and 0
variables.
> > > >> NOTE: The DATA statement used 0.22 seconds.
> > > >> 4068 data _null_;
> > > >> 4069 if nobs=0 then put
> > > >> 4070 'EMPTY DATA SET!!!';
> > > >> 4071 set search NObS=NOBS;
> > > >> 4072 run;
> > > >> EMPTY DATA SET!!!
> > > >> NOTE: The DATA statement used 0.11 seconds.
> > > >>
> > > >>
> > > >> At 08:12 AM 12/30/98 -0800, you wrote:
> > > >> >This piece of code will work in the mainframe, but for some
> > reason it
> > > >> >won't in the PC. Any ideas as of why??
> > > >> >
> > > >> >543 data _null_;
> > > >> >544 set search;
> > > >> >545 file print;
> > > >> >546 if nobs=0 and _n_ le 1 then put
> > > >> >547 'EMPTY DATA SET!!!';
> > > >> >548 run;
> > > >> >
> > > >> >NOTE: Variable NOBS is uninitialized.
> > > >> >NOTE: 0 lines were written to file PRINT.
> > > >> >NOTE: The DATA statement used 0.0 seconds.
> > > >> >
> > > >> >
> > > >> >Thanks in advance,
> > > >> >Ed
> > > >> >
> > > >> >
> > > >> >
> > > >> >_________________________________________________________
> > > >> >DO YOU YAHOO!?
> > > >> >Get your free @yahoo.com address at http://mail.yahoo.com
> > > >> >
> > > >> >
> > > >>
> > > >>
> > > >
> > > >_________________________________________________________
> > > >DO YOU YAHOO!?
> > > >Get your free @yahoo.com address at http://mail.yahoo.com
> > > >
> > > >
> > >
> > >
> >
> > _________________________________________________________
> > DO YOU YAHOO!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >
>
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com
|