|
oseithedude@gmail.com wrote:
> Hello, I have 9 SAS programs, all within the same Windows folder that
> I usually run at the same time - one right after the other. For
> convenience, is it possible to write a simple SAS program that will
> let me run all the programs at once or to have a program that will
> allow me to pick and choose which SAS programs I want to run (e.g.,
> in the case I only want to run the first 3 and last program out of
> the 9 SAS programs) and which order the programs are run in? I guess
> what I'm really looking for is if there is a way to call another SAS
> program using only a couple lines of code so that, if I choose not
> run that program, I can just comment that code out or something like
> that. Let me know if this is possible, thanks!!!
>
> Julie
This is an excellent scenario for a SAS/AF frame.
Supposing you don't have AF:
The File/Open dialog has a Submit checkbox. When checked and you select
_more than one_ file in the file dialog, each file will be submitted in
sequence. The only caveat is that the order submitted is reverse of as show
in the file dialog Filename field. E.g.
"a.sas" "b.sas" "c.sas" will cause the submittal of C then B then A.
The same sort of issue occurs when multiple files are selected in straight
up Windows Explorer (which the File.Open dialog utilizes). Basically, a
Windows LIFO stack of file selections is causing the reversal.
An alternative would be to write a program that writes a program that
contains only include statements based on a directory listing.
generate this code from input of filename listing PIPE "DIR /B *.sas"
/** / %include "A.sas"; /**/
/** / %include "B.sas"; /**/
/** / %include "C.sas"; /**/
Note the space in the leading 'almost' comment block. Since there is a
space, the comment extends to the trailing comment block which closes the
leading 'almost'.
To run a select series of programs, simply remove the space from the leading
almost comment block from which ever programs you want to run.
Run A and C.
/**/ %include "A.sas"; /**/
/** / %include "B.sas"; /**/
/**/ %include "C.sas"; /**/
IIRC, this style of commenting, for easy on/off of code blocks, was made
popular by Ron Fehd.
--
Richard A. DeVenezia
http://www.devenezia.com/
|