|
Hi Ben,
As I already indicated I do not know oracle and how to start it via the command line. You'll have to find out that yourself, possibly from the documentation. But alternatively you could look into the PIF file starting Oracle server, its shortcut, being started through Ctl+Alt+o as well, to see which program actually is started, what the additional command line arguments are and what optional batch file is run. Copy those to a batch file of your making and start it from the DOS window, possibly including the Windows START command. If that works you should be able to start it from SAS.
This means search for the elementary commands and forget about the Ctl+Alt+o feature from Windows; don't try to involve that keystroke in the automated process.
Good luck - Jim.
Y. (Jim) Groeneveld MSc
Biostatistician
Vitatron B.V.
Meander 1051
6825 MJ Arnhem
The Netherlands
+31/0 26 376 7365; fax 7305
Jim.Groeneveld@Vitatron.com
www.vitatron.com
-----Original Message-----
From: Ben Powell [mailto:Ben.powell@cla.co.uk]
Sent: Thursday, September 11, 2003 15:28
To: Groeneveld, Jim; SAS-L@LISTSERV.UGA.EDU
Subject: RE: Can SAS pass keystrokes to Windows?
Thanks Jim, I suppose you can guess my next question: how! I've set up
oracle to boot from windows through the shortcut ctrl+alt+o, which
always works irrespective of what the active window is. Oracle then
becomes the active window and can accept keystrokes as below. What is
the batch file syntax so that I could test this? I guess there may be a
problem, once oracle become the active window, perhaps there would be a
problem for the batch file to pass any more keystrokes..? As for
programming this sort of thing myself, I've had a go with VBScript
before, which could work through perhaps through WSH, but don't know
about basic or C. AutoIT would do it I think, but I was wondering if
there is another way through SAS (other than executing AutoIT) similar
to the way I got the ftp script and batch files to work (listed below)
as I thought that was rather neat.
//save as ftp_do.bat
ftp -s:P:\SAS\PROJECTS\Ftp\ftp_do.ftp sun01
//end of ftp_do.bat
//save as ftp_do.ftp
username
password
bin
hash
asc
prompt
cd "/u02/car/survey"
lcd "c:\survey3"
mput sasupdate.csv
pause
quit
//end of ftp_do.ftp
And in SAS use the code:
options noxwait;
x 'P:\SAS\PROJECTS\Ftp\ftp_do.bat';
The reverse files ftp_undo.bat/ftp are straightforward with mget instead
of mput.
Any help appreciated!
-----Original Message-----
From: Groeneveld, Jim [mailto:jim.groeneveld@vitatron.com]
Sent: 11 September 2003 13:58
To: Ben Powell; SAS-L@LISTSERV.UGA.EDU
Subject: RE: Can SAS pass keystrokes to Windows?
Hi Ben,
IF !!! it is possible to start the Oracle server from the (DOS) command
line, using command line parameters of a command file (so including a
password) (possibly via standard input) as well, it certainly would be
possible to create a batch file doing that, even with variable
arguments. That batch file could be directly started from SAS (X, CALL
SYSTEM or %SYSEXEC) without the use of an intermediate program, such as
AutoIT.
If it is not possible to start the Oracle server that way, SAS always
can (create and) start a batch file to run something, which in this case
might be a script, started from AutoIT. But I don't know AutoIT (yet), I
only read some characteristics and it seems to be possible to start it
from batch as well, especialy some compiled EXE program. I do have some
previous experience in writing software reading and filling the (15
byte) keyboard buffer from DOS (both with BASIC and with C), simulating
keystrokes (and reading the screen with ANSI.SYS support loaded and thus
reacting conditionally to what was written on the screen, just like a
human).
So the answer to your Q, whether SAS would be able to pass keystrokes to
Windows, if interpreted as to the keyboard buffer, is Yes. And I think,
what you would want, very likely is possible with some programming, but,
as said, I don't know AutoIT, nor Oracle server.
Regards - Jim.
Y. (Jim) Groeneveld MSc
Biostatistician
Vitatron B.V.
Meander 1051
6825 MJ Arnhem
The Netherlands
+31/0 26 376 7365; fax 7305
Jim.Groeneveld@Vitatron.com
www.vitatron.com
-----Original Message-----
From: Ben Powell [mailto:ben.powell@CLA.CO.UK]
Sent: Thursday, September 11, 2003 14:04
To: SAS-L@LISTSERV.UGA.EDU
Subject: Can SAS pass keystrokes to Windows?
I've finally got the X command to run some ftp scripts that import and
export data to our sun server where oracle can pick up the file and
validate it. I wonder if there is a means for SAS to run a sequence of
keystrokes as a batch file (?) again through X or whether this requires
a nonwindows (XP Pro) app such as AutoIT
http://www.hiddensoft.com/AutoIt/ that could be executed by SAS?
Its lazy I know but since I've got the ftp automated its pretty boring
manually booting the oracle client to run the validation by hand.
The sequence is:
ctrl+alt+o
username
tab
password
enter
down arrow
enter
enter
tab
F9
down arrow
down arrow
enter
sasupdate.csv
enter
alt+b
alt+a
w
alt+h
v
Any suggestions appreciated.
|