Top
PowerBSORT V7.0 User's Guide
FUJITSU Software

4.2.5 Input file information option (-input)

This specifies the input file information option.

In the standard input, omit inputting file operand and filesys operand.

Format

-input reclen=record-length
       [ file=file-name [ ,file-name ...] [ file= ...]
           [ filesys=file-system [ /owner-name [ ,owner-name ...] ] ] ]
       [ { include=condition-expression [ ,condition-expression ] [ include= ...]
           | omit=condition-expression [ ,condition-expression ] [ omit= ...] } ]
       [ reconst=reconst-definition [ ,reconst-definition ...] [ reconst= ...] ]
       [ eof= { effect | ignore } ]
       [ overwrite ]

4.2.5.1 reclen operand

This specifies the record length or the maximum record length of the input record.

Format

reclen=record-length

record-length

This specifies the record length in byte.
For binary files, the record length is specified when the record format is a fixed-length record form. When the record format is a variable-length record form, the maximum record length is specified. For text files, the maximum record length including the line feed code is specified.

Note

In the binary file (variable-length record form) and the text file, if the record length specified by recsize is longer than the actual maximum record length, it is possible to process. However, when the record length that is longer than the actual maximum record length is specified by recsize, it becomes the factor of the performance deterioration according to the difference between a specified record length and the actual maximum record length.

4.2.5.2 file operand

This specifies the input file.
Two or more input files can be specified by delimiting them with comma (,). However, two or more input files with a different file system cannot be specified. When two or more input files are specified, the record is input from the head of the file in the sort option and the copy option in specification the order. In the merge option, order by which the record is read depends on the value of the key field of each record.

Format

file=file-name

file-name

This specifies input file path names.

