ACSV

Synopsis

HELP:   Auto-detect binary file and convert to CSV (copybook-free)
TYPE:   OBJECT
SYNTAX: > flcl ACSV(INPUT['str'/STREAM/DUMMY...],OUTPUT='str'/STREAM/DUMMY,FIOMODE=STOP/APPEND/OVERWRITE,APPEND,REMAIN,FALLOC(),EXCLUDE['str'...],REMOVE,RENAME='str',RECLEN=num,INPCCS='str'/DEFAULT/ASCII/EBCDIC/BOMUTF/BOMUCS/SYSTEM/LOCAL,OUTCCS='str'/DEFAULT/ASCII/EBCDIC/BOMUTF/BOMUCS/SYSTEM/LOCAL,STYLE(),ZIP(),DETECT(),ROWOUT='str'/STREAM/DUMMY,LOGGING.{},MESSAGE(),NORUN)

Description

The ACSV command converts binary record files to UTF-8 CSV format without requiring a copybook or schema file. The binary layout is inferred automatically by the ROWDET row-spec auto-detector (DETFIX for fixed-length binary records, DETCSV for delimited text, DETXML for XML).

The INPUT parameter accepts one or more binary data files. Wildcards and multiple values are supported.

The OUTPUT parameter specifies the path to the ZIP archive that receives the generated CSV members. The ZIP sub-object controls archive-level settings such as compression algorithm and member naming. The default member naming pattern is [name].[table].csv.

The DETECT sub-object accepts optional hints that narrow the search space for the auto-detector. All DETECT parameters are optional; omitting them enables full auto-detection across all type families.

FORMAT -- VB/IMS format hint: NONE=auto-detect (default), IMSL=IMS DFSURGU0 long, IMSS=IMS DFSURGU0 short, IHDU=IMS DFSURGL0 HD-unload, RDW=plain VB records. Use an explicit value when auto-detection is unreliable, e.g. IMSS (EOF sentinel rarely seen in first sample block). CHRSET -- Charset hint: AUTO (detect from byte distribution), EBCDIC, or ASCII. Default: AUTO. ENDIAN -- Byte-order hint for integer probing: BIG, LITTLE, or native (default). MAXREC -- Max records to analyse: DEFAULT(0)=8, FULL(1)=whole block, 2..n=exact count. Default: DEFAULT. MINREC -- Min records that must agree on layout to accept a row-spec. Default: 2. BCD -- BCD variant: ALL/NONE/ZONED/PACKED (bitmask). Default: ALL. FLOAT -- Float family: ALL/NONE/HFP/IEEE/DFP (bitmask). Default: ALL. INT -- Integer width: ALL/NONE/I16/I32/I64 (bitmask). Default: ALL. BASE -- Base-encoding: ALL/NONE/HEX/BASE32/BASE64 (bitmask). Default: ALL. FRADIG -- Fractional digits for BCD fields: 0=integer, N=type.float. Default: 0. ROWOUT -- Write detected TABLE string to this file (for flbcsv ROWIN=). DEFASC -- Default CCSID for ASCII string column emission [system default]. DEFEBC -- Default CCSID for EBCDIC string column emission [system default]. REUSE -- Reuse previously detected row-specs on format change [OFF]. NOMATCH -- Suppress Bootstrap-Discriminator MATCH predicates [FALSE]. NORANGE -- Suppress Bootstrap-Discriminator range checks on integers [FALSE]. REGEXP -- Emit character-class regexp constraints on strings (experimental) [FALSE]. MAXCOL -- Maximum columns per detected row-spec [1000]. MAXROW -- Maximum rows in REUSE accumulation table [16]. TARGET -- Restrict to sub-detector family: ALL/TEXT/CHAR/BINARY/XML/CSV/FIX. DISABLE -- Disable sub-detectors: NONE/CSV/FIX/XML or bitmask. Default: NONE. SETCHR -- Emit detected charset in format.str() specs [OFF].

INPCCS optionally sets the byte-stream charset conversion for the input data path (FIO layer). Omit for binary mixed data. OUTCCS overrides the CCSID for CSV output in the ZIP archive (default: UTF-8).

The STYLE sub-object controls CSV output formatting. FRASEP defaults to PERIOD (RFC 4180). STYLE.CCSID is overridden by top-level OUTCCS.

RECLEN overrides the record length when auto-detection yields wrong results. Use NORUN to inspect parsed parameters without processing data.

Auto-detection is best-effort and not guaranteed to reconstruct the original record layout. ROWDET can only place a column boundary where the data carries a distinguishing feature (type change, separator, constant filler, or a regular padding pattern). Adjacent fields of the same physical type with no boundary marker merge into one detected column -- for example several same-charset Zoned Decimal numbers become one wide number, or two PIC X fields become one wide string. Constant leading-zero or trailing-blank padding is exploited to separate padded fields, but only while the values stay narrower than the field width in every analysed record. For a guaranteed-correct structure, describe the records with a copybook or row-spec and convert with flbcsv (ROWIN=) instead of ACSV.

To get syntax information, please use:

   flcl SYNTAX ACSV

To get help for a parameter, please use:

   flcl HELP ACSV.parameter[.parameter[...]]

To read the manual page for a parameter, please use:

   flcl MANPAGE ACSV.parameter[.parameter[...]]

To generate the user manual for the command, please use:

   flcl GENDOCU ACSV=filename

Parameters can be set as arguments in the command line (directly or per file) or as properties taken from the corresponding property file.

Arguments