f



Re: SAS Macro to delete a SAS dataset 351242

Montura wrote:

> class delete;
>     runInterface: method;
>         delete(symget('sasDatasetName'));
>     endmethod;
> endclass;
>
>
> Works fine if you use plain SCL.
> you could also embed a Proc Datasets
>
> class delete;
>     runInterface: method;
>         submit continue;
>         proc datasets lib=work kill nolist memtype=DATSA;
>
>         quit;
>         endsubmit;
>     endmethod;
> endclass;
>
>
> Either way, Macro is harder to read, write and understand.

Except that I've never had a need to use SCL, whereas I use macros all
the time.  Macros are easy for me to read, write and understand; SCL
might as well be another language.  It rather looks like it is.  Might
be fun to learn it even if I don't need it.
0
dkw0
12/2/2009 9:27:58 PM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

1 Replies
1024 Views

Similar Articles

[PageSpeed] 39

Object code is easy.
It takes about 5 minutes to learn what you need to mentally "ignore",
like the class and method statements. Interesting that you say it
looks like another langugage - a large portion of The SAS System is
written in SCL.

I'll be posting SCL programming chapters on www.keystonesug.com.
Statisticians who are stuck in the past might find structured
programming techniques a little hard to pick up, after all, some
people are messy in their work habits as a general rule. Clean code is
just too much trauma.  :o)

0
montura
12/4/2009 2:55:09 PM
Reply:

Similar Artilces:

