fromdsn — write the contents of a z/OS dataset to stdout
The fromdsn command reads a z/OS MVS dataset and writes a stream of data to stdout. Lines (if requested) are produced from dataset records based on the options provided.
The fromdsn command runs in one of three environments:
locally (default on z/OS sytems)
remotely, from a client which was started by Co:Z launcher.
remotely, from a client that started a durable session to the server using the cozcontrol command.
remotely, from a client-initiated ssh connection:
The user has wide flexibility in choosing:
dataset-nameis to be allocated/opened for writing
How records are to be created from the incoming source lines
What character set (codepage) translations are to be performed
dataset-name is automatically converted to upper
case, and is assumed to be fully qualified unless otherwise specified
-r option below). If
starts with 'DD:', then it refers to an existing DDNAME.
The fromdsn command also supports reading JES spool files using special
-JES.jobid- reads the concatenated spool files for a given job. The
-Soption may be specified to indicate that SYSIN spool files should be included.
-JES.jobid.dsid- reads a specific spool file by numerid dsid.
-JES.jobid.[stepname[.procstep]ddame- reads the first spool file in a job that matches a step/procstep/ddname. This form may also be used to retrieve SYSIN spool files. When reading
-JES.jobid.JESJCLIN, the output will include not only JCL card images, but also embedded SYSIN spool files.
Specifies a remote invocation of fromdsn using a client-initiated ssh connection to the given z/OS user@host. If specified, this must be the first command option.
Specifies the use of local z/OS I/O, even if run via CoZLauncher. Applicable when the source and target are both z/OS. If specified, this must be the first command option.
binary mode, same as
display help and exit.
keep trailing pad characters in record. The default is to trim if
dataset-namehas fixed length records.
always trim trailing pad characters, even if the dataset contains variable-length records.
follow lines with a newline, carriage return, linefeed, or combination. The characters are taken from the target codepage. The default is
preceed lines with a four byte IBM-style RDW, consisting of a two byte network order (big endian) length, followed by two bytes of zeros.
preceed lines with a four byte network order (big endian) length of the record that follows. Note: Unlike the
rdwoption, this length value does not include the size of the length field.
Write a 128 byte MicroFocus standard header prior to output data. Preceed each line with a network order (big endian) length. If the maximum record length is < 4095 bytes, the length field is 2 bytes. If the maximum record length is >= 4095 bytes, the length field is 4 bytes. Each line is padded with zeros to the nearest 4 byte boundary.
follow lines with a hex character sequence. The sequence must be between 1 and 8 bytes long.
no line separator
A comma-separated list of options to control logging and tracing.
Logging threshhold: eMergency, Alert, Critical, Error, Warning, Notice (default), Info, Debug, Trace, Fine.
Prefix log messages with a system timestamp
Include consumed cpu time in log messages
Messages are logged to
filenameon the server instead of stderr. If not fully qualified, the file is written to the user's home directory on the server.
Messages are logged to SYSLOG facility instead of stderr
Set the logging threshold for a specific component. Specify only at the request of product support personnel.
additional mode arguments to the z/OS C library fopen() routine. The base mode options used by fromdsn to open
rb,type=record,noseek". See "z/OS C++ Programming Guide" for details.
Codepage conversion technique string. Used to override the default Unicode Services value of
LMREC. For more information, see IBM's Unicode Services User's Guide and Reference (SA22-7649).
dataset-namewill be prefixed with the current z/OS userid.
The codepage name or numeric CCSID id of the input dataset. If not specified, then the default z/OS process codepage is used.
This option may be specified when reading the concatenated spool files for a JES job ('-JES.jobid') to specify that the SYSIN spool files should also be included. This feature is only available on z/OS 1.10 or later.
The codepage name or numeric CCSID id of data written to stdout. If not specified and invoked from a remote client with a line- separater other than 'none', 'rdw' or 'mfrdw', then the default client codepage is used, otherwise the default z/OS code- page is used. Translation is disabled if source-codepage equals target-codepage.
-TSTANDARD | translate_table_dsname
Specifies the translate table to use for text mode transfers. This option overrides the
-s -t -qoptions if also given. If
STANDARD, the translate table TCPIP.STANDARD.TCPXLBIN is used. If a dataset name is supplied, it is expected to be in the format produced by the TSO CONVXLAT command. Only single byte translations are supported. Specifically, the dataset DCB must be LRECL=256,RECFM=F and contain two translation table records. The first record is an ASCII-to-EBCDIC mapping; the second record is an EBCDIC-to-ASCII mapping. Additional comment records (starting with * in the first column) are allowed.
display the current version and exit.
can be specified to provide more precise control over the disposition of dataset-name than the fopen-options. For example, opening a dataset with fopen forces a disposition of 'OLD'. This may not always be desirable in a shared batch environment. The bpxwdyn keywords enable different dispostions to be specified (e.g 'SHR'). If
dataset-nameis 'DD:name', then this option is ignored. For a complete list of options, see the IBM manual: "Using REXX and z/OS UNIX System Services".
fromdsn may obtain name matched profile information for a
dataset from either a per-user profile or a system-wide profile on the z/OS system.
For well known
dataset-name patterns, profile options can be used to
significantly reduce the specification of individual options on the command line. The file format
and profile options are described in dsn_profile(5).
Local z/OS Examples
fromdsn mvs1.my.lib(member1) > /home/user/member1
Copies an MVS dataset (PDS member) to an HFS/zFS file.
fromdsn -x shr mvs1.input.dataset > /home/user/mydata
Copies an MVS dataset using DISP=SHR.
fromdsn mvs1.input.dataset | todsn mvs1.output.dataset
Copies one MVS dataset to another
fromdsn -jes.job123 > job.out
Copies all output from a job to an HFS/zFS file
fromdsn -jes.j333.report.sysprint > report.txt
Copies the output from a job's spool file to an HFS/zFS file
Remote Client SSH Connection Examples
fromdsn -ssh firstname.lastname@example.org //mvs1.input.dataset > /tmp/data
Downloads an MVS dataset over an SSH connection (Unix).
fromdsn -ssh email@example.com //mvs1.input.dataset > c:ata.txt
Downloads an MVS dataset over an SSH connection (Windows).
fromdsn -ssh -p 2222 firstname.lastname@example.org -l rdw -r //binary.dataset > /tmp/rdw.bin.data
Downloads a MVS dataset over an SSH connection with addtional ssh options: (the dataset contains binary records which are prefixed with RDWs)