AUTO

Synopsis

HELP:   Read binary, text or XML data record- or block-oriented
TYPE:   OBJECT
SYNTAX: AUTO(NET.{},FILE['str'/STREAM/DUMMY...],BLKSIZE=num,RECLENGTH=num,PRNCONTROL=DETACH/RETAIN/ERASE/REPLACE,RPLFFD[=num],CCSID='str'/DEFAULT/ASCII/EBCDIC/BOMUTF/BOMUCS/SYSTEM/LOCAL,CHRMODE=STOP/IGNORE/SUBSTITUTE/IDENTITY/TRANSLIT,SKIPEQUAL,USRTABLE='str'/NPAS/SEPA/DELA/DLAX,ONEMAP,COMBINED=NFD/NFC/AUTO/ON/OFF,BOM,KEEPBOM,ENL2LF,DECRYPT[{}...],REMOVE,LANG='str',PLATFORM=WIN/UNX/ZOS/USS/VSE/BS2/MAC,OWNER='str',ENVID='str',HASH(),SIGNATURE.{},CHECK,TABLE(),AVSCAN(),NOARCH,PREPROCESS[()...],POSTPROCESS/PSTPRO[()...])

Description

Read 'auto' attempts to identify the file format automatically and reads the file with the most appropriate parameters. Detection works on a best effort basis and should not be relied on.

For example, "read.auto() write.record()" can convert every supported file format to records on mainframe systems. This is utilized in the FLVIEW and FLVEDIT ISPF command.

With read.auto(), you can transparently read normal XML or text files with delimiters, encoded (BASE16/32/64), encrypted (FLAMFILE) or compressed (GZIP, BZIP2, XZ(LZMA)) files (even nested!), normal record-oriented data sets (FB(A/M)/VB(A/M)/VSAM/...), FLAMFILEs or binary data. If the data contains 4 byte length fields after I/O, decryption, decompression then a list of records is built to form one block. This allows you for example to read a file transparently from USS which was created with FILEDATA=RECORD and now allocated with FILEDATA=BINARY or a record length based format from a ZIP archive. The read.auto() function was mainly implemented to display (FLVIEW) the content of a file. The detection may fail on some files, especially for very small files.

Additionally, you can provide a list of row specifications through the table object. If the file matches a row specification, table formatting is used. If the data does not fit with the provided row specification, the normal auto processing is performed.

Generally: If you know the type of data (binary, char, text, xml, flam, charset/ccsid), it is recommended to use the corresponding read method and set the known parameters to prevent false detections. On the other side, if you know nothing about your data or you get data from different sources, read.auto() might be very helpful.

To simplify the use of the read.auto() function, the mechanisms below are implemented:

To read ASCII text files with NEL delimiter or to use specific formatting options, please use read.text(). To keep and manage record attributes, please use read.record(). The read.auto() function is designed to be very powerful, using the procedures suited best and, at the same time, to keep it as simple as possible.

Arguments