Chapter Contents |
Previous |
Next |
Communications Access Methods for SAS/CONNECT and SAS/SHARE Software |
The following script signs on and signs off a CMS remote host with the EHLLAPI access method.
/* trace on; */ /* echo on; */ /*--------------------------------------------------------------------- Copyright (C) 1996 by SAS Institute Inc., Cary NC name: logcms.scr purpose: SAS/CONNECT SIGNON/SIGNOFF script for automatically connecting to a CMS host using the EHLLAPI access method from a local WINDOWS or an OS/2 operating system. notes: 1. This script may need modifications that account for the local flavor of your VM/CMS environment. The SIGNON sequence should mimic the events that you go through when logging on to the same VM/CMS host. assumes: 1. The command to execute SAS in your remote (CMS) 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 'logcms.scr' entered."; [2] if signoff then goto signoff; /*----- EHLLAPI SIGNON ----------------------------------------------*/ [3] waitfor 'SAS Institute Inc.', 0 seconds: noinit; type 'vm ' enter; [4] waitfor 'USERID' , 20 seconds: nolog; input 'Enter userid: '; type enter; [5] waitfor 'ENTER PASSWORD', 'Enter logon password', 'SESSION NOT BOUND' : novtam, 'NOT IN CP DIR' : nouser, 20 seconds : nolog; input nodisplay 'Enter password: '; type enter; [6] waitrdy: waitfor 'R;', 'Ready;', 'READY', 'INCORRECT PASSWORD' : nopass, 'RECONNECT' : recon32, 'UNSUCCESSFUL' : nostrt, 'MORE...' : more, 30 seconds : nostrt; ready32: type clear; waitfor 'VM READ', 'RUNNING', 20 seconds: timeout; log 'NOTE: Logged on to CMS ... 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=pclink noterminal no$syntaxcheck)' enter; goto continue; continue: [8] waitfor 'IN PROGRESS', 60 seconds: nosas; [9] log 'NOTE: SAS/CONNECT conversation established.'; stop; /*----- EHLLAPI SIGNOFF ---------------------------------------------*/ signoff: [10] type 'logoff' enter; waitfor 'Press enter key', 10 seconds: noterm; type enter; waitfor 'SAS Institute Inc.' , 10 seconds: noterm; type tab; type tab; type 'vmexit' enter; waitfor 'SAS Institute Inc.', 10 seconds: noterm; [11] log 'NOTE: SAS/CONNECT conversation terminated.'; stop; /*----- SUBROUTINES -------------------------------------------------*/ [12] recon: type 'begin' enter; waitfor 'RUNNING', 'VM READ', 20 seconds: timeout; type 'hx' enter; goto ready32; more: snapshot; type clear; goto waitrdy; /*----- ERROR HANDLING ----------------------------------------------*/ [13] noinit: snapshot; log 'ERROR: No data center network screen.'; abort; novtam: snapshot; log 'ERROR: VTAM session not bound - contact VTAM support.'; abort; nolog: snapshot; log 'ERROR: Did not get userid or password prompt.'; abort; nouser: log 'ERROR: Unrecognized userid.'; goto kill; nopass: log 'ERROR: Invalid password.'; goto kill; nostrt: snapshot; log 'ERROR: Did not get CMS startup messages after logon.'; goto kill; nosas: snapshot; log 'ERROR: Did not get SAS software startup messages.'; goto kill; noterm: snapshot; log 'WARNING: Did not get messages confirming logoff.'; goto kill; timeout: log 'ERROR: Timeout waiting for remote session response.'; kill: snapshot; type '#cp logoff' enter; abort;
Enter userid:
to allow the user to
enter a remote host logon userid. The TYPE statement sends an ENTER to the
remote host to enter the userid to the remote host.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.