| Date: | Tue, 2 Nov 1999 20:41:26 +0100 |
| Reply-To: | peter.crawford@DB.COM |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Peter Crawford <peter.crawford@DB.COM> |
| Subject: | Re: how to preserve the sas dataset date? |
|
| Content-type: | text/plain; charset=us-ascii |
|---|
This(identifying processes which replace a data set rather than just modify it)
will become even more important to those who are looking forward to the Audit
Trail features that are intoduced with the Nashville Release (v8 for most of us
outside USA).
An audit Trail will trace those changes in the dataset that are currently hard
to track. (eg someone using fsedit to make a "quick" change)
However, once a create date is replaced with a careless proc sort data= x.x ;
by ..... ; run; or data x.x; set x.x; ...<processing> ... run;
all that audit trail is thrown away! That is just the same relationship as a
data set index.
So the audit trail would be useful for those situations where a SAS data set is
used through fsview, fsedit, viewtable, or af-applications offering update
(buit not create) access.
With the information available through the audit trail, it will be possible to
detect where the modified date may be updated but the data hasn't changed. If I
understand it correctly, this may eliminate that need of the original poster -
"to preserve the sas dataset date"
here's hoping
Regards
Peter Crawford
Datum: 02.11.99 20:24
An: SAS-L@listserv.uga.edu
Antwort an: Howard_Schreier@ita.doc.gov
Betreff: Re: how to preserve the sas dataset date?
Nachrichtentext:
There is a distinction to be made between, on the one hand, modifying a
data set, and, on the other hand, replacing a data set with a new data
set having the same name. Even "PROC SORT DATA=WHATEVER;" is implicitly
"PROC SORT DATA=WHATEVER OUT=WHATEVER;" and brings about a replacement.
Besides the MODIFY statement in a DATA step, there are some procedures
which modify in place. The following code demonstrates three (PROC
DATASETS, PROC APPEND, PROC SQL).
data test;
input x y;
cards;
1 2
3 4
;
proc contents data=test; run;
data more;
input x y;
cards;
5 6
;
data _null_; if sleep(120); run;
proc datasets; modify test (label='New Label'); quit;
proc contents data=test; run;
data _null_; if sleep(120); run;
proc append base=test data=more; run;
proc contents data=test; run;
data _null_; if sleep(120); run;
proc sql;
insert into test select * from more;
quit;
proc contents data=test; run;
> Date: Tue, 26 Oct 1999 13:57:49 -0500
> From: Randy Childs <rchilds@BOSTONBIO.COM>
> Subject: Re: how to preserve the sas dataset date?
>
> Be careful in using these dates. I think that the "Date Modified" that
> you get from PROC CONTENTS is not what you might think intuitively. This
> date will only be different from the "Date Created" if you use the
> MODIFY statement in a data step. I'm not sure of the exact structure of
> the code since I don't perform data steps this way and don't want to
> bother looking it up in the manual, but something like
>
> DATA PERM.JUNK;
> MODIFY PERM.JUNK TEMP.JUNK;
> RUN;
>
> Any other method of changing/modifying data set will reset the "Date
> Created". Even something as simple as:
> DATA PERM.JUNK;
> SET PERM.JUNK;
> RUN;
>
> --or--
>
> PROC SORT DATA=PERM.JUNK;
> BY ID;
> RUN;
>
> will reset the Date Created.
>
> Randy Childs
> Statistical Programmer
> Boston Biostatistics, Inc.
|