Chapter Contents

Previous

Next
Communications Access Methods for SAS/CONNECT and SAS/SHARE Software

TSO.SCR Script

The following script signs on and signs off an OS/390 remote host with the EHLLAPI 3270 access method. This script assumes that the user has already logged on to an OS/390 remote host.

/* trace on; */
/* echo on;  */
/*---------------------------------------------------------------------
   Copyright (C) 1996 by SAS Institute Inc., Cary NC
   name:      tso.scr
   purpose:   SAS/CONNECT SIGNON/SIGNOFF script for connecting to an
              OS/390 (with TSO) host using the EHLLAPI access method 
              from a local WINDOWS or an OS/2 operating  system.
   assumes:   1. This script assumes the remote session is already
                 logged on.
              2. The command to execute SAS in your remote OS/390 (with TSO)
                 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 'tso.scr' entered.";

[2]   if signoff then goto signoff;

/*---- EHLLAPI SIGNON -----------------------------------------------*/

[3]
    waitfor 'READY', 0 seconds: noinit;
    log 'NOTE: 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.          */
    type "sas options('dmr,comamid=pclink,noterminal,no$syntaxcheck')" enter;
    goto continue;
[4] continue:
    waitfor 'IN PROGRESS', 20 seconds: waitsas;

[5] onok:
    log 'NOTE: SAS/CONNECT conversation established.';
    stop;

/*---- EHLLAPI SIGNOFF ----------------------------------------------*/

[6] signoff:
    log 'NOTE: SAS/CONNECT conversation terminated.';
    log 'NOTE: Remote session left logged on.';
    stop;

/*----- SUBROUTINES -------------------------------------------------*/

[7] waitsas:
    log 'NOTE: Waiting for startup screen...';
    type EREOF enter;
    goto continue;

/*----- ERROR HANDLING ----------------------------------------------*/

[8] noinit:
    snapshot;
    log 'ERROR: Did not get remote prompt.  Remote session not active.';
    log 'NOTE: You must log on to the remote session before signing on';
    log '      using this script file.';
    abort;
  1. LOG statements write messages to the local host SAS log that provide information about the progress of the sign on.

  2. If the SIGNOFF statement invokes this script, processing jumps to the SIGNOFF label. See step 6 in this list.

  3. The WAITFOR statement looks for the READY prompt from the remote host and processing goes to step 8 if no prompt is received. When the READY prompt is received, the note is written to the local host's log, and the TYPE statement invokes SAS on the remote host. The DMR option is necessary to invoke a special processing mode for SAS/CONNECT. The COMAMID= option specifies the access method that is used to establish the connection.

  4. The WAITFOR statement looks for the message IN PROGRESS, which is displayed when a SAS session starts on the remote host. If the message is not found, processing goes to the WAITSAS label in step 7.

  5. This LOG statement prints a message to the log to indicate that you have successfully established a link.

  6. These statements are executed when step 2 directs processing here. The two notes are written to the local log, and the link is terminated.

  7. Processing continues from step 4. The note is written to the local log, and processing returns to step 4.

  8. Processing continues from step 3 if the READY prompt is not received. The SNAPSHOT statement captures messages that are displayed on the remote host and writes them to the local host's log. The log messages can help you determine the reasons why the sign on to the remote host was interrupted. You can save or print the local log to have a record of these messages. The error and note messages are written to the local log, and the script aborts.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.