SEQNO function
Function
SEQNO{[HOW]}
This function outputs sequence numbers.
Sequential numbers are given to the output records in accordance with the output rules specified in the HOW parameter.
Parameters
HOW
Specify the rules for outputting sequence numbers. (This parameter can be omitted.)
You can only use 0, 1, 2 or 3.
If you omit this parameter, 0 is applied.
The table below describes the correspondence of values of the argument HOW and the rules for outputting sequence numbers.
HOW |
Output rules |
Purpose |
---|---|---|
0 |
Whenever the SEQNO{0} function is called, the sequence number is incremented. A sequential number is provided at each increment. Mapped data is not used in the function. |
When records are distributed into multiple files, this option can be used to give sequential numbers to all output file records. |
1 |
Whenever the SEQNO{1} function for the specified item is called, the sequence number is incremented. A sequential number is provided for each output file. Mapped data is not used in the function. |
This option is used to give sequential numbers within the specified function. Even if there were records that were not output due to sorting based on extraction condition or other reasons, sequence numbers are sequentially given to the output records. |
2 |
Whenever the SEQNO{2} function for the specified item is called, the sequence number is incremented. A sequential number is provided for each record with the same data. The sequential number is reset to 1 if the data of the mapped item is different from the previous data. |
This option is used when giving sequential numbers within records with the same data. However, if a record that has the same value as an earlier record follows a record that has a different value, a new sequential number will be given. |
3 |
Whenever the SEQNO{3} function for the specified item is called, the sequence number is converted. When the value in the specified field is the same as the previous record value, the sequential number is the same value as the previous SEQNO {3}. If it is different, the value increments. A sequential number is calculated for each output file. |
This option is used when giving sequential numbers that are the same if the value in the specified field is the same in the previous record, and that are different if the value in the specified field is different in the previous record. However, if a record that has the same value as an earlier record follows a record that has a different value, a new sequential number will be given. |
Example1
Prerequisites

Figure A.33 Example of using the SEQNO function (Prerequisites)
Extraction conditions
Area code ==1 -> Output file 1
Area code ==2 ->Output file 2
Using SEQNO{0}

Figure A.34 Example of using the SEQNO function (SEQNO{0})
Example2
Prerequisites

Figure A.35 Example of using the SEQNO function (Prerequisites)
Extraction conditions
Area code ==1 -> Output file 1
Area code ==2 ->Output file 2
Using SEQNO{1}

Figure A.36 Example of using the SEQNO function (SEQNO{1})
Example3
Prerequisites

Figure A.37 Example of using the SEQNO function (Prerequisites)
Extraction conditions
Area code ==1 -> Output file 1
Area code ==2 -> Output file 2
Using SEQNO{2}

Figure A.38 Example of using the SEQNO function (SEQNO{2})
Example4
Prerequisites

Figure A.39 Example of using the SEQNO function (Prerequisites)
Extraction condition
Area code ==1 -> Output file 1
Area code ==2 -> Output file 2
Using SEQNO{3}

Figure A.40 Example of using the SEQNO function (SEQNO{3})