Chapter Contents |
Previous |
Next |
Communications Access Methods for SAS/CONNECT and SAS/SHARE Software |
The following script signs on and signs off a Windows NT or a Windows 95 remote host with the TCP/IP access method.
/* trace on; */ /* echo on; */ /*-------------------------------------------------------------------*/ /*-- Copyright (C) 1996 by SAS Institute Inc., Cary NC --*/ /*-- --*/ /*-- name: tcpwin.scr --*/ /*-- --*/ /*-- purpose: SAS/CONNECT SIGNON/SIGNOFF script for connecting --*/ /*-- to either a Windows 95 or a Windows NT host by --*/ /*-- means of the TCP/IP access method. --*/ /*-- --*/ /*-- notes: 1. You must have the spawner program executing on --*/ /*-- the remote Windows 95 or Windows NT workstation --*/ /*-- in order for the local session to be able to --*/ /*-- establish the connection. If the spawner is --*/ /*-- running on the remote node, you will receive a --*/ /*-- message telling you that the connection has --*/ /*-- been refused. --*/ /*-- --*/ /*-- 2. You must have specified OPTIONS COMAMID=TCP --*/ /*-- in the local SAS session before using the SIGNON --*/ /*-- command. --*/ /*-- --*/ /*-- assumes: 1. The command to execute SAS in your remote --*/ /*-- (Windows 95 or Windows NT) environment is "sas". --*/ /*-- If this is incorrect for your site, change the --*/ /*-- contents of the line that contains: --*/ /*-- type 'sas ... --*/ /*-- --*/ /*-- support: SAS Institute staff --*/ /*-- --*/ /*-------------------------------------------------------------------*/ [1] log "NOTE: Script file 'tcpwin.scr' entered."; if not tcp then goto notcp; [2] if signoff then goto signoff; /* --------------- TCP/IP SIGNON ---------------------------------*/ [3] waitfor 'Username:' , 'Hello>' : ready , 'access denied' : nouser , 120 seconds : noprompt ; [4] input 'Userid?'; type LF; [5] waitfor 'Password:' , 120 seconds: nolog; input nodisplay 'Password?'; type LF; [6] waitfor 'Hello>' , 'access denied' : nouser , 120 seconds : timeout ; ready: log 'NOTE: Logged onto Windows... Starting remote SAS now.'; /* NOTERMINAL suppresses prompts from remote SAS session. */ /* NO$SYNTAXCHECK prevents remote side from going into syntax */ /* checking mode when a syntax error is encountered. */ [7] type 'sas -dmr -comamid tcp -device grlink -noterminal -no$syntaxcheck' LF; [8] waitfor 'SESSION ESTABLISHED', 120 seconds : nosas; [9] log 'NOTE: SAS/CONNECT conversation established.'; stop; /*---------------- TCP/IP SIGNOFF -----------------------------------*/ [10] signoff: log 'NOTE: SAS/CONNECT conversation terminated.'; stop; /*--------------- SUBROUTINES -----------------------------------*/ /*--------------- ERROR ROUTINES --------------------------------*/ [11] notcp: log 'ERROR: Incorrect communications access method.'; log 'NOTE: You must set "OPTIONS COMAMID=TCP;" before using this'; log ' script file.'; abort; noprompt: log 'ERROR: Did not receive userid prompt.'; log 'NOTE: Ensure spawner process is running on remote node.'; abort; nolog: log 'ERROR: Did not receive password prompt.'; abort; nouser: log 'ERROR: Unrecognized userid or password.'; abort; nosas: log 'ERROR: Did not get SAS software startup messages.'; abort; timeout: log 'ERROR: Timeout waiting for remote session response.'; abort;
Userid?
to allow the user
to enter a remote host logon userid. The TYPE statement sends a line feed
to the remote host to enter the userid to the remote host.
SESSION ESTABLISHED
is displayed when a SAS session
is started on the remote host with the DMR and COMAMID=TCP options. The WAITFOR
statement awaits the display of the message
SESSION ESTABLISHED
to be issued by
the remote host. If the
SESSION ESTABLISHED
response is received within 120
seconds, processing continues with the next LOG statement. If the
SESSION ESTABLISHED
response
does not occur within 120 seconds, the script assumes that the remote SAS
session has not started and processing branches to the statement labeled NOSAS.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.