Name
fromdsn — write the contents of a z/OS dataset to stdout
Synopsis
fromdsn [OPTION...]dataset-namefromdsn-sock[OPTION...]dataset-namefromdsn-ssh[ssh-opt...]user@host[OPTION...]dataset-namefromdsn-localdataset-namefromdsn-vfromdsn-h
Description
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-initiated ssh connection:
-sshoptionremotely, from a client which was started by Co:Z launcher:
-sock(default option on non-z/OS systems)
The user has wide flexibility in choosing:
How
dataset-nameis to be allocated/opened for writingHow 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
(see the -r option below). If dataset-name
starts with 'DD:', then it refers to an existing DDNAME.
The fromdsn command also supports reading JES spool files using special
dataset-name syntax:
-JES.jobid- reads the concatenated spool files for a given job.-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.
Options
-sockSpecifies a remote invocation of fromdsn from a client environment running under a Co:Z Agent. This is the default for non-z/OS environments. If specified, this must be the first command option.
-ssh[ssh-options...]user@hostSpecifies 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.
-localSpecifies the use of local z/OS I/O, even if run via CoZLauncher. If specified, this must be the first command option.
-bbinary mode, same as
-lnone-p0x00.-hdisplay help and exit.
-kkeep trailing pad characters in record. The default is to trim if
dataset-namehas fixed length records.-Kalways trim trailing pad characters, even if the dataset contains variable-length records.
-lline-separatornl|cr|lf|crlf|crnlfollow lines with a newline, carriage return, linefeed, or combination. The characters are taken from the target codepage. The default is
nl.ibmrdwpreceed lines with a four byte IBM-style RDW, consisting of a two byte network order (big endian) length, followed by two bytes of zeros.
mfrdwWrite 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.
rdwpreceed lines with a four byte network order (big endian) length.
0xbb[bb..]follow lines with a hex character sequence. The sequence must be between 1 and 8 bytes long.
noneno line separator
-Llogging-optionsA comma-separated list of options to control logging and tracing:
M|A|C|E|W|N|I|D|TLogging threshhold: eMergency, Alert, Critical, Error, Warning, Notice, Info (default), Debug, Trace.
tPrefix log messages with a system timestamp
eInclude consumed cpu time in log messages
sMessages are logged to SYSLOG facility instead of stderr
logname=M|A|C|E|W|N|I|D|TSet a specific log name to the given threshold
-ofopen-optionsadditional mode arguments to the z/OS C library fopen() routine. The base mode options used by fromdsn to open
dataset-namearerb,type=record,noseek". See "z/OS C++ Programming Guide" for details.-p0xbbpad character.
-rdataset-namewill be prefixed with the current z/OS userid.-ssource-codepageThe codepage name or numeric CCSID id of the input dataset. If not specified, then the default z/OS process codepage is used.
-ttarget-codepageThe 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', 'ibmrdw', 'mfrdw' or 'rdw', 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.
-vdisplay the current version and exit.
-xbpxwdyn-alloc-keywordscan 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".
Files
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).
Examples
Local z/OS Examples
fromdsn mvs1.my.lib(member1) > /home/user/member1Copies an MVS dataset (PDS member) to an HFS/zFS file.
fromdsn -x shr mvs1.input.dataset > /home/user/mydataCopies an MVS dataset using DISP=SHR.
fromdsn mvs1.input.dataset | todsn mvs1.output.datasetCopies one MVS dataset to another
fromdsn -jes.job123 > job.outCopies all output from a job to an HFS/zFS file
fromdsn -jes.j333.report.sysprint > report.txtCopies the output from a job's spool file to an HFS/zFS file
Remote Client SSH Connection Examples
fromdsn -ssh user@myzos2.com //mvs1.input.dataset > /tmp/dataDownloads an MVS dataset over an SSH connection (Unix).
fromdsn -ssh user@myzos2.com //mvs1.input.dataset > c:ata.txtDownloads an MVS dataset over an SSH connection (Windows).
fromdsn -ssh -p 2222 user@myzos2.com -l rdw -r //binary.dataset > /tmp/rdw.bin.dataDownloads a MVS dataset over an SSH connection with addtional ssh options: (the dataset contains binary records which are prefixed with RDWs)