Download Running SAS Applications on the Web

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

URL redirection wikipedia , lookup

Transcript
HANDS ON WORKSHOPS
Running SAS® Applications on the Web
Prepared by Destiny Corporation
The HOSTS. file under the C:\WINDOWS
subdirectory must list the IP address, along
with the servername, so it can be found
easily by the local browser.
Starting The Web Server
A Web Server is required to execute
SAS/lntrnet software. It must be up and
running for a web browser and SAS to be
able to interact.
HOSTS.
Change
the
C:\WINDOWS to read:
file
under
A Web Server and SAS can run under any
Unix,
supported
platform,
including
Windows NT, etc ...
For the purposes of the following
demonstrations, we will use a Personal
Web Server available through Apache.
(Apache for Windows
1.3.4)
See
www.apache.org for more details.
Loading The Web Server
Configuring A Local Web Server
We load the Web Server with the following
command:
We must determine the Internet Protocol
Configurations available and choose the
appropriate one as our IP address.
The name of the server is drafiee.
To do this, type IPCONFIG IALL > junk at
the command line.
The following message appears.
Edit the junk. file.
Minimize the window.
Determine the IP address to use.
Loading the Application
Dispatcher and Broker
The Application Dispatcher is an integral
part of executing SAS/lntrnet Software. It:
We will use IP address 0.0.0.0
122
•
Is a Gateway that connects Web
browsers with SAS software
•
Allows for executing SAS programs from
a Web browser.
HANDS ON WORKSHOPS
Note: Installation of SAS/lntrnet Software is
required prior to loading it.
To load it, simply double click on the
appropriate Icon:
Its properties are as follows:
Minimize it.
C:\SAS612\sas.exe -config
C:\SAS612\config.sas -dmsbatch initcmd Oaf c=sashelp.web.appstart.scl
port=5001 srvroot=' C: \SAS612\IntrNet' "
-altlog C:\SAS612\IntrNet\appsrv.log splashlocation
C:\SAS612\IntrNet\splash.bmp -awstitle
'SAS/lntrNet AppServer'
Testing the Broker
Now, we can test the broker.exe file.
The following SAS supplied files must live
in the cgi-bin subdirectory of the Web
Server.
•
•
Double clicking produced the following
splash screen:
BROKER.EXE
BROKER.CFG
On this demonstration machine, these files
live in:
C:\Program
Group\Apache\cgi-bin
Files\Apache
Test them with the following commands at
the command prompt:
broker
"_service=default&"program=ping"
The following message should appear.
And the following non-interactive SAS
session.
123
HANDS ON WORKSHOPS
recv ... 0
For more debugging, specify:
Notice the valid URL value.
broker
"_service=default&yrogram=ping&_debug
=2305" > junk.
Testing the Browser
Returns the following in the junk. file.
Load the browser. For this demonstration,
we will use Microsoft Internet Explorer
version 4.
Content-type: text/html
<H2>Symbols passed to SAS</H2>
<PRE>
#symbols: 13
" RMTHOST"
""
" RMTADDR"
""
" RMTUSER"
""
" HTCOOK"
=
""
Specify something similar to the following in
the web address line to PING the system
and the following should be returned.
" HTOA" = If"
" HTREFER"
"-service" = "default"
"-program" = "ping"
"-debug" = "2305"
"-VERSION" = "1.0"
" URL"
''http://drafiee/cgibin/broker.exe"
" ADMIN" = "Dana Rafiee"
" ADMAIL"
"[email protected]"
</PRE>
Using timeout: 60
<BR>
rcv gethostname ... ok
rcv gethostbyname ... ok
rcv socket ... ok
rcv bind ... ok
rcv getsockname ... ok (1041)
rcv listen ... ok
Trying ... drafiee:5001 (1 of 1)
gethost ... ok
socket ... ok (56)
bind ... ok
connect ... ok
write ... ok
shutdown ... ok
accept ... ok
select. .. ok (1)
recv ... 24
select ... ok (1)
recv ... 69
Content-type: text/html
....
To run a sample program supplied with
SAS Software, type:
Hello World!
Sample Programs
<P><B>Ping! </B> The Application Server
is functioning properly.</P>
select ... ok (1)
recv .•. 0
accept ... ok
select. .. ok (1)
recv ... 129
select. .. ok (1)
Several Sample programs come with
SASllntrnet Software. They are typically
located under the sasVntmet subdirectory.
124
•
HANDS ON WORKSHOPS
Server Auto File
Let's open each one and examine the
design. Features displayed here will be
discussed in upcoming modules.
This file is designed to reference locations
for SAS programs. It automatically loads
when the Application Dispatcher loads.
Prepared by:
fllllMd ••• )
000. ".".III"'G ",... leOI8 ..... llebI8 "0.. u.s D)I
oaoz .lIIlat _nlPDIR.CI,tll"'1
.ppllc~.'tl.n
......,... prov.........
OOta
00 ............................ " ••••••••••••••••••••••• "
, , , ..... I'M'IV IIDM,.•• IIMIUeGI at ...........urtup ore
...
0008 . . . . .....,.,. eeMlnl., . . . Ilbra.. I ...
800T I •
.tI.
Destiny Corporation
100 Great Meadow Rd., Suite 601
Wethersfield, CT 06109-2355
Phone: (860) 721-1684 1-800-7TRAINING
Fax: (860) 721-9784
Web: WWW.DESTINYCORP.COM
Email: [email protected]
heft Ilbr.ry.,
.,,111 bll II ",alld libra", "ro" IIhlah 110'" olin ...
DO HOT I_WI IlblHl __ .t ....vlllr."
00•• I. be executed.
.... "8 81ertup to dlnetorl •• Mhleh you do not "'nt .,
"0 cadlll .~BCuted frafl.
• ...
'Oil
"It
0011
to1'1
I.
I . Th_1I allll'"Ylllr .dllllnlatlll"lId Ilbra.. I • • • 111 bill
I • ..to"- In II dllte _t ... that thll1o' clln bll
.... clared .nd re._lened •• nllodod. Thl.
0011 ..8 Ilbra.. I •• ore ..... ptecl bet...." . . . Jobe
".v
0011 "8 th.1 the . ....,.... P:.cut..
.,
."
0'"
*'
....
• ..
OOIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
0011
::~: ~: =-=r""hI~= ~:~hf~.r::1'::h
eoe •
ton
• 'e! lib.........pl.
11'1
qUDte. belOW
·cl~te"1'I1rN.t'-.pl.·
:~
".I;:II••• readanl)l1
It can be tailored to fit your needs. See the
reference to sample. This is why the call for
the SAS program has a three level name.
sample.hello.sas
means
libref.programname.filetype
The following is a listing of the sample
programs that are shipped with SASllntrnet
software.
125