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)
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.
STRING: INPUT['str'/STREAM/DUMMY...] - Path(s) to the input file(s). Multi-value; wildcards allowed [stdin]
STREAM - Read from stdin or write to stdoutDUMMY - Read EOF or write nothingSTRING: OUTPUT='str'/STREAM/DUMMY - Path to the ZIP output archive. Each row-spec produces one CSV member [stdout]
STREAM - Read from stdin or write to stdoutDUMMY - Read EOF or write nothingNUMBER: FIOMODE=STOP/APPEND/OVERWRITE - Error handling if the ZIP output file already exists [APPEND]
STOP - Stop processing with an errorAPPEND - Add the new data to the existing file or memberOVERWRITE - Overwrite the existing file or memberSWITCH: APPEND - Append members to an existing ZIP archive [FALSE]SWITCH: REMAIN - Preserve existing ZIP members (don't overwrite on member-name collision) [FALSE]STRING: EXCLUDE['str'...] - Exclude files matching this pattern from the INPUT file list; multi-value [none]SWITCH: REMOVE - Delete each INPUT file after successful processing [FALSE]STRING: RENAME='str' - Rename pattern applied to INPUT files after successful processingNUMBER: RECLEN=num - Fixed record length override; 0 = auto-derived from ROWDET result [0]STRING: INPCCS='str'/DEFAULT/ASCII/EBCDIC/BOMUTF/BOMUCS/SYSTEM/LOCAL - Input CCSID: FIO byte-stream conversion before detection; omit for binary data [none]
DEFAULT - Use default CCSID (auto-detect)ASCII - Use default ASCII CCSID (environment)EBCDIC - Use default EBCDIC CCSID (environment)BOMUTF - Determine the correct UTF CCSID from byte order mark (BOM) only when readingBOMUCS - Determine the correct UCS CCSID from byte order mark (BOM)only when readingSYSTEM - Use system character set (environment/logical)LOCAL - Use local character set (auto-detect + system/physical)STRING: OUTCCS='str'/DEFAULT/ASCII/EBCDIC/BOMUTF/BOMUCS/SYSTEM/LOCAL - Output CCSID for CSV ZIP members; overrides STYLE.CCSID [UTF-8]
DEFAULT - Use default CCSID (auto-detect)ASCII - Use default ASCII CCSID (environment)EBCDIC - Use default EBCDIC CCSID (environment)BOMUTF - Determine the correct UTF CCSID from byte order mark (BOM) only when readingBOMUCS - Determine the correct UCS CCSID from byte order mark (BOM)only when readingSYSTEM - Use system character set (environment/logical)LOCAL - Use local character set (auto-detect + system/physical)STRING: ROWOUT='str'/STREAM/DUMMY - Write detected TABLE string to this file for use with flbcsv ROWIN
STREAM - Read from stdin or write to stdoutDUMMY - Read EOF or write nothingSWITCH: NORUN - Parse and show parameters without executing the command [FALSE]