Chapter Contents |
Previous |
Next |
Communications Access Methods for SAS/CONNECT and SAS/SHARE Software |
The following script signs on and signs off an OS/390 remote host with TSO by using the TCP/IP access method.
/*-------------------------------------------------------------------*/ /*-- Copyright (C) 1990 by SAS Institute Inc., Cary NC --*/ /*-- --*/ /*-- name: tcpmvs.scr --*/ /*-- --*/ /*-- purpose: SAS/CONNECT SIGNON/SIGNOFF script for connecting --*/ /*-- to any OS/390 host with the TCP/IP access method --*/ /*-- --*/ /*-- notes: 1. This script may need modifications that account --*/ /*-- for the local flavor of your OS/390 environment. --*/ /*-- The logon procedure should mimic the events that --*/ /*-- you go through when "telnet"-ing to the same --*/ /*-- OS/390 host, either to TSO or to the OS/390 --*/ /*-- spawner. --*/ /*-- --*/ /*-- 2. You must have specified OPTIONS COMAMID=TCP --*/ /*-- in the local SAS session before using the SIGNON --*/ /*-- command. --*/ /*-- --*/ /*-- 3. This script supports two flavors of connection: --*/ /*-- through a TSO session whose logon procedure --*/ /*-- invokes SAS directly rather than the TSO TMP, or --*/ /*-- through the OS/390 spawner. --*/ /*-- --*/ /*-- 4. If you use TSO to start the SAS session, in the --*/ /*-- signoff portion of the script, uncomment the --*/ /*-- LOGOFF command to complete session termination. --*/ /*-- --*/ /*-- 5. If you use the OS/390 spawner to start the SAS --*/ /*-- session, and the client session is running a --*/ /*-- release prior to 6.09E or 6.11 TS040, uncomment --*/ /*-- the 'type CR LF;' statements after the prompts. --*/ /*-- --*/ /*-- support: SAS Institute staff --*/ /*-- --*/ /*-------------------------------------------------------------------*/ [1] log "NOTE: Script file 'tcpmvs.scr' entered."; [2] if not tcp then goto notcp; if signoff then goto signoff; /* ------------------------- TCP/IP SIGNON --------------------------*/ /* make sure we are running the IBM TCP/IP or the OS/390 spawner */ [3] waitfor 'Userid: ' : spnlogon, 'ENTER USERID' : tsologon, 120 seconds : noinit; /*------------------------- SPAWNER LOGON ---------------------------*/ spnlogon: [4] input 'Userid?'; /* type CR LF; */ [5] waitfor 'Password', 120 seconds : spnfail; input nodisplay 'Password?'; /* type CR LF; */ spndone: [6] waitfor 'Options', 'Userid' : spnlogon, 'Password expired' : spnnewp, 120 seconds : spnfail; [7] type "DMR NOTERMINAL NO$SYNTAXCHECK COMAMID=TCP"; /* type CR LF; */ [8] waitfor 'SESSION ESTABLISHED', 120 seconds : spnfail; [9] log 'NOTE: SAS/CONNECT conversation established.'; stop; spnnewp: [10] input nodisplay 'New Password?'; /* type CR LF; */ waitfor 'Verify new password', 120 seconds : spnfail; input nodisplay 'Verify New Password'; /* type CR LF; */ goto spndone; spnfail: log 'ERROR: Invalid SPAWNER prompt message received.'; abort; /*--------------------------- TSO LOGON -----------------------------*/ tsologon: [11] input 'Userid?'; type LF; [12] waitfor 'ENTER PASSWORD', 120 seconds : nolog; tsopass: input nodisplay 'Password?'; type LF; tsodone: [13] waitfor 'SESSION ESTABLISHED', 'PASSWORD INVALID' : tsopass, 'ENTER NEW PASSWORD' : tsonewp, 'CURRENTLY LOGGED ON' : dup_log, 'NOT VALID' : nouser, 120 seconds : notso; waitfor 1 second; [14] log 'NOTE: SAS/CONNECT conversation established.'; stop; tsonewp: [15] input nodisplay 'New Password?'; type LF; waitfor 'VERIFY NEW PASSWORD', 120 seconds : notso; input nodisplay 'Verify New Password'; type LF; goto tsodone; /*---------------------------- SIGNOFF ------------------------------*/ [16] signoff: /* ------------ for TSO, uncomment the following section ------------*/ type 'logoff' LF; waitfor 'LOGGED OFF' : logoff, 20 seconds; log 'WARNING: Did not get messages confirming logoff.'; abort; logoff: /* ------------ for TSO, uncomment the previous section ------------ */ log 'NOTE: SAS/CONNECT conversation terminated.'; stop; /* ----------------------- TSO ERROR ROUTINES ------------------------*/ [17] nouser: log 'ERROR: Unrecognized userid.'; abort; nopass: log 'ERROR: Invalid password.'; abort; notcp: log 'ERROR: Incorrect communications access method.'; log 'NOTE: You must set "OPTIONS COMAMID=TCP;" before using this'; log ' script file.'; abort; noinit: log 'ERROR: Did not understand remote session banner.'; abort; nolog: log 'ERROR: Did not get userid or password prompt.'; abort; notso: log 'ERROR: Did not get TSO startup messages after logon.'; abort; dup_log: log 'ERROR: User is already logged onto TSO.'; 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 NOSTRT.
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 NOSTRT.
LOGOFF
,
which logs the user off the remote host. Before it stops the link, the script
issues a LOG statement to notify the user that the link is terminated.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.