Newsgroups: bit.listserv.sas-l
Date:         Wed, 11 Nov 1992 20:14:10 EST
Reply-To:     Andy Norton <76350.1604@COMPUSERVE.COM>
From:         Andy Norton <76350.1604@COMPUSERVE.COM>
Subject:      Re: VIEWs & RENAMEs
Comments: To: SAS-L <SAS-L@AWIIMC12.IMC.UNIVIE.AC.AT>

----------------------------------------------------------------------
CONTENT:   Response
SUMMARY:   DATA-step view binding PDV at compilation -- not happy
REL/PLTF:  6.07.01/CMS, 6.04/PC-DOS
E-ADDR:    76350.1604@compuserve.com
NAME:      Andy Norton
ADDRESS:   Trilogy Consulting, 5228 Lovers Lane, Kalamazoo MI 49002
PHONE:     (616) 344-2191
----------------------------------------------------------------------

Tom Skinner, Rich Levin, and Howard Scheier have been having an
exchange regarding data-step-views and the handling of the RENAME
statement.

Tom says:
> So to summarize, although the RENAME STATEMENT is said to be
> DECLARATIVE, that is to take effect at compilation, these results
> dispute that.

In a subsequent message, Tom adds:
> And if the audience out there isn't confounded yet, I'd be amazed...

Well, I won't amaze Tom by admitted that I'm confounded and can't
assemble enough mental energy tonight to fully comprehend all of the
investigations.  But I think an important piece of information has been
disregarded:  SAS Usage Note V6-SYS.DATA-4755.  I'm not exactly sure
how it relates, but the usage note bears directly on changes in the PDV
between compilation and execution.  I am familiar with the history of
this note and it deserves more attention.

DATA-step views compile when the view is defined.  This requires that
the type, length, and position of referenced variables be fixed at
compilation time.

DATA steps can process variables which are not explicitly referenced in
the program, copying them from input to pdv to output.  In version
6.06 DATA-step views, you could add additional variables to the input
data sets, and these variables would be copied to the output data
sets, just as with ordinary DATA steps.  I have notes on how this
worked in 6.06 days:
"Additional variables may be added at execution time, but they will be
at the end of the PDV and not referenced by variable lists.  Changed
types will cause an error.  Changed lengths will be truncated or
extended to match the compiled length.  Dropped vars will appear on the
PDV with missing values."

Now, in 6.07 (CMS), Usage note 4755 ("VARIABLE NOT DEFINED TO STORED
PROGRAM message") states that "descriptor information [on input data
sets] cannot change subsequent to compilation and prior to
execution."  In particular, you cannot add additional unreferenced
variables to the PDV prior to execution.

<flame on>
The annoying part is that this behavior is described as SAS being "more
rigorous in its validation".  In other words, it is not classified as a
bug.  An informed source from the usual place told me that this was
initially listed as a bug, and then reclassified amidst internal
controversy.

To me, the ability to write programs that can process datasets
differing in irrelevant characteristics is a distinguishing feature of
SAS.  The ability to pass unreferenced variables through a data step is
one of the key features making SAS programs easy to maintain.  DATA
steps and DATA-step views are now not interchangeable in this regard.

SAS Institute always has had problems recognizing the strong points of
their products.

Oh well, SAS's implementation of SQL SELECT * works at execution time
so I can always use that.

<flame off>
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Subject: (no subject given)