File: x3270-script.man

package info (click to toggle)
ibm-3270 3.3.10ga4-2
  • links: PTS
  • area: non-free
  • in suites: squeeze, wheezy
  • size: 32,040 kB
  • ctags: 26,456
  • sloc: ansic: 74,474; sh: 3,998; makefile: 931; perl: 263; exp: 184; python: 135; tcl: 94
file content (1198 lines) | stat: -rw-r--r-- 24,650 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
'\" t
.TH X3270-SCRIPT 1 "02 October 2009"
.SH "NAME"
Scripting Facilities for x3270, s3270, ws3270 and c3270
.SH "SYNOPSIS"
\fBx3270\fP \fB\-script\fP [ \fIx3270-options\fP ]
.br
\fBs3270\fP [ \fIs3270-options\fP ]
.br
\fBws3270\fP [ \fIws3270-options\fP ]
.br
\fBScript\fP ( \fIcommand\fP [ ,\fIarg\fP... ] )
.SH "DESCRIPTION"
The \fBx3270\fP scripting facilities allow the interactive 3270 emulators
\fBx3270\fP and \fBc3270\fP to be operated under the control of another
program, and form the basis for the script-only emulators \fBs3270\fP
and \fBws3270\fP.
.PP
There are two basic scripting methods.
The first is the \fBpeer script\fP facility, invoked by the \fBx3270\fP
\fB\-script\fP switch, and the default mode for \fBs3270\fP and
\fBws3270\fP.
This runs \fBx3270\fP, \fBs3270\fP or \fBws3270\fP as a child of another
process.
Typically this would be a script using
\fIexpect\fP(1), \fIperl\fP(1),
or the co-process facility of the Korn Shell
\fIksh\fP(1).
Inthis mode, the emulator process looks for commands on its standard input,
and places the responses on standard output and standard error output.
.PP
The second method is the \fBchild script\fP
facility, invoked by the \fBScript\fP action in \fBx3270\fP, \fBc3270\fP,
or \fBs3270\fP.
This runs a script as a child process of the emulator.
The child has access to pipes connected to the emulator; the emulator
look for commands on one pipe, and places the responses on the other.
(The file descriptor of the pipe for commands to the emulator
is passed in the environment variable X3270INPUT; the file descriptor
of the pipe for responses from the emulator is passed in the environment
variable X3270OUTPUT.)
.PP
It is possible to mix the two methods.
A script can invoke another script with the \fBScript\fP action, and
may also be implicitly nested when a script invokes the
\fBConnect\fP
action, and the
\fBibm_hosts\fP
file specifies a login script for that host name.
.PP
Commands are emulator \fIactions\fP; the syntax is the same as for the
right-hand side of an Xt translation table entry (an \fBx3270\fP or
\fBc3270\fP keymap).
Unlike translation tables, action names are case-insensitive, can be
uniquely abbreviated, and the parentheses may be omitted if there are
no parameters.
Any input line that begins with \fB#\fP or \fB!\fP is treaded as a comment
and will be ignored.
.PP
Any emulator action may be specified.
Several specific actions have been defined for use by scripts, and the behavior
of certain other actions (and of the emulators in general) is different when
an action is initiated by a script.
.PP
Some actions generate output; some may delay completion until the certain
external events occur, such as the host unlocking the keyboard.
The completion of every command is marked by a two-line message.
The first line is the current status of the emulator, documented below.
If the command is successful, the second line is the string "ok"; otherwise it
is the string "error".
.SH "STATUS FORMAT"
The status message consists of 12 blank-separated fields:
.TP
1 Keyboard State
If the keyboard is unlocked, the letter
\fBU\fP.
If the keyboard is locked waiting for a response from the host, or if not
connected to a host, the letter
\fBL\fP.
If the keyboard is locked because of an operator error (field overflow,
protected field, etc.), the letter
\fBE\fP.
.TP
2 Screen Formatting
If the screen is formatted, the letter
\fBF\fP.
If unformatted or in \s-1NVT\s+1 mode, the letter \fBU\fP.
.TP
3 Field Protection
If the field containing the cursor is protected, the letter
\fBP\fP.
If unprotected or unformatted, the letter
\fBU\fP.
.TP
4 Connection State
If connected to a host, the string
\fBC(\fP\fIhostname\fP\fB)\fP.
Otherwise, the letter
\fBN\fP.
.TP
5 Emulator Mode
If connected in 3270 mode, the letter
\fBI\fP.
If connected in \s-1NVT\s+1 line mode, the letter
\fBL\fP.
If connected in \s-1NVT\s+1 character mode, the letter
\fBC\fP.
If connected in unnegotiated mode (no BIND active from the host), the letter
\fBP\fP.
If not connected, the letter
\fBN\fP.
.TP
6 Model Number (2-5)
.TP
7 Number of Rows
The current number of rows defined on the screen.
The host can request that the emulator
use a 24x80 screen, so this number may be smaller than the maximum number of
rows possible with the current model.
.TP
8 Number of Columns
The current number of columns defined on the screen, subject to the same
difference for rows, above.
.TP
9 Cursor Row
The current cursor row (zero-origin).
.TP
10 Cursor Column
The current cursor column (zero-origin).
.TP
11 Window ID
The X window identifier for the main
\fBx3270\fP
window, in hexadecimal preceded by
\fB0x\fP.
For
\fBs3270\fP, \fBws3270\fP and \fBc3270\fP,
this is zero.
.TP
12 Command Execution Time
The time that it took for the host to respond to the previous commnd, in
seconds with milliseconds after the decimal.
If the previous command did not require a host response, this is a dash.
.SH "DIFFERENCES"
When an action is initiated by a script, the emulators
behave in several different ways:
.PP
If an error occurs in processing an action, the usual pop-up window does not
appear.
Instead, the text is written to standard error output.
.PP
If end-of-file is detected on standard input, the emulator exits.
(A script can exit without killing the emulator
by using the \fBCloseScript\fP action, below.)
Note that this applies to peer scripts only; end-of-file on the pipe
connected to a child script simply causes the pipes to be closed and
the
\fBScript\fP
action to complete.
.PP
The \fBQuit\fP action always causes the emulator to exit.
(When called from the keyboard, it will exit only if not connected to a host.)
.PP
Normally, the AID actions (\fBClear\fP,
\fBEnter\fP,
\fBPF\fP,
and
\fBPA\fP)
will not complete until the host unlocks the keyboard.
If the parameter to a
\fBString\fP
action includes a code for one these actions,
it will also wait for the keyboard to unlock before proceeding.
.PP
The \fBAidWait\fP toggle controls with behavior.
When this toggle is set (the default), actions block as described above.
When the toggle is clear, AID actions complete immediately.
The \fBWait(Output)\fP action can then be used to delay a script until the
host changes something on the screen, and the
\fBWait(Unlock)\fP action can be used to delay a script until the host
unlocks the keyboard, regardless of the state of the \fBAidWait\fP toggle.
.PP
Note that the
\fBScript\fP
action does not complete until end-of-file is
detected on the pipe or the
\fBCloseScript\fP
action is called by the child
process.
This behavior is not affected by the state of the \fBAidWait\fP toggle.
.SH "SCRIPT-SPECIFIC ACTIONS"
The following actions have been defined or modified for use with scripts.
(Note that unlike the display on the status line,
\fIrow\fP
and
\fIcol\fP
coordinates used in these actions use [0,0] as their origin, not [1,1]).
.TP
\fBAnsiText\fP
Outputs whatever data that has been output by the host in
\s-1NVT\s+1 mode
since the last time that
\fBAnsiText\fP
was called.
The data is preceded by the string "data:\ ", and has had all control characters
expanded into C backslash sequences.
.IP
This is a convenient way to capture
\s-1NVT\s+1
mode output in a synchronous manner without trying to decode the screen
contents.
.TP
\fBAscii\fP(\fIrow\fP,\fIcol\fP,\fIrows\fP,\fIcols\fP)
.TP
\fBAscii\fP(\fIrow\fP,\fIcol\fP,\fIlength\fP)
.TP
\fBAscii\fP(\fIlength\fP)
.TP
\fBAscii\fP
Outputs an \s-1ASCII\s+1 text representation of the screen contents.
Each line is preceded by the string "data:\ ", and there are no control
characters.
.IP
If four parameters are given, a rectangular region of the screen is output.
.IP
If three parameters are given,
\fIlength\fP
characters are output, starting at the specified row and column.
.IP
If only the
\fIlength\fP
parameter is given, that many characters are output, starting at the cursor
position.
.IP
If no parameters are given, the entire screen is output.
.IP
The EBCDIC-to-ASCII translation and output character set depend on the both the
emulator character set (the \fB\-charset\fP option) and the locale.
UTF-8 and certain DBCS locales may result in multi-byte expansions of EBCDIC
characters that translate to ASCII codes greater than 0x7f.
.TP
\fBAsciiField\fP
Outputs an \s-1ASCII\s+1 text representation of the field containing the cursor.
The text is preceded by the string "data:\ ".
.TP
\fBConnect\fP(\fIhostname\fP)
Connects to a host.
The command does not return until the emulator
is successfully connected in the proper mode, or the connection fails.
.TP
\fBCloseScript\fP(\fIstatus\fP)
Causes the emulator to stop reading commands from the script.
This is useful to allow a peer script to exit, with the emulator
proceeding interactively.
(Without this command, the emulator
would exit when it detected end-of-file on standard input.)
If the script was invoked by the
\fBScript\fP
action, the optional
\fIstatus\fP
is used as the return status of
\fBScript\fP;
if nonzero,
\fBScript\fP
will complete with an error, and if this script was invoked as part of
login through the
\fBibm_hosts\fP
file, the connection will be broken.
.TP
\fBContinueScript\fP(\fIparam\fP)
Allows a script that is waiting in a
\fBPauseScript\fP
action, below, to continue.
The
\fIparam\fP
given is output by the
\fBPauseScript\fP
action.
.TP
\fBDisconnect\fP
Disconnects from the host.
.TP
\fBEbcdic\fP(\fIrow\fP,\fIcol\fP,\fIrows\fP,\fIcols\fP)
.TP
\fBEbcdic\fP(\fIrow\fP,\fIcol\fP,\fIlength\fP)
.TP
\fBEbcdic\fP(\fIlength\fP)
.TP
\fBEbcdic\fP
The same function as
\fBAscii\fP
above, except that rather than generating
\s-1ASCII\s+1
text, each character is output as a hexadecimal
\s-1EBCDIC\s+1
code, preceded by
\fB0x\fP.
.TP
\fBEbcdicField\fP
The same function as
\fBAsciiField\fP
above, except that it generates hexadecimal
\s-1EBCDIC\s+1
codes.
.TP
\fBInfo\fP(\fImessage\fP)
In x3270, pops up an informational message.
In c3270 and wc3270, writes an informational message to the OIA (the line below
the display).
Not defined for s3270 or tcl3270.
.TP
\fBExpect\fP(\fItext\fP[,\fItimeout\fP])
Pauses the script until the specified
\fItext\fP
appears in the data stream from the host, or the specified
\fItimeout\fP
(in seconds) expires.
If no
\fItimeout\fP
is specified, the default is 30 seconds.
\fIText\fP
can contain standard C-language escape (backslash) sequences.
No wild-card characters or pattern anchor characters are understood.
\fBExpect\fP
is valid only in
\s-1NVT\s+1
mode.
.TP
\fBMoveCursor\fP(\fIrow\fP,\fIcol\fP)
Moves the cursor to the specified coordinates.
.TP
\fBPauseScript\fP
Stops a script until the
\fBContinueScript\fP
action, above, is executed.
This allows a script to wait for user input and continue.
Outputs the single parameter to
\fBContinueScript\fP.
.TP
\fBPrintText\fP([\fBcommand\fP,]\fIfilter\fP))
Pipes an ASCII representation of the current screen image through the named
\fIfilter\fP, e.g., \fBlpr\fP.
.TP
\fBPrintText\fP([\fBhtml\fP,],\fBfile\fP,\fIfilename\fP))
Saves the current screen contents in a file.
With the \fBhtml\fP option, saves it as HTML, otherwise saves it as plain
ASCII.
.TP
\fBPrintText\fP(\fBhtml,string\fP)
Returns the current screen contents as HTML.
.TP
\fBReadBuffer\fP(\fBAscii\fP)
Dumps the contents of the screen buffer, one line at a time.
Positions inside data fields are generally output as 2-digit hexadecimal codes
in the current display character set.
If the current locale specifies UTF-8 (or certain DBCS character sets), some
positions may be output as multi-byte strings (4-, 6- or 8-digit codes).
DBCS characters take two positions in the screen buffer; the first location
is output as a multi-byte string in the current locale codeset, and the second
location is output as a dash.
Start-of-field characters (each of which takes up a display position) are
output as \fBSF(aa=nn[,...])\fP, where \fIaa\fP is a field
attribute type and \fInn\fP is its value.
.PP
.TS
center;
l l .
T{
.na
.nh
Attribute
T}	T{
.na
.nh
Values
T}
_
T{
.na
.nh
c0 basic 3270
T}	T{
.na
.nh
20 protected
T}
T{
.na
.nh

T}	T{
.na
.nh
10 numeric
T}
T{
.na
.nh

T}	T{
.na
.nh
04 detectable
T}
T{
.na
.nh

T}	T{
.na
.nh
08 intensified
T}
T{
.na
.nh

T}	T{
.na
.nh
0c non-display
T}
T{
.na
.nh

T}	T{
.na
.nh
01 modified
T}
T{
.na
.nh
41 highlighting
T}	T{
.na
.nh
f1 blink
T}
T{
.na
.nh

T}	T{
.na
.nh
f2 reverse
T}
T{
.na
.nh

T}	T{
.na
.nh
f4 underscore
T}
T{
.na
.nh

T}	T{
.na
.nh
f8 intensify
T}
T{
.na
.nh
42 foreground
T}	T{
.na
.nh
f0 neutral black
T}
T{
.na
.nh

T}	T{
.na
.nh
f1 blue
T}
T{
.na
.nh

T}	T{
.na
.nh
f2 red
T}
T{
.na
.nh

T}	T{
.na
.nh
f3 pink
T}
T{
.na
.nh

T}	T{
.na
.nh
f4 green
T}
T{
.na
.nh

T}	T{
.na
.nh
f5 turquoise
T}
T{
.na
.nh

T}	T{
.na
.nh
f6 yellow
T}
T{
.na
.nh

T}	T{
.na
.nh
f7 neutral white
T}
T{
.na
.nh

T}	T{
.na
.nh
f8 black
T}
T{
.na
.nh

T}	T{
.na
.nh
f9 deep blue
T}
T{
.na
.nh

T}	T{
.na
.nh
fa orange
T}
T{
.na
.nh

T}	T{
.na
.nh
fb purple
T}
T{
.na
.nh

T}	T{
.na
.nh
fc pale green
T}
T{
.na
.nh

T}	T{
.na
.nh
fd pale turquoise
T}
T{
.na
.nh

T}	T{
.na
.nh
fe grey
T}
T{
.na
.nh

T}	T{
.na
.nh
ff white
T}
T{
.na
.nh
43 character set
T}	T{
.na
.nh
f0 default
T}
T{
.na
.nh

T}	T{
.na
.nh
f1 APL
T}
T{
.na
.nh

T}	T{
.na
.nh
f8 DBCS
T}
.TE
.IP
Extended attributes (which do not take up display positions) are output as
\fBSA(aa=nn)\fP, with \fIaa\fP and \fInn\fP having
the same definitions as above (though the basic 3270 attribute will never
appear as an extended attribute).
.IP
In addition, NULL characters in the screen buffer are reported as ASCII
character 00 instead of 20, even though they should be displayed as blanks.
.TP
\fBReadBuffer\fP(\fBEbcdic\fP)
Equivalent to \fBSnap\fP(\fBAscii\fP), but with the data fields output as
hexadecimal EBCDIC codes instead.
Additionally, if a buffer position has the Graphic Escape attribute, it is
displayed as \fBGE(\fIxx\fP)\fP.
.TP
\fBSnap\fP
Equivalent to \fBSnap\fP(\fBSave\fP) (see below).
.TP
\fBSnap\fP(\fBAscii\fP,...)
Performs the \fBAscii\fP action on the saved screen image.
.TP
\fBSnap\fP(\fBCols\fP)
Returns the number of columns in the saved screen image.
.TP
\fBSnap\fP(\fBEbcdic\fP,...)
Performs the \fBEbcdic\fP action on the saved screen image.
.TP
\fBSnap\fP(\fBReadBuffer\fP)
Performs the \fBReadBuffer\fP action on the saved screen image.
.TP
\fBSnap\fP(\fBRows\fP)
Returns the number of rows in the saved screen image.
.TP
\fBSnap\fP(\fBSave\fP)
Saves a copy of the screen image and status in a temporary buffer.
This copy can be queried with other
\fBSnap\fP
actions to allow a script to examine a consistent screen image, even when the
host may be changing the image (or even the screen dimensions) dynamically.
.TP
\fBSnap\fP(\fBStatus\fP)
Returns the status line from when the screen was last saved.
.TP
\fBSnap\fP(\fBWait\fP[,\fItimeout\fP],\fBOutput\fP)
Pauses the script until the host sends further output, then updates the snap
buffer with the new screen contents.
Used when the host unlocks the keyboard (allowing the script to proceed after
an
\fBEnter\fP,
\fBPF\fP
or
\fBPA\fP
action), but has not finished updating the screen.
This action is usually invoked in a loop that uses the
\fBSnap\fP(\fBAscii\fP)
or
\fBSnap\fP(\fBEbcdic\fP)
action to scan the screen for some pattern that indicates that the host has
fully processed the last command.
.IP
The optional \fItimeout\fP parameter specifies a number of seconds to wait
before failing the \fBSnap\fP action.  The default is to wait indefinitely.
.TP
\fBSource\fP(\fIfile\fP)
Read and execute commands from \fIfile\fP.
Any output from those commands will become the output from \fBSource\fP.
If any of the commands fails, the \fBSource\fP command will \fInot\fP abort;
it will continue reading commands until EOF.
.TP
\fBTitle\fP(\fItext\fP)
Changes the x3270 window title to \fItext\fP.
.TP
\fBTransfer\fP(\fIkeyword\fP=\fIvalue\fP,...)
Invokes IND$FILE file transfer.
See \s-1FILE TRANSFER\s+1 below.
.TP
\fBWait\fP([\fItimeout\fP,] \fB3270Mode\fP)
Used when communicating with a host that switches between
\s-1NVT\s+1 mode and 3270 mode.
Pauses the script or macro until the host negotiates 3270 mode, then waits for
a formatted screen as above.
.IP
The optional \fItimeout\fP parameter specifies a number of seconds to wait
before failing the \fBWait\fP action.  The default is to wait indefinitely.
.IP
For backwards compatibility,
\fBWait(3270)\fP
is equivalent to
\fBWait\fP(\fB3270Mode\fP)
.TP
\fBWait\fP([\fItimeout\fP,] \fBDisconnect\fP)
Pauses the script until the host disconnects.
Often used to after sending a
\fIlogoff\fP
command to a \s-1VM/CMS\s+1 host, to ensure that the session is not unintentionally
set to
\fBdisconnected\fP
state.
.IP
The optional \fItimeout\fP parameter specifies a number of seconds to wait
before failing the \fBWait\fP action.  The default is to wait indefinitely.
.TP
\fBWait\fP([\fItimeout\fP,] \fBInputField\fP)
A useful utility for use at the beginning of scripts and after the
\fBConnect\fP action.
In 3270 mode, waits until the screen is formatted, and the host has positioned
the cursor on a modifiable field.
In \s-1NVT\s+1 mode, waits until the host sends at least one byte of data.
.IP
The optional \fItimeout\fP parameter specifies a number of seconds to wait
before failing the \fBWait\fP action.  The default is to wait indefinitely.
.IP
For backwards compatibility,
\fBWait\fP
is equivalent to
\fBWait\fP(\fBInputField\fP).
.TP
\fBWait\fP([\fItimeout\fP,] \fBNVTMode\fP)
Used when communicating with a host that switches between 3270 mode and
\s-1NVT\s+1 mode.
Pauses the script or macro until the host negotiates \s-1NVT\s+1
mode, then waits for
a byte from the host as above.
.IP
The optional \fItimeout\fP parameter specifies a number of seconds to wait
before failing the \fBWait\fP action.  The default is to wait indefinitely.
.IP
For backwards compatibility,
\fBWait\fP(\fBansi\fP)
is equivalent to
\fBWait\fP(\fBNVTMode\fP).
.TP
\fBWait\fP([\fItimeout\fP,] \fBOutput\fP)
Pauses the script until the host sends further output.
Often needed when the host unlocks the keyboard (allowing the script to
proceed after a
\fBClear\fP,
\fBEnter\fP,
\fBPF\fP
or
\fBPA\fP
action), but has not finished updating the screen.
Also used in non-blocking AID mode (see \s-1DIFFERENCES\s+1
for details).
This action is usually invoked in a loop that uses the
\fBAscii\fP
or
\fBEbcdic\fP
action to scan the screen for some pattern that indicates that the host has
fully processed the last command.
.IP
The optional \fItimeout\fP parameter specifies a number of seconds to wait
before failing the \fBWait\fP action.  The default is to wait indefinitely.
.TP
\fBWait\fP([\fItimeout\fP,] \fBUnlock\fP)
Pauses the script until the host unlocks the keyboard.
This is useful when operating in non-blocking AID mode
(\fBtoggle AidWait clear\fP), to wait for a host command to complete.
See \s-1DIFFERENCES\s+1 for details).
.IP
The optional \fItimeout\fP parameter specifies a number of seconds to wait
before failing the \fBWait\fP action.  The default is to wait indefinitely.
.TP
\fBWait\fP(\fItimeout\fP, \fBSeconds\fP)
Delays the script \fItimeout\fP seconds.
Unlike the other forms of \fBWait\fP, the timeout is not optional.
.TP
\fBWindowState\fP(\fImode\fP)
If \fImode\fP is \fBIconic\fP, changes the x3270 window into an icon.
If \fImode\fP is \fBNormal\fP, changes the x3270 window from an icon to a
normal window.
.SH "FILE TRANSFER"
The \fBTransfer\fP action implements \fBIND$FILE\fP file transfer.
This action requires that the \fBIND$FILE\fP
program be installed on the \s-1IBM\s+1 host, and that the 3270 cursor
be located in a field that will accept a \s-1TSO\s+1 or \s-1VM/CMS\s+1 command.
.LP
The \fBTransfer\fP action
can be entered at the command prompt with no parameters, which will cause it
to prompt interactively for the file names and options.
It can also be invoked with parameters to define the entire transfer.
.LP
Because of the complexity and number of options for file transfer, the
parameters to the \fBTransfer\fP action take the unique form
of \fIoption\fP=\fIvalue\fP, and can appear in any order.
Note that if the \fIvalue\fP contains spaces (such as a VM/CMS file name),
then the entire parameter must be quoted, e.g., "HostFile=xxx foo a".
The options are:
.LP
.TS
l c l l.
T{
.na
.nh
Option
T}	T{
.na
.nh
Required?
T}	T{
.na
.nh
Default
T}	T{
.na
.nh
Other Values
T}
_
T{
.na
.nh
Direction
T}	T{
.na
.nh
No
T}	T{
.na
.nh
receive
T}	T{
.na
.nh
send
T}
T{
.na
.nh
HostFile
T}	T{
.na
.nh
Yes
T}	T{
.na
.nh
\ 
T}	T{
.na
.nh
\ 
T}
T{
.na
.nh
LocalFile
T}	T{
.na
.nh
Yes
T}	T{
.na
.nh
\ 
T}	T{
.na
.nh
\ 
T}
T{
.na
.nh
Host
T}	T{
.na
.nh
No
T}	T{
.na
.nh
tso
T}	T{
.na
.nh
vm
T}
T{
.na
.nh
Mode
T}	T{
.na
.nh
No
T}	T{
.na
.nh
ascii
T}	T{
.na
.nh
binary
T}
T{
.na
.nh
Cr
T}	T{
.na
.nh
No
T}	T{
.na
.nh
remove
T}	T{
.na
.nh
add, keep
T}
T{
.na
.nh
Remap
T}	T{
.na
.nh
No
T}	T{
.na
.nh
yes
T}	T{
.na
.nh
no
T}
T{
.na
.nh
Exist
T}	T{
.na
.nh
No
T}	T{
.na
.nh
keep
T}	T{
.na
.nh
replace, append
T}
T{
.na
.nh
Recfm
T}	T{
.na
.nh
No
T}	T{
.na
.nh
\ 
T}	T{
.na
.nh
fixed, variable, undefined
T}
T{
.na
.nh
Lrecl
T}	T{
.na
.nh
No
T}	T{
.na
.nh
\ 
T}	T{
.na
.nh
\ 
T}
T{
.na
.nh
Blksize
T}	T{
.na
.nh
No
T}	T{
.na
.nh
\ 
T}	T{
.na
.nh
\ 
T}
T{
.na
.nh
Allocation
T}	T{
.na
.nh
No
T}	T{
.na
.nh
\ 
T}	T{
.na
.nh
tracks, cylinders, avblock
T}
T{
.na
.nh
PrimarySpace
T}	T{
.na
.nh
No
T}	T{
.na
.nh
\ 
T}	T{
.na
.nh
\ 
T}
T{
.na
.nh
SecondarySpace
T}	T{
.na
.nh
No
T}	T{
.na
.nh
\ 
T}	T{
.na
.nh
\ 
T}
T{
.na
.nh
BufferSize
T}	T{
.na
.nh
No
T}	T{
.na
.nh
4096
T}	T{
.na
.nh
\ 
T}
.TE
.LP
The option details are as follows.
.TP
\fBDirection\fP
\fBsend\fP to send a file to the host,
\fBreceive\fP to receive a file from the host.
.TP
\fBHostFile\fP
The name of the file on the host.
.TP
\fBLocalFile\fP
The name of the file on the local workstation.
.TP
\fBHost\fP
The type of host (which dictates the form of the \fBIND$FILE\fP command):
\fBtso\fP (the default) or \fBvm\fP.
.TP
\fBMode\fP
Use \fBascii\fP (the default) for a text file, which will be translated
between \s-1EBCDIC\s+1 and \s-1ASCII\s+1 as necessary.
Use \fBbinary\fP for non-text files.
.TP
\fBCr\fP
Controls how \fBNewline\fP characters are handled when transferring
\fBMode=ascii\fP files.
\fBremove\fP (the default) strips \fBNewline\fP characters in local files
before transferring them to the host.
\fBadd\fP adds \fBNewline\fP characters to each host file record before
transferring it to the local workstation.
\fBkeep\fP preserves \fBNewline\fP characters when transferring a local file
to the host.
.TP
\fBRemap\fP
Controls text translation for \fBMode=ascii\fP files.
The value \fByes\fP (the default) causes x3270-script to remap the text to ensure
maximum compatibility between the workstation's character set and encoding
and the host's EBCDIC code page.
The value \fBno\fP causes x3270-script to pass the text to or from the host
as-is, leaving all translation to the \fBIND$FILE\fP program on the host.
.TP
\fBExist\fP
Controls what happens when the destination file already exists.
\fBkeep\fP (the default) preserves the file, causing the
\fBTransfer\fP action to fail.
\fBreplace\fP overwrites the destination file with the source file.
\fBappend\fP appends the source file to the destination file.
.TP
\fBRecfm\fP
Controls the record format of files created on the host.
\fBfixed\fP creates a file with fixed-length records.
\fBvariable\fP creates a file with variable-length records.
\fBundefined\fP creates a file with undefined-length records (\s-1TSO\s+1 hosts only).
The \fBLrecl\fP option controls the record length or maximum record length for
\fBRecfm=fixed\fP and \fBRecfm=variable\fP files, respectively.
.TP
\fBLrecl\fP
Specifies the record length (or maximum record length) for files created on
the host.
.TP
\fBBlksize\fP
Specifies the block size for files created on the host.  (\s-1TSO\s+1 hosts only.)
.TP
\fBAllocation\fP
Specifies the units for the \s-1TSO\s+1 host \fBPrimarySpace\fP and
\fBSecondarySpace\fP options: \fBtracks\fP, \fBcylinders\fP or
\fBavblock\fP.
.TP
\fBPrimarySpace\fP
Primary allocation for a file created on a \s-1TSO\s+1 host.
The units are given by the \fBAllocation\fP option.
.TP
\fBSecondarySpace\fP
Secondary allocation for a file created on a \s-1TSO\s+1 host.
The units are given by the \fBAllocation\fP option.
.TP
\fBBufferSize\fP
Buffer size for DFT-mode transfers.
Can range from 256 to 32768.
Larger values give better performance, but some hosts may not be able to
support them.
.SH "SEE ALSO"
expect(1)
.br
ksh(1)
.br
x3270(1)
.br
c3270(1)
.br
s3270(1)
.br
ws3270(1)
.SH "VERSION"
Version 3.3.10ga4