Use this command to convert the contents of a file to a specified format
and display the contents or copy the contents to another file.
Requirements and Restrictions
- The parameters for this command are case-sensitive. You
must enter the parameters exactly as shown in the syntax
diagram.
- You can enter this command only in CRAS state or higher.
Format
- if=inpath
- specifies the input file, where inpath is the path name of the
file you are converting. If you do not specify this parameter, the
input file is read from the standard input (stdin) stream.
- of=outpath
- specifies the output file, where outpath is the path name of the
file in which you want to store the data. If you do not specify this
parameter, the data is written to the standard output (stdout)
stream.
- conv
- specifies the type of conversion, where:
- ascii
- converts the data from EBCDIC to ASCII.
- ebcdic
- converts the data from ASCII to EBCDIC.
- lcase
- converts the data to lowercase.
- ucase
- converts the data to uppercase.
Additional Information
- Online help information is available for this command. To display
the help information, enter one of the following:
ZFILE HELP dd
ZFILE HELP
ZFILE ?
In addition, the correct command syntax is displayed if you enter the syntax
incorrectly.
- On completion, the ZFILE dd command writes the number of input and output
blocks to the standard error (stderr) stream, in the following
format:
w.x records in
y.z records out
n bytes transferred in s secs (m bytes/sec)
Where:
- w
- is the number of whole input blocks.
- x
- is the number of partial input blocks. A partial input block is one
that contains fewer bytes than specified by the input block size.
- y
- is the number of whole output blocks.
- z
- is the number of partial output blocks. A partial output block is
one that was written with fewer bytes than specified by the output block
size.
- n
- is the number of bytes processed.
- s
- is the number of seconds.
- m
- is the number of bytes processed per second.
See Examples for an example of this diagnostic message.
- You can redirect the standard input (stdin) stream from the
keyboard to a file by specifying the redirection character (<)
followed by the file name from which you want the input read.
You can redirect the standard output (stdout) stream from the
display terminal to a file by specifying one of the redirection characters
(> or >>) followed by the file name to which you want
the output written. The > character writes the output to a
file. The >> character appends the output to an existing
file.
You can redirect the standard error (stderr) stream from the
display terminal to a file by specifying one of the redirection characters
(2> or 2>>) followed by the file name to which you want
the error output written. The 2> character writes the error
output to a file. The 2>> character appends the error output
to an existing file.
- Note:
- When you use the > or 2> character, if the file that
you are redirecting data to already exists, the file is overwritten and any
data in that file is lost. If you do not want to overwrite the file,
ensure that you use the >> or 2>> character.
- The ZFILE dd command is based on a subset of the dd utility of the
Portable Operating System Interface for Computer Environments (POSIX)
standards.
- This command supports the following three quoting mechanisms, which allow
you to override the special meaning of some characters:
- escape character (\)
- preserves the literal value of the character that follows. To
ignore the special meaning of a character, escape it by placing a backslash
(\) in front of it. In the example that follows, environment
variable PATH is /bin:/usr/bin:., the first
dollar sign ($) is escaped because of the preceding backslash, and the
second dollar sign takes on a special meaning.
User: ZFILE echo \$PATH is $PATH
System: $PATH is /bin:/usr/bin:.
- single quotation marks (' ')
- preserves the literal value of all characters between the opening single
quotation mark and the closing single quotation mark. For example,
entering ZFILE echo '*' displays an asterisk
character (*). Without the single quotation marks, the files
in the current working directory are displayed.
- double quotation marks (" ")
- preserves the literal value of all characters between the opening double
quotation mark and the closing double quotation mark except the dollar sign
($), the backquote (`), and the backslash (\).
This allows you to use the escape character inside double quotation marks,
which you cannot do in single quotation marks.
For example, entering ZFILE echo "\$PATH is \"$PATH\""
displays $PATH is "/bin:/usr/bin:."
If you want to use the literal meaning of any of the following
characters, you must always use a quoting mechanism:
left angle bracket (<)
| right angle bracket (>)
| ampersand (&)
|
backquote (`)
| backslash (\)
| dollar sign ($)
|
double quotation mark (")
| new-line (\n)
| left parenthesis ( ( )
|
right parenthesis ( ) )
| semicolon (;)
| single quotation mark (')
|
blank space
| tab
| vertical bar (|)
|
In addition, use a quoting mechanism when any of the following characters are
used in a way that takes on a special meaning but you want to use the literal
meaning:
asterisk (*)
| equal sign (=)
| left square bracket ( [ )
|
number sign (#)
| question mark (?)
| tilde (~)
|
Examples
In the following example, the contents of file
/etc/hello.txt are converted to uppercase and displayed on a
CRAS terminal. In addition, the number of bytes processed are written
to the standard error (stderr) stream.
+---------------------------------------------------------------------------------------------+
|User: ZFILE dd if=/etc/hello.txt conv=ucase |
| |
|System: FILE0001I 11:41:45 START OF DISPLAY FROM dd if=/etc/hello.txt conv=ucase |
| HELLO |
| END OF DISPLAY |
| FILE0002I 11.41.45 START OF ERROR DISPLAY FROM dd if=/etc/hello.txt conv=ucase |
| 0.1 records in |
| 0.1 records out |
| 6 bytes transferred in 1 secs (6 bytes/sec) |
| END OF DISPLAY |
+---------------------------------------------------------------------------------------------+
Related Information
See Information Technology--Portable Operating System Interface
for Computer Environments (POSIX) for more information about the POSIX
standards.