Dovetailed Technologies


fromfile — write the contents of a z/OS POSIX file to stdout


fromfile [OPTION...] filename
fromfile -ssh [ssh-opt...] [user]@host [OPTION...] filename
fromfile -local filename
fromfile -v
fromfile -h


The fromfile command reads a z/OS POSIX file and writes a stream of data to stdout. The produced stream of bytes are translated and given target system line terminators (if requested).

The fromfile 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: -ssh option

filename is a path to the z/OS POSIX file to read. It may be either an absolute or relative path.


-ssh [ssh-options...] [user]@host

Specifies a remote invocation of fromfile 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. Bytes are streamed as-is from the POSIX file to stdout.


display help and exit.

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


follow lines with a hex character sequence. The sequence must be between 1 and 8 bytes long.


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 | F

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 filename on 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.

-q technique-str

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

-s source-codepage

The codepage name or numeric CCSID id of filename. 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, the default client codepage is used. Translation is disabled if source-codepage equals target-codepage.

-T STANDARD | translate_table_dsname

Specifies the translate table to use for text mode transfers. This option overrides the -s -t -q options 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.


Local z/OS Examples

fromfile -b /etc/profile > /home/user/profile

Copies a file "as-is" to another location.

fromfile -t ISO8859-1 myfile.txt > myfile_win.txt

Translates a file to the ISO8859-1 codepage from the default z/OS process codepage (e.g. IBM-1047).

Remote Client SSH Connection Examples

fromfile -ssh -b /home/user/data.bin > /tmp/data.bin

Downloads binary data from z/OS to a remote system over over an SSH connection. No translation is performed.

fromfile -ssh -t ISO8859-1 /etc/profile -l crlf > c:/mydir/profile.txt

Downloads a z/OS POSIX file over an SSH connection translating to a different code page and with Windows friendly line separators.

See Also


Copyright© 2009-2022 Dovetailed Technologies, LLC. All rights reserved.
Co:Z® is a registered trademark of Dovetailed Technologies, LLC.