Hi.
I use the X command in a SAS program to run a DOS program. The program ends its run with a "Press any key to continue", i.e. the program window does not close with the SAS program options noxwait xsync.
Is there a way for SAS to recognize when the DOS program reached "Press any key to continue" and then quit the window?
.
Hi,
Suggest you try system option NOXWAIT.
HTH,
--Q.
Hi.
The program in the DOS window is running and need to be closed upon showing "Press any key to continue" in the DOS window.
Hi,
Try with SYSTASK COMMAND and you can also use option NOXWAIT.
Well this is a little kludgy, but, assuming your program doesn't expect any input from you during execution, you could just pipe it a keystroke right from the X command. E.g., I wrote a batch program (Test.bat) that just echos text to the console and waits for a keystroke.
echo This is a test
pause
Then, the following SAS program runs the batch program but gives it a keystroke when it asks for one (in this case a 'y', but it could be anything).
options noxwait;
x echo y | test.bat;
When run, it echos the text, reads the 'y' from the echo command, terminates and closes the dos window. Obviously, you'd replace "test.bat" with your program name.
HTH
Karl
This was very helpful.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.