Re: SAS Macro to delete a SAS dataset 131840
well, this one reminds me another thread recently discussed: http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0911c&L=sas-l&F=&S=&P=4034 On Wed, 2 Dec 2009 08:50:34 -0800, SAS Techies <sastechiesblog@GMAIL.COM> wrote: >Here?s a simple SAS Macro to delete a SAS dataset?It takes the name of >the SAS dataset as the parameter? > >%macro deletedsn(dsname); > >%if %index(&dsname,'.') eq 0 %then %do; %let lib=work; %let >dsn=&dsname; %end; >%else %if %index(&dsname,'.') eq 0 %then %do; %let lib=%scan(&dsnam...

Re: SAS Macro to delete a SAS dataset 196997
> From: SAS Techies > Subject: SAS Macro to delete a SAS dataset > > Here's a simple SAS Macro to delete a SAS dataset...It takes the name of > the SAS dataset as the parameter... > > %macro deletedsn(dsname); > > %if %index(&dsname,'.') eq 0 %then %do; %let lib=work; %let > dsn=&dsname; %end; > %else %if %index(&dsname,'.') eq 0 %then %do; %let lib=%scan(&dsname, > 1,'.'); %let dsn=%scan(&dsname,1,'.'); %end; > > proc datasets lib=&lib nolist; > delete &dsn; > qui...

Re: SAS Macro to delete a SAS dataset #2 131884
Proc delete cannot delete views (I just tried). Of the macros suggested, I prefer the SQL version. The original version does not work if the USER option is set to something other than WORK. Regards, Søren On Thu, 3 Dec 2009 08:41:55 -0600, Data _null_; <iebupdte@GMAIL.COM> wrote: >I too like(d) PROC DELETE. > >When I used it I was forced to remove it and use PROC DATASETS because >PROC DELETE is not documented. > >Also, but I have not tested it. How does it work with indexed data >sets, audit trails, generation data groups, views, etc.? ...

Re: SAS Macro to delete a SAS dataset #2 313487
I too like(d) PROC DELETE. When I used it I was forced to remove it and use PROC DATASETS because PROC DELETE is not documented. Also, but I have not tested it. How does it work with indexed data sets, audit trails, generation data groups, views, etc.? I don't worry much about deleting, "all" of my programs run in batch and are obsolete as soon as they are written. On 12/3/09, Fehd, Ronald J. (CDC/CCHIS/NCPHI) <rjf2@cdc.gov> wrote: > > From: SAS Techies > > Subject: SAS Macro to delete a SAS dataset > > > > Here's a simple SAS...

SAS Macro to delete a SAS dataset
Here=92s a simple SAS Macro to delete a SAS dataset=85It takes the name of the SAS dataset as the parameter=85 %macro deletedsn(dsname); %if %index(&dsname,'.') eq 0 %then %do; %let lib=3Dwork; %let dsn=3D&dsname; %end; %else %if %index(&dsname,'.') eq 0 %then %do; %let lib=3D%scan(&dsname, 1,'.'); %let dsn=3D%scan(&dsname,1,'.'); %end; proc datasets lib=3D&lib nolist; delete &dsn; quit; %mend deletedsn; %deletedsn(new); %deletedsn(somelib.new); Read more @ http://sastechies.blogspot.com/2009/12/sas-macro...

Re: Deleting SAS Data from a SAS DATASET
One thing you might do is to add an index on the snap_dt to the dataset; = if that's there then you should be able to delete the records in place: proc sql; delete from prod.master_date; where snap_dt =3D "&end_dt"d; quit; run; In both the ways you are trying now you are creating new data sets = rather than deleting records from the current data set; it would seem to = me that a SQL delete statement would be faster than creating new = datasets even if there isn't an index on the date.=20 -Mary ----- Original Message -----=20 From: SUBSCRIBE SAS-L Chandra Gadd...

sas macro call sas macro call sas macro
Hi, here is my test data set: DATA one ; INFILE cards ; INPUT a b1 b2 b3 b4; subjid+1 ; CARDS ; 1 3 4 7 7 1 6 5 8 8 1 3 4 7 9 1 3 3 6 8 2 1 2 5 10 2 2 3 6 10 2 2 4 5 9 2 2 3 6 11 ; RUN ; then I tried this code: %macro pnt(data); proc print data=&data.; run; %mend pnt; %macro loopSubset(data, subbasedon, funcmacro); proc sort data=&data. nodupkey out=sublist(keep=&subbasedon.); by &subbasedon.; run; PROC Sql; select count(*) as cnt into : totlist from sublist quit; run; ***** loop all subsets *****; %do n=1 %to &totlist.; d...

Re: Deleting SAS Data from a SAS DATASET #7
A view helps on deletes, but I wonder how it affects performance of = querying the data- wouldn't storing the data in 24 different locations = cause a significant slowdown in perfomance upon querying the data versus = having it all in one table that is indexed? If this data is queryied a = lot but only deleted once a month, the time in querying (which probably = is in peak time) could be much more important than the time in deleting = (which could be run when the computer is not busy, such as nights or = weekends). =20 -Mary ----- Original Message -----=20 From: ./ ADD NAME=3DData _n...

Re: Deleting SAS Data from a SAS DATASET #11
And what about the time of the database administrator who now needs to = keep track of 24 indexes to each index in the previous table? I just = can't see our DB2 administrators would have ever thought to organize the = data this way, though we had many very large tables, like the user had, = that were purged by month; it does seem like it would be a lot of = "people work" to manage 24 tables plus one index instead of just one = table, even if querying didn't suffer(and I do think that it could).=20 -Mary ----- Original Message -----=20 From: Chang Chung=20 To: SAS-L@L...

Re: Deleting SAS Data from a SAS DATASET #8
On 8/15/08, Mary <mlhoward@avalon.net> wrote: > A view helps on deletes, but I wonder how it affects performance of querying the data- wouldn't storing the data in 24 different locations cause a significant slowdown in perfomance upon querying the data versus having it all in one table that is indexed? If this data is queryied a lot but only deleted once a month, the time in querying (which probably is in peak time) could be much more important than the time in deleting (which could be run when the computer is not busy, such as nights or weekends). It is not the VIEW that has an...

Re: Deleting SAS Data from a SAS DATASET #4
Summary: PROC DATASETS; AGE statement. + VIEWs This won't help you delete data from your very big data set, but you may find this example interesting. You say you append data monthly to a big data set then when big gets too big you need to clean out the old. And that takes a very long time. However if you don't physically append but use a view to append/combine you may find it easier to get rid of the unwanted old data. Consider this code. it pushes MonthlyUpdate onto the stack of 24 data sets and the 24th data set is deleted. Then all the data sets get renamed to produce a new g...

Re: Deleting SAS Data from a SAS DATASET #10
On Fri, 15 Aug 2008 17:20:13 -0500, Mary <mlhoward@AVALON.NET> wrote: >And what about the time of the database administrator who now needs to keep track of 24 indexes to each index in the previous table? I just can't see our DB2 administrators would have ever thought to organize the data this way, though we had many very large tables, like the user had, that were purged by month; it does seem like it would be a lot of "people work" to manage 24 tables plus one index instead of just one table, even if querying didn't suffer(and I do think that it could). .... hi, Th...

Re: Deleting SAS Data from a SAS DATASET #2
Chandra - this isn't my expertise area - I'm sure others may have better ideas but I'll make three comments. If your datasets have a large number of variables, in your datastep method a WHERE clause will be more efficient - the IF statement causes each record to be fully read before it can be selected for deletion. A WHERE clause would only read the single variable in the case of records that meet the criteria for deletion. Data prod.Master_date; set prod.master_date; where snap_dt ne "&end_dt"d; run; You probably would be better off changing your data model t...

Re: Deleting SAS Data from a SAS DATASET #6
I have been watching this thread today and I just now recall an example that Paul Dorfman gave at a RUG several years ago and no, I don't recall exactly where or when other than it was NESUG or SESUG in the past 5 years. Anyway, Paul had a client who was storing something like the past 12 months of transactions as variables andat the start of each month needed to stick the just ended month on the end and drop the oldest month. Paul used Peek to read the last 11 months of each obs as a single chunk of data, append the current's month, and then used Poke to write the whole new obs as a ...

Web resources about - Re: SAS Macro to delete a SAS dataset 351242 - comp.soft-sys.sas

UAH satellite temperature dataset - Wikipedia, the free encyclopedia
The UAH satellite temperature dataset , developed at the University of Alabama in Huntsville , attempts to infer the temperature of the atmosphere ...

Data : Where can I get large datasets open to the public?
Answer (1 of 91): Here's the ones I've found most useful: CrunchBase, US Census, Google Public Data, Infochimps, Timetric, Factual, Freebase, ...

YouTube - Hans Rosling: Let my dataset change your mindset
Hochgeladen am 31.08.2009 http://www.ted.com Talking at the US State Department this summer, Hans Rosling uses his fascinating data-bubble software ...

The Mindset, Skillset, Dataset Approach to Social Media
... Social media is comprised primarily of unstructured data, which is difficult to analyze. A new approach called Mindset, Skillset, Dataset can ...

Sending large datasets to Amazon? Use the Post Office
Amazon has introduced a new method to move large amounts of data to and from …

Yahoo Releases the Largest-ever Machine Learning Dataset for Researchers
Yahoo is announcing the public release of the largest-ever machine learning dataset to the research community.

IDG Contributor Network: Are datasets truly anonymized? Two well-suited researchers are going to find ...
With little fanfare or formality, Adam Smith , associate professor of computer science and engineering in Penn State's School of Electrical Engineering ...

House GOP looks to shed light on EPA secret datasets
House Republicans have introduced a bill that would block the Environmental Protection Agency from crafting regulations based on “secret” scientific ...

Google Making It Easier to Transfer Huge Datasets on the Cloud
... Cloud Import services are now in preview mode, but could later be available on a widespread basis to help enterprises move their large datasets ...

Environmental datasets, reverse auction legislation and military email
News and notes from around the federal IT community. The White House's Data.gov has added five datasets to the Ecosystem Vulnerability theme ...

Resources last updated: 2/12/2016 5:56:00 PM