home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxhll.zip / HOSTTSO.REX < prev    next >
OS/2 REXX Batch file  |  1993-11-19  |  2KB  |  86 lines

  1.  
  2. /* #include <HostTSO.rex> */
  3.  
  4. HostTSOLogon: procedure expose Host.
  5.    /**
  6.    ***  This will log the use on to the host.
  7.    **/
  8.  
  9.    call HostLogonClMenu
  10.  
  11.    if Host.Logmode = '' then
  12.       Logmode = ''
  13.    else
  14.       Logmode = 'M('Host.Logmode')'
  15.  
  16.    rc = hllapi('Sendkey', '/L' Host.Applid Host.Userid Logmode'@E')
  17.    rc = hllapi('Wait')
  18.  
  19.    do while Host.Password = ''
  20.       say 'Enter the password for' Host.Applid '['Host.Application']'
  21.       Host.Password = GetNoEcho()
  22.    end
  23.  
  24.    say "Logging on."
  25.  
  26.    /* Respond to the password prompts */
  27.  
  28.    select
  29.       when Host.Security = 'ACF2' then
  30.          call HostACF2Logon
  31.       when Host.Security = 'RACF' then
  32.          call HostRACFLogon
  33.       otherwise
  34.          call HostError 1004
  35.    end /* select */
  36.  
  37.    /* At this point, we should be logged on to TSO and we should have */
  38.    /* received the TSO signon and operator messages.                  */
  39.  
  40.    /* Keep pressing enter past the signon message until we get to the */
  41.    /* ISPF main menu.                                                 */
  42.  
  43.    ISPF = 0
  44.    do until ISPF = 1
  45.       code = hllapi('Sendkey', '@E')
  46.       code = hllapi('Wait')
  47.  
  48.       /* There is no string to wait for and the keyboard is unlocked, so we */
  49.       /* have to just slow the loop.                                        */
  50.  
  51.       call SysSleep 2
  52.       call HostScreenToStem
  53.       if pos('PRIMARY OPTION', Screen.1) > 0 then
  54.          ISPF = 1
  55.    end /* do until */
  56.    return
  57.  
  58.  
  59. HostACF2Logon: procedure expose Host.
  60.    /**
  61.    ***  This will respond to the ACF/2 password prompts
  62.    **/
  63.    code = HostWaitFor(20, 'PASSWORD')
  64.    rc = hllapi('Sendkey', Host.Password"@E")
  65.    return
  66.  
  67.  
  68. HostRACFLogon: procedure expose Host.
  69.    /**
  70.    ***  This will respond to the RACF password prompts
  71.    **/
  72.  
  73.    say "Not Implemented yet.  Do it manually"
  74.    '@pause'
  75.    return
  76.  
  77. HostTSOLogoff: procedure expose Host.
  78.    /**
  79.    ***  This will logoff of TSO from the main ISPF/PDF panel
  80.    **/
  81.    rc = hllapi('Sendkey', "@0=X@E")
  82.    rc = hllapi('Wait')
  83.    rc = hllapi('Sendkey', "LOGOFF@E")
  84.    rc = hllapi('Wait')
  85.    return
  86.