BookmarkSubscribeRSS Feed
blackraven
Fluorite | Level 6

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?

.

5 REPLIES 5
Quentin
Super User

Hi,

Suggest you try system option NOXWAIT.

HTH,

--Q.

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
blackraven
Fluorite | Level 6

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.

suraestar
Calcite | Level 5

Hi,

Try with SYSTASK COMMAND and you can also use option NOXWAIT.

KarlK
Fluorite | Level 6

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

blackraven
Fluorite | Level 6

This was very helpful.

sas-innovate-2024.png

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.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 965 views
  • 0 likes
  • 4 in conversation