TX (Tape to REXX Variable) -- REXX only

Purpose
Copy tape records into a REXX stem variable.
Usage notes
Each record is copied to a variable named stem.nnn. stem.0 is a counter.
For example, if you copy 3 records, stem is VARXX. and VARXX.0 has the value 5:
  • The records are copied to VARXX.6, VARXX.7, and VARXX.8.
  • The value of VARXX.0 is changed to 8.

This function is available only from a REXX procedure.

Related functions
TS
Copy tape data to a data set
XT
Copy a REXX stem variable to a tape file
Figure 1. Syntax

1 TX? LABEL=BLP INPUT=ddname VARNAME=stem
1! RECFMIN=U
1 RECFMIN=recfmout
2? RECSIZE=recsize
1! POSITION=0
1 POSITION=skip
1! NLRECS=ALL
1 NLRECS=nlrecs
ddname
Refers to a DD or TSO ALLOC statement.
LABEL=BLP
Specifies that bypass label processing is used. This parameter must be specified with the first File Manager function that uses the tape. For BLP processing requirements, see “Customizing the Security Environment” in the File Manager for z/OS Customization Guide.
nlrecs
Number of records to be copied or ALL. The maximum number is 99 999 999. If you specify ALL or omit the parameter, all the remaining records are copied.
recfmin
Record format for the input. Each value is a combination of the following letters:
B
Blocked
D
Variable-length ISO/ANSI tape records
F
Fixed length
S
Spanned format
U
Undefined length
V
Variable length
The possible values are: U, F, FB, V, VB, VBS, VS, D, DB, DBS, and DS.
recsize
Length of the input records, if recfmin is F or FB. If recfmin is F, the length of the first record is used by default. If recfmin is FB, recsize is required.
skip
Number of logical records to be skipped. The default is 0.
stem
A REXX stem variable name. The maximum length is 44 characters.
/* REXX */
/* copy a tape file to a rexx stem           */
/* allocate input tape                       */
/* use SL processing.  required file is at   */
/* position 1                                */

"ALLOC FILE(TAPE) DA('FMNUSER.TAPEIN')",
      "VOLUME(FMO001) UNIT(CART) LABEL(SL)",
      "POSITION(1) OLD"

/* copy a tape file to a rexx stem           */

"FILEMGR $TX INPUT=TAPE,",
            "VARNAME=TAPE."


/* Show stem contents                      */

Do i=1 To tape.0
  Say tape.i      /* show tape record        */
  End

/* free the tape unit                        */

"FREE FILE(TAPE)"

return