You could have captured the filenames when you were creating the CSV files
and dump the list in a SAS dataset.
Here is a completely brainless solution. Open a command prompt, cd to the
correct directory, then issue the command DIR *.csv /w >> list.txt. The
file list.txt now contains the list of CSV files and it doesn't even matter
if it the filenames follow any pattern. You could read in file into a SAS
datset and use SAS macro to create a list of filenames.
The morale of the story is that SAS isn't the only tool at your disposal.
Yes, you could do this all in SAS but you'd actually have to read the
"Neerav Monga" <firstname.lastname@example.org> wrote in message
> Hi everyone,
> I have about 50 files that are in csv format labelled file1.csv ,
> file2.csv etc... (however it does skip numbers, eg.. 1-5, then 20-25,
> they aren't necessarily consecutive numbers). I saved all of them in
> one folder in windows xp using SAS 9.1.3.
> I know i can put the proc import/export into a macro and feed the macro
> the input filename and export file name, however, is there a way to
> automate this somehow? It would save me a lot of time.
> I know the non consecutive numbers might be an issue, but they have to
> stay as labelled. After the file is imported, I need to remove the
> first four characters in a field in the file (which I can easily do
> with the substring command), drop the old field with extra characters
> and then export it.
> Perhaps there's a way to import / export an entire folder/library at
> once? That might be the easiest way to go?
> Any help would be appreciated,