Co:Z Toolkit User's Guide

Name

fromdsn — write the contents of a z/OS dataset to stdout

Synopsis

fromdsn [OPTION...] dataset-name
fromdsn -sock [OPTION...] dataset-name
fromdsn -ssh [ssh-opt...] user@host [OPTION...] dataset-name
fromdsn -v
fromdsn -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: -ssh option

  • remotely, 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-name is 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 (see the -r option below). If dataset-name starts with 'DD:', then it refers to an existing DDNAME.

Options

-sock

Specifies 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@host

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.

-b

binary mode, same as -l none -p 0x00.

-h

display help and exit.

-k

keep trailing pad characters in record. The default is to trim if dataset-name has fixed length records.

-K

always trim trailing pad characters, even if the dataset contains variable-length records.

-l line-separator

nl | cr | lf | crlf | crnl

follow lines with a newline, carriage return, linefeed, or combination. The characters are taken from the target codepage. The default is nl.

ibmrdw

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.

mfrdw

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.

rdw

preceed 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.

none

no line separator

-L logging-options

A comma-separated list of options to control logging and tracing:

M | A | C | E | W | N | I | D | T

Logging threshhold: eMergency, Alert, Critical, Error, Warning, Notice, Info (default), Debug, Trace.

t

Prefix log messages with a system timestamp

e

Include consumed cpu time in log messages

s

Messages are logged to SYSLOG facility instead of stderr

logname=M|A|C|E|W|N|I|D|T

Set a specific log name to the given threshold

-o fopen-options

additional mode arguments to the z/OS C library fopen() routine. The base mode options used by fromdsn to open dataset-name are rb,type=record,noseek". See "z/OS C++ Programming Guide" for details.

-p 0xbb

pad character.

-r 0xbb

dataset-name will be prefixed with the current z/OS userid.

-s source-codepage

The codepage name or numeric CCSID id of the input dataset. If not specified, then the default z/OS process codepage is used.

-t target-codepage

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', '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.

-v

display the current version and exit.

-x bpxwdyn-alloc-keywords

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-name is '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/member1

Copies an MVS dataset (PDS member) to an HFS 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

Remote Client SSH Connection Examples

fromdsn -ssh user@myzos2.com //mvs1.input.dataset > /tmp/data

Downloads an MVS dataset over an SSH connection (Unix).

fromdsn -ssh user@myzos2.com //mvs1.input.dataset > c:ata.txt

Downloads an MVS dataset over an SSH connection (Windows).

fromdsn -ssh -p 2222 user@myzos2.com -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)

See Also

todsn(1)