Here's the background. I'm sorry it's so long:
I do SAS programming for 3 different projects. Each project has its own main project folder. Each main project folder contains a formats folder (which contains the format catalog), and then several other folders, each of which contains programs and datasets. I do most of my work in batch mode, so SAS is usually not open. Occasionally, though, I want to open a dataset in SAS to look at something in particular. When I do this, SAS does not know where to look for the appropriate format catalog, because the format catalogs are never in the same folder as the datasets. So I currently use an autoexec.sas file that specifies the nofmterr
option, so that my datasets will open.
I would really like, though, to be able to open my datasets with the appropriate formatting. I wrote a different autoexec program that uses a dialog window that asks me which project I am working on and then sets the fmtsearch
option accordingly. This works great if I want to first open SAS, and then open a dataset. But if SAS is not already up and running, and I try to open a dataset by double-clicking on it, here's what happens: the autoexec file starts running, then SAS tries to open the dataset before the autoexec file has finished running. So if I have nofmterr
set, the dataset will open without formats, or if I don't have nofmterr
set, the dataset won't open at all.
So here's my question: Is there a way to get SAS to wait until the autoexec file finishes running before it tries to open the dataset? Or, is there another way around the problem? (I don't want to add all 3 format files to the fmtsearch
option, because different projects might have different formats with the same name.)