This work resolves the issue when using the MOVE/MOVEL operations to move an alphanumeric standalone field into a data structure field. The table below describes the currently handled use cases:
Value *
DS Field Type
Precision (Scale)
Result
Notes
'00520'
ZONED
5 (0)
520
'00520'
ZONED
5 (2)
5.2
'0052 '
ZONED
Error
The value must contain only numbers.
'00520'
PACKED
Error
The value must not contain only numbers.
* standalone field value or sub-value
Techincal notes
Every sub-value have to match with related DS field. To fix these problems in Jariko, I improved:
DataStructValue, that checks if a NumberType, as ZONED, has the right syntax;
coercing file, that checks if the value is number and the destination RPG type is PACKED, to launch an Exception.
Then, movel simply creates an instance of DataStructValue by reusing the same logic for EVAL, allowed for MOVE/MOVEL.
Related to #LS24003807
Checklist:
[x] If this feature involves RPGLE fixes or improvements, they are well-described in the summary.
[x] There are tests for this feature.
[x] RPGLE code used for tests is easily understandable and includes comments that clarify the purpose of this feature.
[X] The code follows Kotlin conventions (run ./gradlew ktlintCheck).
[X] The code passes all tests (run ./gradlew check).
[ ] Relevant documentation is included in the docs directory.
Description
This work resolves the issue when using the
MOVE
/MOVEL
operations to move an alphanumeric standalone field into a data structure field. The table below describes the currently handled use cases:'00520'
ZONED
'00520'
ZONED
'0052 '
ZONED
'00520'
PACKED
* standalone field value or sub-value
Techincal notes
Every sub-value have to match with related
DS
field. To fix these problems in Jariko, I improved:DataStructValue
, that checks if aNumberType
, asZONED
, has the right syntax;coercing
file, that checks if the value is number and the destination RPG type isPACKED
, to launch an Exception. Then,movel
simply creates an instance ofDataStructValue
by reusing the same logic forEVAL
, allowed forMOVE
/MOVEL
.Related to #LS24003807
Checklist:
./gradlew ktlintCheck
)../gradlew check
).docs
directory.