INVERSE

Synopsis

HELP:   Generate a XCNV command file (xcnv "out=thisfile") for inverse conversion [NONE]
TYPE:   STRING
SYNTAX: INVERSE='str'/STDOUT/STDERR

Description

With the INVERSE parameter you can generate an XCNV command file that inverts the operations executed by the specified CONV command.

For the inverse file, all rules and replacements are valid which are described under "FILENAME HANDLING" above. For example:

   INVERSE=STDERR                         ; is SYSOUT on z/OS
   INVERSE='~.MYINVERS(INVERS1)'          ; PDS on z/OS
   INVERSE='<SYSUID>.MYIVRS02'            ; PS dataset on z/OS
   INVERSE='~/myinvers3.txt'              ; Unix path name
   INVERSE='<HOME>\\usrtab\\myinvers4.txt'  ; Windows path name

This can be used, for example, if you need a solution to edit a file inside an archive and the file to be edited is in a format that is not supported by the system (e.g. an ASCII text file on an EBCDIC system). With the INVERSE parameter of the CONV command, you can extract the file from the archive, do necessary conversions and write it to a temporary file. After editing, you pass the generated XCNV command file to the XCNV command which reverses all operations performed by CONV, i.e. the text file is converted back to its original form and written back to the archive.

Below you can see an example of how it works:

   flcl conv read.file=<DSN> write.record(file=<TMP>) inverse=<IVR>
   edit(<TMP>)
   flcl xcnv=<IVR>

There are many other possibilities to use the INVERSE parameter. This sample is implemented in the FLEDIT line command for ISPF. This allows you to correct TEXT and XML files with the normal ISPF editor even though they may be encoded, compressed or in another codepage not supported by the editor.

The inverse command reverses what the call of CONV produces. This could be different from the original. For example, if you use

   read.auto() write.record()

on an XML file, then pretty printing is used to form the records. The inverse command converts back the pretty printed XML. The result would be the same XML document but with a different text formatting. If the file is a text file, write.record() replaces the delimiter with record length information. Since the original delimiter was lost, the inverse command adds the system delimiter. If the original file was delimited with 0x0D0A and you use the inversion feature on a non-Windows system, the original delimiter will be replaced by the correct delimiter for the current system and is then translated to the original character set. The same will happen if you read a base encoded file. This file can be in ASCII or EBCDIC at read, but it will be written in the system specific character set. This behavior ensures, that the written file is a correct base encoded file for this platform.

Selections