LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2001, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sat, 30 Jun 2001 02:40:45 +0100
Reply-To:     John Whittington <John.W@MEDISCIENCE.CO.UK>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         John Whittington <John.W@MEDISCIENCE.CO.UK>
Subject:      Re: Will scientific notation for array declaration be supported
              in version 9?
Comments: To: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
In-Reply-To:  <E15G3Gm-00036n-00@relay1.netnames.net>
Content-Type: text/plain; charset="us-ascii"; format=flowed

At 12:45 29/06/01 -0600, Jack Hamilton wrote (in part):

> >data <..> ; > > array a (1 : nobs) <....> ; > > if _n_=1 then do _n_=1 to nobs ; > > set <..> nobs=nobs ; > > a (_n_) = <....> ; > > end ; > > <....> > >run ; > > > >I was assured that it is not difficult to do, either... > >Really? I think it would be impossible to do in some cases. What if the >dataset is actually a view?

Jack, whilst it's certainly true that it would be impossible if the input 'dataset' was a view (and perhaps in some other circumstances), I'm not sure that is, in itself, a good reason for denying Paul the array declaration syntax he would like ....

... the problem you describe would be the result of bad (incorrect) programming. Currently perfectly syntactically correct code will fail (or behave other than intended) if it attempts to make use of nobs= with a view. For example, whilst the code Paul has hypothesised above is not available at present (with respect to the array statement, the following very similar code is syntactically perfectly acceptable:

data <..> ; array a (1 : 10000) <....> ; if _n_=1 then do _n_=1 to nobs ; set <..> nobs=nobs ; a (_n_) = <....> ; end ; <....> run ;

... but that code will not work if the 'dataset' being SET is a view.

The problem simply is that nobs= cannot be used (for ANY purpose) with a view, and that anyone who tries to do that is writing unacceptable code. I don't see why that should deprive Paul of the syntax he wants in DATA steps in which nobs= IS valid. Although it is a fairly trivial exercise to get nobs into a macro variable for Paul's purpose, that does involve an additional (albeit very short/quick) DATA step.

It worries me sometimes when I see people regarding datasets and views as 'interchangeable'. There clearly are some differences, which mean that some code CANNOT be used for both a dataset and a view, and what we are talking about is one of those differences.

That's how I see it, anyway.

Kind Regards,

John

---------------------------------------------------------------- Dr John Whittington, Voice: +44 (0) 1296 730225 Mediscience Services Fax: +44 (0) 1296 738893 Twyford Manor, Twyford, E-mail: John.W@mediscience.co.uk Buckingham MK18 4EL, UK mediscience@compuserve.com ----------------------------------------------------------------


Back to: Top of message | Previous page | Main SAS-L page