Date: Tue, 4 Mar 2003 13:30:43 -0500
Reply-To: Huck <huck@FINN.NOSPAM.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Huck <huck@FINN.NOSPAM.COM>
Organization: Posted via Supernews, http://www.supernews.com
Subject: Re: "Rules" for naming etc datasets and views in same library
Content-Type: text/plain; charset=us-ascii
On 4 Mar 03 15:30:36 GMT, peetie_wheatstraw@lycos.com (Peetie
Wheatstraw) wrote:
>On Mon, 3 Mar 2003 09:25:57
> Ed Heaton wrote:
>>Peetie,
>>
>>Your answer is no. A view and a data set in the same library cannot have
>>the same name.
>
>You answer a question invented by yourself, not I.
>
>I asked about:
>
>>Is there any way to allow replacement of a dataset with a
>>same-named view (and vice-versa) ...
%MACRO utldrpds(ids=
,ilib=
);
%* the drop is just incase it was around as a view or dataset
;
%* and we are trying to make the other one
;
%local dstype;
%utlftype(ids=&ids
,ilib=&ilib
,outvar=dstype
);
%if %length(&dstype) ne 0
%then %if &dstype eq DATA %then %do; proc sql; drop table
&ilib..&ids; %end;
%else %if &dstype eq VIEW %then %do; proc sql; drop view
&ilib..&ids; %end;
%MEND;
>
>Replacement. R-e-p-l-a-c-e-m-e-n-t. Not co-existence.
>
>Evidently "Replacement" is not practical.
>
>I also asked about "rules" ...
RULES, we dont need no stinking rules
a name is a name.
oh yeah ,,,
%macro utlftype(ids =
,ilib =
,outvar=dstype
);
%let ilib=%upcase(&ilib);
%let ids =%upcase(&ids);
proc sql noprint;
SELECT memtype into:&outvar
FROM sashelp.vtable
WHERE libname="&ilib"
and memname="&ids"
and memtype="DATA" ;
%if %length(&&&outvar) eq 0 %then %do;
SELECT memtype into:&outvar
FROM sashelp.vview
WHERE libname="&ilib"
and memname="&ids"
and memtype="VIEW" ;
%end;
%mend;
there are other ways, that one works for me.
and now that i look closer i see a speedup ... hmmm
>
>>Imagine the problems if they could.
>>Suppose you could and did have a data set myLib.myDat and a view
>>myLib.myDat. Then, if you coded...
>>
>>Proc freq data=myLib.myDat ;
>>Run ;
>>
>>would the FREQ procedure process the data set or the view?
>
>Would be a hulluva mess, wouldn't it? :-)
>
> Cheers,
> Peetie
>
>------------------------------------------------------------
>| Peetie Wheatstraw peetie_wheatstraw@lycos.com |
>------------------------------------------------------------
>
>>Edward Heaton, Senior Systems Analyst,
>>Westat (An Employee-Owned Research Corporation),
>>1600 Research Boulevard, Room RW-3541, Rockville, MD 20850-3195
>>Voice: (301) 610-4818 Fax: (301) 610-5128
>>mailto:EdHeaton@westat.com http://www.westat.com
>>
>>
>>
>>-----Original Message-----
>>From: Peetie Wheatstraw [mailto:peetie_wheatstraw@LYCOS.COM]
>>Sent: Sunday, March 02, 2003 7:33 PM
>>To: SAS-L@LISTSERV.UGA.EDU
>>Subject: "Rules" for naming etc datasets and views in same library
>>
>>
>>Hi,
>>
>>SAS datasets (memtype=DATA) and SAS views (memtype=VIEW)
>>often reside in the same library. What are the rules
>>for naming etc such entities? I searched the onlinedoc
>>and didn't find anything.
>>
>>Replacing datasets with same-named datasets has long
>>been common practice and may save disk space. Is there
>>any way to allow replacement of a dataset with a
>>same-named view (and vice-versa) avoiding the following
>>problem?
>>
>>786 data one / view=one; x=4; run;
>>
>>ERROR: Unable to create WORK.ONE.VIEW because WORK.ONE.DATA already exists.
>>ERROR: Unable to save DATA STEP view WORK.ONE.
>>NOTE: The SAS System stopped processing this step because of errors.
>>
>>Are there different rules for sql-created views and
>>data-step views?
>>
>>Etc etc.
>>
>> Thanx,
>> Peetie
>>
>>------------------------------------------------------------
>>| Peetie Wheatstraw peetie_wheatstraw@lycos.com |
>>------------------------------------------------------------
>>
>>
>>_____________________________________________________________
>>Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
>>http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus
>>
>
>
>_____________________________________________________________
>Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
>http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus
|