I want to %include
all SAS-programms located in a folder. My code works, this is what I got:
filename x '/mydir/*.sas';
%include x/source2;
Additionally, I need the files to be executed in alphabetical order, e.g.
01_setup_libraries.sas
02_transfer_data.sas
03_create_tables.sas
My tests indicate that this is how filename
behaves in that context and that I can just use the code above - however, I am unable to find confirmation if this is actually how filename
works.
Is there any documentation on this, or is there an alternative with comparingly little amount of code? (My best guess was to output the files to a dataset, sort the dataset, then execute record by record).
Question has been answered in Tom's comment under initial post:
"It will read the files in alphabetical order on Linux, but filenames are case sensitive. So uppercase letters sort before lowercase letters. On Windows it reads them in alphabetical order based on the uppercase version of the filename. Since window file names are not case sensitive then it is essentially also alphabetical." - Tom