The movements of R6.0 and R6.3 do not match (VOS3)
search cancel

The movements of R6.0 and R6.3 do not match (VOS3)

book

Article ID: 274313

calendar_today

Updated On:

Products

Easytrieve Report Generator

Issue/Introduction

After upgrading from R6.0 to R6.3, there are differences in the following movements.

TEST CASE1:

DATA1   1   6   K
DATA1 = ' '

Result:

R6.0 - DATA1 is x'4040A1A1A1A1'
R6.3 - DATA1 is x'A1A1A1A1A1A1' with KEIS
R6.3 - DATA1 is x'404040404040' with KEIS4040

R6.0 does not have KEIS4040. Then set the first 2 bytes to x'4040'.


TEST CASE2:

IF  DATA1  = ' '

Result:
It works like this.

R6.0 - IF  DATA1 = x'4040A1A1A1A1'
R6.3 - IF  DATA1 = x'A1A1A1A1A1A1' with KEIS
R6.3 - IF  DATA1 = x'404040404040' with KEIS4040

R6.0 does not have KEIS4040. Then the first 2 bytes were determined to be x'4040'.

 

Environment

Release : 6.3

Cause

The following differences have been found between Easytrieve R6.0 and R6.3 in the way Kanji spaces are handled.
In both R6.0 and R6.3, the normal behavior is to handle Kanji spaces as X'A1A1', but in R6.0, there are some cases where this behavior differs.
The following is an explanation of the contents of this issue and how to resolve it.

1 - Different aspects of operation:
(1) Space literal values judged in IF statements
When a half-width blank character is judged by a literal for a Kanji field, as in IF Kanji field = ' ', the comparison character differs depending on the field length being judged.

 KANJIFLD4  1  8  K. * 4-character Kanji field
 KANJIFLD1  1  2  K. * 1-character Kanji field
IF KANJIFLD4  =  ' '.

Compared to X'4040A1A1A1A1A1A1'. Only the first 2 bytes are compared as X'4040' and the rest as X'A1A1'. 
The IF statement will be false unless the value of the field is such data.

IF KANJIFLD1  =  ' '.

Compared as X'4040'. If the value of the field is X'4040', the IF statement will be true; if the value of the field is X'A1A1', the IF statement will be false.

In R6.3, both cases are determined by the number of characters times X'A1A1'. Therefore, the data of X'4040' is not judged as a space character.


(2) Space literal value in initial value setting:
If a half-width blank character is specified in a literal for a Kanji field, as in the Kanji field = ' ' specification or the VALUE ' ' specification in a workfield definition, the blank character set in the field will be incorrect.

KANJIFLD4  W  8  K.

In this case, the initial value is X'A1A1A1A1A1A1A1A1'. 

KANJIFLD4  =  ' '.
After this process, the value of the field is X'4040A1A1A1A1A1A1' and only the first two bytes are X'4040'.
KANJIFLD4  W  8  K  VALUE ' '.

If a blank character is specified with VALUE, the initial value is X'4040A1A1A1A1A1A1' and only the first two bytes are X'4040'. 

In R6.3, the number of characters times X'A1A1' is set in both cases.


(3) String conversion when transferring an A-type field to a Kanji field:
As a basic operation of Easytrieve, when transferring fields of different types, data conversion processing is performed according to the field type of the receiving side. However, in R6.0, space data conversion is not performed when transferring data from A-type fields to K-type fields.

KANJIFLD  1  10  K.                   * 5-character Kanji field
ATYPEFLD  W  10  A  VALUE ' '.        * 10-byte A type field
KAJIFLD  =  ATYPEFLD.

The initial value of ATYPEFLD is X'40404040404040404040'. As a result of this transfer process, the KANJIFLD is also set to the same data X'40404040404040404040'.

In R6.3, the data X'A1A1A1A1A1A1A1A1A1A1' is set, which is converted to Kanji blank data, the data type of the receiving side.

 

Resolution

(1) Space literal values judged in IF statements
The default value for judging the Kanji field in the IF statement is the number of characters times X'A1A1'.
If you want the field to be judged as X'4040', use the D'4040' specification (double-byte value specification) for the literal value.
When specifying D, it is necessary to specify a hexadecimal value of the same length as the judgment field length.

KANJIFLD4  1  8  K.           * 4-character Kanji field
KANJIFLD1  1  2  K.           * 1-character Kanji field

IF KANJIFLD4  =  D'4040404040404040'
IF KANJIFLD1  =  D'4040'

If there is a possibility that both X4040' and XA1A1' exist in the space data, the OR condition can be used by specifying the following.

IF KANJIFLD1  =  D'4040'  OR  KANJIFLD1  =  D'A1A1'
IF KANJIFLD1  =  D'4040'  OR  KANJIFLD1  =  ' '
IF KANJIFLD1  =  D'4040'  D'A1A1'
IF KANJIFLD1  =  D'4040'  ' '


(2) Space literal value in initial value setting
The Kanji data type workfield is initially set to the number of characters times X'A1A1'.
If you wish to set the initial value with X'4040', please use the method to redefine the Kanji data field to the A-type field.

ATYPEFLD  W  8  A.
KANJIFLD4  ATYPEFLD  8  K.

The initial value of KANJIFLD4 is X'40404040'.


(3) String conversion when transferring A-type fields to Kanji fields
If you do not want data conversion processing to be performed when transferring data from an A-type field to a Kanji field, redefine the relevant Kanji field as an A-type field and transfer data between A-type fields.

KANJIFLD  1  10  K.                   * 5-character Kanji field
AKANJIFLD  KANJIFLD  10  A.           * Redefine KANJIFLD with type A
ATYPEFLD  W  10  A  VALUE ' '.        * 10-byte A-type field
AKANJIFLD  =  ATYPEFLD.
This process sets KANJIFLD to X'4040404040404040'.