Date: Mon, 1 Aug 2005 07:12:22 -0400
Reply-To: Michael Raithel <michaelraithel@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Michael Raithel <michaelraithel@WESTAT.COM>
Subject: Successively reading any new file present in the folder
Content-Type: text/plain; charset="us-ascii"
Dear SAS-L-ers,
Nicks put in a tall order for the following:
> I want to write a macro which:
>
> 1. Successively reads any new file present in the folder.
> This input folder can be C:\temp\sasdata.
>
> 2. The macro should delete the files(these can be csv or sas dataset
> files) which are present in the folder C:\temp\sasdata after
> the use or after the sas dataset is being created out of these files.
>
> 3.Should support some error handling like - If there are any
> errors while creating the sas dataset out of the imported
> (csv.sas files) file the affected files should be copied into
> another folder say C:\temp\error, and also relevant entries
> to the above should be added to the log file.
>
> Any help is highly appreciated. If a sample code/macro is
> readily available it will save a lot of time and efforts.
>
> Thanks in advance.
>
Nicks, you are welcome in arrears! Hey, it sounds as if my SUGI 30
Coder's Corner paper, Automatically Process a Varying Number of New Data
Files From a "Data Directory" will get you more than halfway to where
you want to go. You can check it out on the SAS Institute's SUGI 30 web
page at the following URL:
http://www2.sas.com/proceedings/sugi30/toc.html#cc
When you get there, hop down a screen and check out paper #035-30. I'll
bet that you can cop a lot of the code in the Appendix. It's yours for
the taking... just as long as I don't see it in a Coder's Corner paper
at SUGI 31:-) <<VBG>>
Nicks, best of luck with your effort to read and destroy various
assorted data files using SAS!
I hope that this suggestion proves helpful now, and in the future!
Of course, all of these opinions and insights are my own, and do not
reflect those of my organization or my associates. All SAS code and/or
methodologies specified in this posting are for illustrative purposes
only and no warranty is stated or implied as to their accuracy or
applicability. People deciding to use information in this posting do so
at their own risk.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Michael A. Raithel
"The man who wrote the book on performance"
E-mail: MichaelRaithel@westat.com
Author: Tuning SAS Applications in the MVS Environment
Author: Tuning SAS Applications in the OS/390 and z/OS Environments,
Second Edition
http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=58172
Currently Writing: The Complete Guide to Creating and Using SAS Indexes
(due January 2006)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
When a thing has been said and well, have no scruple. Take
it and copy it. - Anatole France
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++