18
18
<a HREF="#Version">Version</a><br>
20
20
<a NAME="Name"></a><h2>Name</h2>
21
Scripting Facilities for x3270, s3270 and c3270
21
Scripting Facilities for x3270, s3270, ws3270 and c3270
22
22
<a NAME="Synopsis"></a><h2>Synopsis</h2>
23
23
<b>x3270</b> <b>-script</b> [ <i>x3270-options</i> ]
25
<b>s3270</b> [ <i>x3270-options</i> ]
25
<b>s3270</b> [ <i>s3270-options</i> ]
27
<b>ws3270</b> [ <i>ws3270-options</i> ]
27
29
<b>Script</b> ( <i>command</i> [ ,<i>arg</i>... ] )
28
30
<a NAME="Description"></a><h2>Description</h2>
29
31
The <b>x3270</b> scripting facilities allow the interactive 3270 emulators
30
32
<b>x3270</b> and <b>c3270</b> to be operated under the control of another
31
program, and form the basis for the script-only emulator <b>s3270</b>.
33
program, and form the basis for the script-only emulators <b>s3270</b>
33
36
There are two basic scripting methods.
34
37
The first is the <b>peer script</b> facility, invoked by the <b>x3270</b>
35
<b>-script</b> switch, and the default mode for <b>s3270</b>.
36
This runs <b>x3270</b> or <b>s3270</b> as a child of another process.
38
<b>-script</b> switch, and the default mode for <b>s3270</b> and
40
This runs <b>x3270</b>, <b>s3270</b> or <b>ws3270</b> as a child of another
37
42
Typically this would be a script using
38
43
<i>expect</i>(1), <i>perl</i>(1),
39
44
or the co-process facility of the Korn Shell
66
71
Unlike translation tables, action names are case-insensitive, can be
67
72
uniquely abbreviated, and the parentheses may be omitted if there are
74
Any input line that begins with <b>#</b> or <b>!</b> is treaded as a comment
70
77
Any emulator action may be specified.
71
78
Several specific actions have been defined for use by scripts, and the behavior
133
140
window, in hexadecimal preceded by
136
<b>s3270</b> and <b>c3270</b>,
143
<b>s3270</b>, <b>ws3270</b> and <b>c3270</b>,
138
145
<dt>12 Command Execution Time</dt><dd>
139
146
The time that it took for the host to respond to the previous commnd, in
287
294
<font size=-1>EBCDIC</font>
289
296
<dt><b>Info</b>(<i>message</i>)</dt><dd>
290
Pops up an informational message.
297
In x3270, pops up an informational message.
298
In c3270 and wc3270, writes an informational message to the OIA (the line below
300
Not defined for s3270 or tcl3270.
291
301
<dt><b>Expect</b>(<i>text</i>[,<i>timeout</i>])</dt><dd>
292
302
Pauses the script until the specified
421
431
The optional <i>timeout</i> parameter specifies a number of seconds to wait
422
432
before failing the <b>Snap</b> action. The default is to wait indefinitely.
433
<dt><b>Source</b>(<i>file</i>)</dt><dd>
434
Read and execute commands from <i>file</i>.
435
Any output from those commands will become the output from <b>Source</b>.
436
If any of the commands fails, the <b>Source</b> command will <i>not</i> abort;
437
it will continue reading commands until EOF.
423
438
<dt><b>Title</b>(<i>text</i>)</dt><dd>
424
439
Changes the x3270 window title to <i>text</i>.
425
440
<dt><b>Transfer</b>(<i>keyword</i>=<i>value</i>,...)</dt><dd>
507
522
The optional <i>timeout</i> parameter specifies a number of seconds to wait
508
523
before failing the <b>Wait</b> action. The default is to wait indefinitely.
524
<dt><b>Wait</b>(<i>timeout</i>, <b>Seconds</b>)</dt><dd>
525
Delays the script <i>timeout</i> seconds.
526
Unlike the other forms of <b>Wait</b>, the timeout is not optional.
509
527
<dt><b>WindowState</b>(<i>mode</i>)</dt><dd>
510
528
If <i>mode</i> is <b>Iconic</b>, changes the x3270 window into an icon.
511
529
If <i>mode</i> is <b>Normal</b>, changes the x3270 window from an icon to a
532
550
<table BORDER cols=4 width="75%">
533
551
<tr><td >Option</td> <td >Required?</td> <td >Default</td> <td >Other Values</td></tr>
535
<tr><td >Direction</td> <td >No</td> <td >send</td> <td >receive</td></tr>
553
<tr><td >Direction</td> <td >No</td> <td >receive</td> <td >send</td></tr>
536
554
<tr><td >HostFile</td> <td >Yes</td> <td > </td> <td > </td></tr>
537
555
<tr><td >LocalFile</td> <td >Yes</td> <td > </td> <td > </td></tr>
538
556
<tr><td >Host</td> <td >No</td> <td >tso</td> <td >vm</td></tr>
539
557
<tr><td >Mode</td> <td >No</td> <td >ascii</td> <td >binary</td></tr>
540
558
<tr><td >Cr</td> <td >No</td> <td >remove</td> <td >add, keep</td></tr>
559
<tr><td >Remap</td> <td >No</td> <td >yes</td> <td >no</td></tr>
541
560
<tr><td >Exist</td> <td >No</td> <td >keep</td> <td >replace, append</td></tr>
542
561
<tr><td >Recfm</td> <td >No</td> <td > </td> <td >fixed, variable, undefined</td></tr>
543
562
<tr><td >Lrecl</td> <td >No</td> <td > </td> <td > </td></tr>
551
570
The option details are as follows.
552
571
<dl><dt><b>Direction</b></dt><dd>
553
<b>send</b> (the default) to send a file to the host,
572
<b>send</b> to send a file to the host,
554
573
<b>receive</b> to receive a file from the host.
555
574
<dt><b>HostFile</b></dt><dd>
556
575
The name of the file on the host.
572
591
transferring it to the local workstation.
573
592
<b>keep</b> preserves <b>Newline</b> characters when transferring a local file
594
<dt><b>Remap</b></dt><dd>
595
Controls text translation for <b>Mode=ascii</b> files.
596
The value <b>yes</b> (the default) causes x3270-script to remap the text to ensure
597
maximum compatibility between the workstation's character set and encoding
598
and the host's EBCDIC code page.
599
The value <b>no</b> causes x3270-script to pass the text to or from the host
600
as-is, leaving all translation to the <b>IND$FILE</b> program on the host.
575
601
<dt><b>Exist</b></dt><dd>
576
602
Controls what happens when the destination file already exists.
577
603
<b>keep</b> (the default) preserves the file, causing the
579
605
<b>replace</b> overwrites the destination file with the source file.
580
606
<b>append</b> appends the source file to the destination file.
581
607
<dt><b>Recfm</b></dt><dd>
582
Controls the record of files created on the host.
608
Controls the record format of files created on the host.
583
609
<b>fixed</b> creates a file with fixed-length records.
584
610
<b>variable</b> creates a file with variable-length records.
585
611
<b>undefined</b> creates a file with undefined-length records (<font size=-1>TSO</font> hosts only).
616
642
<a HREF="c3270-man.html">c3270(1)</a>
618
644
<a HREF="s3270-man.html">s3270(1)</a>
646
<a HREF="ws3270-man.html">ws3270(1)</a>
619
647
<a NAME="Version"></a><h2>Version</h2>
623
651
This HTML document and the accompanying troff document were generated with
624
652
a set of write-only <b>m4</b> macros and the powerful <b>vi</b> editor.
625
<br>Last modified 04 July 2008.
653
<br>Last modified 02 October 2009.