home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 14 / CDACTUAL.iso / cdactual / demobin / share / os2 / edm2 / common / snippets / 3270.txt next >
Encoding:
Text File  |  1997-02-23  |  3.2 KB  |  118 lines

  1. lionel.b.dyck@kp.org (Lionel B. Dyck):
  2.  
  3. This 'tip' is for those using the new lite version of PC/3270 that comes
  4. with Merlin but are still used to typing TN3270 or PMANT.  This is a 
  5. rexx exec that invokes PC/3270 for those who haven't retrained their
  6. fingers.  It isn't a complete 'clone' of tn3270/pmant but it does the
  7. job and it is free (with no guarantees).
  8.  
  9. /* rexx simulation of TN3270/PMANT to activate PC/3270 'lite'
  10.    using the TN3270/PMANT command prompt.
  11.  
  12.    Syntax:  tn3270 host options
  13.          or pmant  host options
  14.  
  15.    This command should be installed as both tn3270.cmd AND pmant.cmd
  16.    to allow you to use either command name.
  17.  
  18.    Supported Options are:
  19.             rows - number of rows per screen
  20.             cols - number of columns per screen
  21.  
  22.    Note:  The rows and columns must conform to a valid combination
  23.           or pc/3270 will default to 24x80.  Supported combinations
  24.           appear to be 24x80, 32x80, 43x80, and 27x132.
  25.  
  26.    Logic:   1.  Parse input options
  27.             2.  Prompt for host name if non provided
  28.             3.  Check for rows and columns
  29.             4.  Build temp pc/3270 .ws file in tmp directory
  30.             5.  Invoke pcsws (pc/3270 lite) passing the .ws file
  31.                 name (3)
  32.             6.  Delete the temp .ws file (4) and exit
  33.  
  34.    Author:  Lionel B. Dyck
  35.             Kaiser Foundation Health Plan
  36.             25 N. Via Monte Ave
  37.             Walnut Creek, CA 94598
  38.             (510) 926-5332
  39.             Internet: lionel.b.dyck@kp.org
  40.  
  41. */
  42.  
  43. arg host_name options
  44.  
  45. do while length(host_name) = 0
  46.    say "Enter host name:"
  47.    pull host_name
  48.    end
  49.  
  50. /* set defaults */
  51. screen_rows = 24
  52. screen_cols = 80
  53.  
  54. options = translate(options)
  55.  
  56. parse value options with 1 'ROWS' rows . 1 'COLS' cols .
  57.  
  58. if length(rows) > 0 then screen_rows = rows
  59. if length(cols) > 0 then screen_cols = cols
  60.  
  61. Call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  62. Call SysLoadFuncs
  63.  
  64. tmp = value("TMP",,"OS2ENVIRONMENT")
  65.  
  66. parse value time() with hh ":" mm ":" ss
  67.  
  68. file = tmp"\"hh""mm""ss".ws"
  69.  
  70. call lineout file,"[Profile]"
  71. call lineout file,"ID=WS"
  72. call lineout file,"Description="
  73. call lineout file,""
  74. call lineout file,"[Translation]"
  75. call lineout file,"IBMDefaultView=Y"
  76. call lineout file,"DefaultView="
  77. call lineout file,"IBMDefaultDBCS=Y"
  78. call lineout file,"DefaultDBCS="
  79. call lineout file,""
  80. call lineout file,"[Communication]"
  81. call lineout file,"AutoConnect=Y"
  82. call lineout file,"Link=telnet3270"
  83. call lineout file,"Session=3270"
  84. call lineout file,""
  85. call lineout file,"[Telnet3270]"
  86. call lineout file,"HostName="host_name
  87. call lineout file,"HostPortNumber=23"
  88. call lineout file,"LUName="
  89. call lineout file,"AutoReconnect=Y"
  90. call lineout file,"ExtendedColor=Y"
  91. call lineout file,"ATTN=6CFFEFFFF3"
  92. call lineout file,"SYSREQ=F0FFEF"
  93. call lineout file,""
  94. call lineout file,"[3270]"
  95. call lineout file,"ScreenSize="screen_rows"x"screen_cols
  96. call lineout file,"SessionType=Display"
  97. call lineout file,"HostGraphics=N"
  98. call lineout file,"NativeGraphics=N"
  99. call lineout file,"LoadPSS=N"
  100. call lineout file,"QueryReplyMode=Auto"
  101. call lineout file,"HostCodePage=037-U"
  102. call lineout file,"LtNumber=FF"
  103. call lineout file,"LuNumber=FF"
  104. call lineout file
  105.  
  106. "@pcsws" file
  107.  
  108. "@del" file
  109.  
  110. Exit
  111.  
  112. file,:
  113.   arg data
  114.   line = out.0 + 1
  115.   out.line = data
  116.   out.0 = line
  117.   return
  118.