Multiple File Join command

HULFT can join multiple files together and create one file. It is also possible to add data to existing joined files or to the joined files created by HULFT that runs on other host.

Program interface

CALL Library name/UTLJOIN PARM(['LIB=Library name'] 'INFILE=filename' 
   'FILETYPE={B|T|F|M}' ['formatid|multiformatid'] 'OUTFILE=filename' 
   'MODE={N|R|M}' ['G'] ['OUTPUT=filename'] ['EXIT' CL variable name])

Explanation of parameters

LIB=Library name

Library name in which HULFT is installed ("HULFT" by default)

Specify this parameter as an alphanumeric character string of 10 bytes or less starting with an alphabet.

INFILE=filename

Input file name (Mandatory)

Specify this parameter in the format of Library name/File name(Member name).

Using an asterisk (*) in Member name allows you to specify prefix or suffix matches.

FILETYPE=B|T|F|M

File Type (Mandatory)

B :

Binary transfer

T :

Text

F :

Format

M :

Multi Format

formatid|multiformatid

Specifies the format ID of the Format Information record or the multi format ID of the Multi Format Information record. (Optional)

Specify a string of alphanumeric characters (and "_" if desired) that is within 50 bytes.

You must specify this parameter, when the File Type is set to "F" or "M".

OUTFILE=filename

Output file name (joined file name) (Mandatory)

Specify this parameter in the format of Library name/File name(Member name).

MODE=N|R|M

Creation mode of joined file (Mandatory)

N (New Creation) :

Give an error, if the specified file already exists.

R (Replace) :

Replace existing file with the joined file If the specified file already exists, while create a new file If the specified file does not exist.

M (Append) :

Append data to the existing file if the specified file already exists, while create a new file if the specified file does not exist.

When you specify "M" (Append) for this parameter, an error occurs if the existing file is not a joined file.

G

Control of error messages that the Multiple File Join command outputs (Optional)

When omitted, HULFT displays error messages.

OUTPUT=filename

Destination of the error messages that the Multiple File Join command outputs (Optional)

Specify this parameter in the format of Library name/File name(Member name).

When omitted, error messages are not output.

The number of log records that a log file can retain is unlimited.

EXIT CL variable name

Specifies to receive the error code output by the Multiple File Join command and specifies the CL variable name to set the error code value (Optional)

The CL variable name must immediately follow the EXIT tag.

HULFT sets an error code to the CL variable only if the command ends unsuccessfully.

When omitted, an error code is not set.

Note

Refer to the following for the detail of record size limit in each file type when specifying "INFILE=filename" and for the file size limit when specifying "FILETYPE=B|T|F|M", respectively:

HULFT10 for IBMi Administration Manual : Send and Receive Files

= Remarks =

You can repeat the specification of "INFILE=filename", "FILETYPE=B|T|F|M", and formatid|multiformatid' 10 times at maximum. For details on how to specify the fields, refer to Description example.

Command interface

UTLJOIN INFINFO((file library member type formatid|multiformatid)) 
   JOINFILE( ) JOINMBR( ) MAKEMODE( ) LIBRARY( ) MSG( ) FILE( ) MBR( )

Explanation of parameters

INFINFO

Information of the input file (Mandatory)

file

Specify the name of the input file.

Specify this parameter as an alphanumeric character string of 10 bytes or less starting with an alphabet.

library

Specify the library name of the input file.

Specify this parameter as an alphanumeric character string of 10 bytes or less starting with an alphabet.

member

Specify the member name of the input file.

Specify this parameter as an alphanumeric character string of 10 bytes or less starting with an alphabet.

Using an asterisk (*) in member name allows you to specify prefix or suffix matches.

type

File Type

BIN :

Binary transfer

TXT :

Text

FMT :

Format

MFMT :

Multi Format

formatid|multiformatid

Specifies the format ID of the Format Information or the multi format ID of the Multi Format Information record.

Specify a string of alphanumeric characters (and "_" if desired) that is within 50 bytes.

You must specify this parameter, when the File Type is set to "FMT" or "MFMT".

JOINFILE

Library name and file name of the output file (joined file) (Mandatory)

Specify this parameter in the format of Library name/File name.

Specify these names as an alphanumeric character string of 10 bytes or less starting with an alphabet, respectively.

JOINMBR

Member name of the output file (joined file) ("*FILE" by default)

Specify this parameter as an alphanumeric character string of 10 bytes or less starting with an alphabet.

MAKEMODE

Creation mode of joined file

NEW (New Creation) :

Give an error, if the specified file already exists.

REP (Replace) :

Replace existing file with the joined file If the specified file already exists, while create a new file If the specified file does not exist.

MOD (Append) :

Append data to the existing file if the specified file already exists, while create a new file if the specified file does not exist.

LIBRARY

Library name in which HULFT is installed ("HULFT" by default)

Specify this parameter as an alphanumeric character string of 10 bytes or less starting with an alphabet.

MSG

Control of error messages ("*YES" by default)

*NO :

Suppress error messages.

*YES :

Show error messages.

FILE

Name of the library and the file to which error messages are output (Optional)

Specify this parameter in the format of Library name/File name.

Specify these names as an alphanumeric character string of 10 bytes or less starting with an alphabet, respectively.

When omitted, error messages are not output. The number of log records that a log file can retain is unlimited.

MBR

Member name of the file to which error messages are output ("*FILE" by default)

Specify this parameter as an alphanumeric character string of 10 bytes or less starting with an alphabet.

= Remarks =

You can repeat the specification of (file library member type formatid|multiformatid) within "INFINFO" 10 times at maximum. However, an archive file cannot be specified as an input file.

Description example

  • Merge the files "MYLIB/JOIN1(TEST01)" and "MYLIB/JOIN1(TEST02)" specifying "FORMAT01" and "FORMAT02" as the format IDs, respectively, and create a new file named "MYLIB/OUT1(TEST)".

    CALL HULFT/UTLJOIN PARM('INFILE=MYLIB/JOIN1(TEST01)' 'FILETYPE=F' 'FORMAT01' 
        'INFILE=MYLIB/JOIN1(TEST02)' 'FILETYPE=F' 'FORMAT02' 'MODE=N' 
        'OUTFILE=MYLIB/OUT1(TEST)')

  • Merge all members in "MYLIB/JOIN2" whose name starts with "TEST" specifying "Text" as the file type, and create a new file named "MYLIB/OUT2(TEST)" in Replace mode.

    CALL HULFT/UTLJOIN PARM('INFILE=MYLIB/JOIN2(TEST*)' 'FILETYPE=T' 'MODE=R' 
        'OUTFILE=MYLIB/OUT2(TEST)')

  • Merge into "MFORMAT1" records of the Multi Format Information that correspond to members in "MYLIB/JOIN3" whose name starts with "T", and create a new file named "MYLIB/OUT3 (TEST)" in Append mode.

    CALL HULFT/UTLJOIN PARM('INFILE=MYLIB/JOIN3(T*)' 'FILETYPE=M' 'MFORMAT1' 
        'MODE=M' 'OUTFILE=MYLIB/OUT3(TEST)')

Notes

"D" (EBCDIC ASPEN) and "G" (NEC Katakana) of the EBCDIC Set (CHARTYPE) are not recommended. If you join files that use "D" (EBCDIC ASPEN) and "G" (NEC Katakana), these files may not split when future versions are used.