Note

  • When you specify the file path names that are operand arguments and contain any blanks, enclose the entire file-name with double quotation marks (").

  • When you specify the file path names that are operand arguments and contain comma (,), enclose the entire file-name with quotation marks ('), and in addition to that, enclose it with double quotation marks (").

  • When you specify the file path names that are operand arguments and contain quotation marks ('), specify it with the successive 2 quotations marks ('), and enclose the entire file-name with double quotation marks (").

Example

  1. The example of specifying two or more input files is shown below.

    file=sortin1,sortin2
  2. The example of specifying the file path name that contains blank is shown below.

    file="sortin 01"
  3. The example of specifying the file path name that contains comma (,) is shown below.

    file="'sortin,01'"
  4. The example of specifying the file path name that contains quotation marks (') is shown below.

    file="sortin''01"

4.2.5.3 filesys operand

This specifies file system of input files specified in file operand.

Format

filesys=file-system [ /owner-name [ ,owner-name ...] ]

file-system

This specifies the file system of input files.
Specify a file system in an identifier. The file systems that can be specified are shown below.

Identifier

Description of file systems

dos

Native file system of the system (Default)

cobseq

NetCOBOL file system (sequential file)

cobs64

NetCOBOL file system (BSAM-compatible sequential file)

cobrel

NetCOBOL file system (relative file)

cobidx

NetCOBOL file system (indexed file)

mfcseq

Micro Focus COBOL file system (sequential file)

mfcrel

Micro Focus COBOL file system (relative file)

mfcidx

Micro Focus COBOL file system (indexed file)

btrv

Btrieve file system

Note

  • PowerBSORT cannot access files opened by the NetCOBOL file system in exclusive mode. In addition, if the NetCOBOL file system (indexed file) is specified, PowerBSORT cannot access files opened by the NetCOBOL file system in shared mode. For more details on shared mode and exclusive mode, refer to the documentation of your NetCOBOL file system.

  • Even if the NetCOBOL file system (BSAM-compatible sequential file) is specified, if your NetCOBOL file system is not compatible, files are handled as NetCOBOL file system (sequential file). For details on BSAM compatibility, refer to the documentation of your NetCOBOL file system.

  • If the NetCOBOL file system (BSAM-compatible sequential file) is specified, record exclusivity may not be maintained, depending on the NetCOBOL file system.

  • Btrieve file system (btrv) and Micro Focus COBOL index file system (mfcidx) can be specified only for the file system (ifs) of the input file.

  • A Micro Focus COBOL index file in which data is compressed cannot be specified for the input file.

owner-name

When the Btrieve file needs the specification, specify owner names with up to 8 characters or less for owner-name.
Also, two or more owner names can be specified by delimiting the names with comma (,) in the specified order of the input files. When the number of input files is more than the number of owner names, the owner names for the remaining input files are considered to be omitted. When the number of input files is less than the number of owner names, the owner names excessively specified are ignored. In the owner names, the uppercase letters and lowercase letters are distinguished.

Example

  1. The example of specifying NetCOBOL file system (BSAM-compatible sequential file) for the file system of the input file is shown below.

    filesys=cobs64
  2. When you specify owner1 for the owner name of the first input file and owner2 for the owner name of the second input file, specify as follows.

    filesys=btrv/owner1,owner2
  3. When there are 2 input files and when you specify owner2 for the owner name of the second input file, specify as follows.

    filesys=btrv/,owner2

4.2.5.4 include operand

To use the record selection option for the input file, specify the selection field (selection condition).
The records that meet the condition are to be processed. The include operand is in the exclusive relationship with omit operand.

Format

include=condition-expression

condition-expression

This specifies the selection field (selection condition).
When you specify two or more condition-expression delimiting with comma (,), it creates the logical product of the selection condition. When two or more include operands are specified, they create the logical sum of the selection condition.

and

This shows the logical product of the selection conditions.
It is equal to the values specified by delimiting two or more conditions with comma (,).

or

This shows the logical sum of the selection conditions.
It is equal to the case that two ore more include operands are specified.

condition-definition

One selection field (selection condition) is specified.

pos

This specifies the position of the compared field or the comparing field.
To specify the binary files and text file fixed fields, specify the byte position where the head of the record was assumed to be 0. For the text file floating field, text file CSV format, and text file TSV format, specify the field number counted from 0.

len

This specifies the length of the compared field or the comparing field in the number of byte.
For the text file floating field specification, text file CSV format, and text file TSV format, process with the length specified here when the actual fields are longer than the specified field length. When the actual fields are shorter than the specified field length, the actual field length is processed.
To specify an unsigned binary number for the data format, specify mask values. Compare the logical product of the mask value and field values. The mask value specifies the same value as the compared field and the comparing field.
For information about the lengths of each data format, refer to the Data formats that can be specified in the compared field and the comparing field.

Note

In text file CSV format and text file TSV format specification, the length of the compared field or the comparing field does not contain double quotation marks (") that enclose the field. When two consecutive double quotation marks ("") are included in the field, they are interpreted as one double quotation mark (").

Example: Compared field and length in text file CSV format
Compared field    Characters effective as compared field    Length of compared field
ABC               ABC                                       3bytes
"ABC"             ABC                                       3bytes
"A""B""C"         A"B"C                                     5bytes
"A,B,C"           A,B,C                                     5bytes

typ

This specifies the data formats of the compared field and the comparing field.
For more information, refer to the Data formats that can be specified in the compared field and the comparing field.

Note

  • When the data format of the compared field and comparing field are different, it compares the data after adjusting them to the data format of the compared field.

  • When the data format of the compared field is character, it compares data in the shorter length of the compared field and comparing field.

  • When the data format of the compared field is numeric or number, the shorter field of the compared field and comparing field are compared with the longer one after moving to the right end.

  • In the binary file processing, when input file code system (icode operand) is excluding EBCDIC, ASCII code can be specified.

  • In the text file processing, when input file code system (icode operand) is ASCII, ASCII code can be specified.

  • When the input file code system (icode operand) is EBCDIC, EBCDIC code can be specified.

  • When the input file code system (icode operand) is ASCII, Shift JIS code can be specified.

  • In the binary file processing, when input file code system (icode operand) is excluding EBCDIC, Unicode (UCS-2 form) can be specified.

  • In the text file processing, when input file code system (icode operand) is Unicode (UCS-2 form), Unicode (UCS-2 form) can be specified.

  • In the binary file processing, when input file code system (icode operand) is excluding EBCDIC, Unicode (UTF-32 form) can be specified.

  • In the text file processing, when input file code system (icode operand) is Unicode (UTF-32 form), Unicode (UTF-32 form) can be specified.

  • In the binary file processing, when input file code system (icode operand) is excluding EBCDIC, Unicode (UTF-8 form) can be specified.

  • In the text file processing, when input file code system (icode operand) is Unicode (UTF-8 form), Unicode (UTF-8 form) can be specified.

opt

This specifies the operations of the compared field.
To specify two or more operations, describe them successively. The operations that can be specified are shown below. Others than "w" can be specified only when the text file is processed.

opt

Meaning

b

Blanks and tabs in the head of the field are disregarded.

d

Only the blank and the alphanumeric character are compared.

i

Control character codes are disregarded.

j

Lowercase letters are compared as uppercase letters.

n

Character strings of the numbers that contain signs are compared with arithmetic values. The result is not guaranteed when characters other than the numbers exist in the character string. When the data format is ASCII code or Unicode, it can be specified. It is in the exclusive relationship with "w".

w

Even if there are consecutive multi-byte characters, each character is compared. Only when the data format is ASCII code, Shift JIS code or Unicode and the input file code system (icode operand) is ASCII or Unicode, can this option be specified. It is in the exclusive relationship with "n".

Note

  • If modify collation sequence is specified as the data format of the compared field or comparing field, field operations cannot be specified in opt.

  • If character form two digit years, external decimal form two digit years, packed decimal form two digit years or decimal form two digit years is specified as the data format of the compared field or the comparing field, opt is ignored.

self-def

This specifies the literal values. The description form of self-def is shown below.

Note

  • To specify character strings of a literal value in operand argument, enclose the entire operand argument with double quotation marks (").

  • To specify character strings of a literal value that contains double quotation marks (") in operand argument, specify backslash (\) before the double quotation marks (").

  • To specify character strings of a literal value that contains quotation marks (') in operand argument, specify successive 2 quotation marks (').

  • When the character string of a literal value is specified, the character string should be one character or more.

  • When the data form is Unicode UTF-32 form, the character string of a literal value can specify only the character within the range of ASCII code.

  • When you specify a decimal number of a literal value, signs can be specified.

  • Literal value is compared after adjusting to the data format of the compared field.

  • When you specify a text file fixed field, literal values cannot contain record separation character.

  • When you specify a text file floating field, literal values cannot contain field separation character or record separation character.

  • For text file CSV format and text file TSV format, double quotation marks (") do not need to enclose literal values.

  • When specifying literal value of fixed-point binary numbers, unsigned fixed-point binary numbers, fixed-point binary numbers - little endian, unsigned fixed-point binary numbers - little endian, fixed-point binary numbers - system dependent, and unsigned fixed-point binary numbers - system dependent as decimal numbers, a literal value can specify even the value expressible by 16 bytes.

cmp

This specifies the comparison operator.
The following shows comparison operators and their meanings.

cmp

Meaning(True condition)

eq

Compared field = Comparing field or literal value

ne

Compared field != Comparing field or literal value

gt

Compared field > Comparing field or literal value

ge

Compared field >= Comparing field or literal value

lt

Compared field < Comparing field or literal value

le

Compared field <= Comparing field or literal value

RECNUM

This specifies the selection in the number of records.
For the description format 3 of condition-definition, specify the fixed string 'RECNUM'.

num

This specifies the number of records.
For input, specify the top record of the input file as the first record. When two or more input files are specified, select the top record of each file as the first record. For output, specify the first record after summation or suppression as the first record.

Example

  1. To select records that the field of packed decimal number in 4 bytes from the 32nd byte and the field of the external decimal number in 4 bytes from the 12th byte are equal, specify as follows.

    include=11.4zdl.eq.31.4pdl
  2. To select records that have more than 30 fields of the fixed-point binary number in 4 bytes from the 12th byte, specify as follows.

    include=11.4fbi.ge.d30
  3. To select records that have less than -1000 fields of the external decimal number in 4 bytes from the 10th byte, specify as follows.

    include=9.4zdl.eq.d-1000
  4. When the first 50 records from the head of the file are to be processed, specify as follows.

    include=RECNUM.le.50
  5. To select the record in which the character string 'abcde' exists in the field of ASCII code in 5 bytes from the 10th byte, specify as follows.

    include="9.5asc.eq.'abcde'"
  6. To select the record in which the character string 'ab"cd' exists in the field of ASCII code in 5 bytes from the 10th byte, specify as follows.

    include="9.5asc.eq.'ab\"cd'"
  7. To select the record in which the character string 'abc'd' exists in the field of ASCII code in 5 bytes from the 10th byte, specify as follows.

    include="9.5asc.eq.'abc''d'"
  8. To select the record in which the character string 'abc' exists in the field of ASCII code in 3 bytes from the 4th byte and character string 'abc' in the field of ASCII code in 3 bytes from the 10th byte, the record in which the character strings 'abcd' in the field of ASCII code in 5 bytes from 4th byte, specify as follows.

    include="3.3asc.eq.'abc'.and.9.3asc.eq.'abc'.or.3.5asc.eq.'abcde'"

4.2.5.5 omit operand

To use the record selection option for the input file, specify the selection field (selection condition).
This excludes the records that meet the condition from the object of processing. The omit operand is in the exclusive relationship with include operand.

Format

omit=condition-expression

condition-expression

This specifies the selection field (selection condition).
For information about the condition-expression, refer to include operand of input file information option (-input).

4.2.5.6 reconst operand

To use the record reconstruction option for the input file, specify the reconstruction field.
The field specified for the reconstruction field is output from right after the left of the output record sequentially. When you specified the record reconstruction option for the input file, the field position after the reconstruction of the input field in the key field, summation field, selection field of the output and reconstruction field of the output are specified.

Format

reconst=reconst-definition

reconst-definition

This specifies the reconstruction field.
Two or more reconst-definition can be specified by delimiting the data by comma (,).

pos

This specifies positions of the reconstruction field.
To specify the binary files and text file fixed fields, specify the byte position where the head of the record was assumed to be 0. For the specification of the text file floating field, text file CSV format, and text file TSV format, specify the field number counted from 0.

len

This specifies a length of the reconstruction field in the number of bytes.
For the text file floating field specification, text file CSV format, and text file TSV format, process with the length specified here when the actual fields are longer than the specified field length. When the actual fields are shorter than the specified field length, the actual field length is processed.
In the specification of description format 1, the length is not limited. For the information about each data format that can be specified in the description format 2, refer to Data formats that can be specified in the literal value of the reconstruction field.

Note

In the text file CSV format and text file TSV format specification, the length of the reconstruction field does not contain double quotation marks ("). When two consecutive double quotation marks ("") are included in the field, they are interpreted as one double quotation mark (").

Example: Reconstruction field and length in text file CSV format. 
Reconstruction field    Characters effective as    Length of reconstruction field
                        reconstruction field
ABC                     ABC                        3bytes
"ABC"                   ABC                        3bytes
"A""B""C"               A"B"C                      5byte
"A,B,C"                 A,B,C                      5byte

self-def

This specifies literal values. The description form of self-def is shown below.

Note

  • To specify character strings of a literal value in operand argument, enclose the entire option argument with double quotation marks (").

  • To specify character strings of a literal value that contains double quotation marks (") in operand argument, specify backslash (\) before the double quotation marks (").

  • To specify character strings of a literal value that contains quotation marks (') in operand argument, specify successive 2 quotation marks (').

  • When the character string of a literal value is specified, the character string should be one character or more.

  • When the data form is Unicode UTF-32 form, the character string of a literal value can specify only the character within the range of ASCII code.

  • When you specify a decimal number of a literal value, signs can be specified.

  • When you specify a text file fixed field, literal values cannot contain record separation character.

  • When you specify a text file floating field, literal values cannot contain field separation character or record separation character.

  • Output text file CSV format and text file TSV format with literal values enclosed in double quotation marks (") when the literal values contains the field separation character, the record separation character (Note) or double quotation marks ("). In this case, a literal value double quotation mark (") is output when two double quotation marks (") are consecutive.

    Note: Enclose literal values with double quotation marks (") when it is included by not only the record separator of the input file but also one of CRLF, CR, and LF permitted as a record separator.
    Example: The data output to the reconstruction field when literal values contain the field separation character (comma) or the double quotation marks (") is as follows:
    Specification of literal values    Data output to reconstruction field
    FIELD"2"                           "FIELD""2"""
    FIELD2,3                           "FIELD2,3"
    FIELD"2",3                         "FIELD""2"",3"
  • When a value specified with a literal value and the length specified with len are different, process them as shown below.

    • When the literal value is character strings, the literal value is specified to start at the left and any blank spaces to the right is filled with the appropriate number of spaces if the length of the character strings specified in the literal value is shorter than the length specified in len. If the length of the character strings specified in the literal value is longer than the length specified in len, it is an error.

    • If the literal value is number, convert the value specified in the literal value into the data format and the length specified in typ and len, and embed them. If the conversion result is more than len, it is an error.

  • When specifying literal value of fixed-point binary numbers, unsigned fixed-point binary numbers, fixed-point binary numbers - little endian, unsigned fixed-point binary numbers - little endian, fixed-point binary numbers - system dependent, and unsigned fixed-point binary numbers - system dependent as decimal numbers, a literal value can specify even the value expressible by the length specified with len.

    Example

    Length

    Signed Data Format

    Unsigned Data Format

    1 byte

    -128 - 127

    0 - 255

    2 byte

    -32768 - 32767

    0 - 65535

    3 byte

    -8388608 - 8388607

    0 - 16777215

    4 byte

    -2147483648 - 2147483647

    0 - 4294967295

    :

    :

    :

typ

This specifies the data format of literal values.
For the information about each data format that can be specified, refer to Data formats that can be specified in the literal value of the reconstruction field.

Note

  • In the binary file processing, when input file code system (icode operand) is excluding EBCDIC, ASCII code can be specified.

  • In the text file processing, when input file code system (icode operand) is ASCII, ASCII code can be specified.

  • When the input file code system (icode operand) is EBCDIC, EBCDIC code can be specified.

  • When the input file code system (icode operand) is ASCII, Shift JIS code can be specified.

  • In the binary file processing, when input file code system (icode operand) is excluding EBCDIC, Unicode (UCS-2 form) can be specified.

  • In the text file processing, when input file code system (icode operand) is Unicode (UCS-2 form), Unicode (UCS-2 form) can be specified.

  • In the binary file processing, when input file code system (icode operand) is excluding EBCDIC, Unicode (UTF-32 form) can be specified.

  • In the text file processing, when input file code system (icode operand) is Unicode (UTF-32 form), Unicode (UTF-32 form) can be specified.

  • In the binary file processing, when input file code system (icode operand) is excluding EBCDIC, Unicode (UTF-8 form) can be specified.

  • In the text file processing, when input file code system (icode operand) is Unicode (UTF-8 form), Unicode (UTF-8 form) can be specified.

END

Specify the fixed string 'END' at format 3 of reconst-definition.

EMPTY

Specify the fixed string 'EMPTY' at format 4 of reconst-definition.

opt

This specifies the operation of the reconstruction field.
It can be specified in text file CSV format or text file TSV format, at format 2 of reconst-definition or format 4 of reconst-definition. When this specification is omitted, it operates assuming that L is specified.

opt

Meaning

A

Enclose the reconstruction field with double quotation marks (").

L

Do not enclose the reconstruction field with double quotation marks (").
However, enclose it with double quotation marks (") when a field separation character, a record separation character (Note) or double quotation marks (") is included in the reconstruction field.

NOTE

Enclose literal values with double quotation marks (") when it is included by not only the record separator of the input file but also one of CRLF, CR, and LF permitted as a record separator.

Information

  • In text file CSV format and text file TSV format, when format 1 of reconst-definition or format 3 of reconst-definition is specified, enclosing the reconstruction field with double quotation marks (") depends on the condition. When the field on the input record is enclosed with double quotation marks ("), the field after the record is reconstructed is enclosed with double quotation marks (").

    Example: Specify "reconst=1.3,2.2" for the reconstruction field.
    Input record                 Output record
    "001","ABC",60               "ABC",60
    "002","ABCDE",50             "ABC",50
    "003","AB,CDE",40            "AB,",40
    "004","AB"CDE,30 (Note)      "AB"C,30
    
    NOTE
    "AB" is enclosed by double quotation marks (") in the second field and "CDE" continues afterwards.

Example

  1. To reconstruct a 10 byte field from the 5th byte of the input record, specify as follows.

    reconst=4.10
  2. To specify the character strings of literal value (abc), specify as follows.

    reconst="'abc'.3asc"
  3. To specify the character strings of literal value (ab"cd) that contain double quotation mark ("), specify as follows.

    reconst="'ab\"cd'.5asc"
  4. To specify the character strings of a literal value (abc'd) that contain quotation mark ('), specify as follows.

    reconst="'abc''d'.5asc"
  5. To specify hexadecimal number of a literal value (abc), specify as follows.

    reconst=x616263.3asc
  6. To specify external decimal number of a literal value (-32) by 4 bytes, specify as follows.

    reconst=d-32.4zdl
  7. To reconstruct the field from the 5th byte of the input record to the end of the record, specify as follows.

    reconst=4.END
  8. To reconstruct a 8 byte field from the 3rd byte of the input record, and character strings of a literal value (,), and 5 byte field from the 20th byte of the input record, specify as follows.

    reconst="2.8,','.1asc,19.5"
  9. Enclose with double quotation marks ("), and specify the field in the text file CSV format and text file TSV format to specify the character string of literal value (abc).

    reconst="'abc'.3ascA"
  10. In text file CSV format and text file TSV format, specify the empty field enclosed with double quotation marks (") between the first field in the input record and the second field.

    reconst=0.1,EMPTYA,1.END

4.2.5.7 eof operand

When the input file is a text file, this specifies how the EOF control character is handled.

Format

eof={ effect | ignore }

effect

This inputs data up to the first EOF control character, recognizing the first EOF control character as the end of the file.

ignore

This continues to input data even after the EOF control character (that is, the EOF control character is not recognized as the end of the file).

Note

The default value of the eof operand is effect.

4.2.5.8 overwrite operand

This specifies to continue processing when one of the input files is the same as the output files.
Because the processing result is overwritten to the input file when overwrite operand is specified, the disk space can be saved. When this this operand is omitted, and the same file as the output file is specified for one of the input files, it is an error. Only when the sort option is specified, it is enabled.

Format

overwrite

Note

Note that the data of the input files might not be secured when an error occurs in the sort processing.