From 4f8194db5e466c8d07b4a2f463cf7d2863043234 Mon Sep 17 00:00:00 2001 From: Davide Palladino Date: Thu, 8 Aug 2024 12:11:03 +0200 Subject: [PATCH 01/10] Implemented test --- .../MULANGT04EssentialsCodopAndBifTest.kt | 10 ++++ .../test/resources/smeup/MUDRNRAPU00106.rpgle | 55 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle diff --git a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt index e8981d6fe..7bb125d4a 100644 --- a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt +++ b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt @@ -54,6 +54,16 @@ open class MULANGT04EssentialsCodopAndBifTest : MULANGTTest() { assertEquals(expected, "smeup/MU044014".outputOf()) } + /** + *Assigns content of DS to a String not VARYING in EVAL where, size of DS is greater than String + * @see #LS24003755 + */ + @Test + fun executeMUDRNRAPU00106() { + val expected = listOf("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeean commodo ligula eget dolor. Aenean ma") + assertEquals(expected, "smeup/MUDRNRAPU00106".outputOf()) + } + /** * %DIFF with several DurationCodes * @see #LS24003282 diff --git a/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle new file mode 100644 index 000000000..f3080e9c2 --- /dev/null +++ b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle @@ -0,0 +1,55 @@ + D A40_A100 S 100 DIM(300) + D A40_DS DS + D A40_DS_F1 10 + D A40_DS_F2 29 + D A40_DS_F3 21 + D A40_DS_F4 01 + D A40_DS_F5 04 + D A40_DS_F6 01 + D A40_DS_F7 01 + D A40_DS_F8 10 + D A40_DS_F9 16 + D A40_DS_F10 02 + D A40_DS_F11 05 + D A40_DS_F12 100 + D A40_DS_F13 300 + D A40_A5 S 5 0 + + D OUTPUT S 100 + + C EVAL A40_DS_F1='Lorem ipsu' + C EVAL A40_DS_F2='m dolor sit amet, consectetue' + C EVAL A40_DS_F3='r adipiscing elit. Ae' + C EVAL A40_DS_F4='e' + C EVAL A40_DS_F5='an c' + C EVAL A40_DS_F6='o' + C EVAL A40_DS_F7='m' + C EVAL A40_DS_F8='modo ligul' + C EVAL A40_DS_F9='a eget dolor. Ae' + C EVAL A40_DS_F10='ne' + C EVAL A40_DS_F11='an ma' + C EVAL A40_DS_F12='ssa. Cum sociis natoque penatib' + c + 'us et magnis dis ' + C + 'partu rient montes, nasce' + C + 'tur ridiculus mus.' + C + ' Donec qua' + C EVAL A40_DS_F13='m felis, ultricies nec, pellen' + C + 'tesque eu, pretium' + C + ' quis, sem. Nulla conse' + C + 'quat massa quis ' + C + 'enim. Donec pede justo, ' + C + 'fringilla vel, ' + C + 'aliquet nec, vulputate' + C + ' eget, arcu. ' + C + 'In enim justo, rhoncus ' + C + 'ut, imperdiet a, ' + C + 'venenatis vitae, justo. ' + C + 'Nullam dictum ' + C + 'felis eu pede mollis ' + C + 'pretium. Integer ' + C + 'tincidunt. Cras dapibus' + + C EVAL A40_A5=1 + C EVAL A40_A100(A40_A5)=A40_DS + C EVAL OUTPUT=A40_A100(A40_A5) + C OUTPUT DSPLY From 933410dab56c5d6d7eeca368f55fa37e3ca0267e Mon Sep 17 00:00:00 2001 From: Davide Palladino Date: Thu, 8 Aug 2024 13:16:40 +0200 Subject: [PATCH 02/10] Typo --- .../smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt index 7bb125d4a..0ead0745e 100644 --- a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt +++ b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt @@ -45,7 +45,7 @@ open class MULANGT04EssentialsCodopAndBifTest : MULANGTTest() { } /** - *Assigns content of DS to a String VARYING in EVAL + *Assigns content of DS to a String VARYING in EVAL * @see #LS24003679 */ @Test From e4f177095bf4fb1af9a55f4a840a3ccbbdd3e9c1 Mon Sep 17 00:00:00 2001 From: Davide Palladino Date: Thu, 8 Aug 2024 13:16:55 +0200 Subject: [PATCH 03/10] Added new test --- .../MULANGT04EssentialsCodopAndBifTest.kt | 10 ++++ .../test/resources/smeup/MUDRNRAPU00107.rpgle | 55 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle diff --git a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt index 0ead0745e..fc7ca71ee 100644 --- a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt +++ b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt @@ -64,6 +64,16 @@ open class MULANGT04EssentialsCodopAndBifTest : MULANGTTest() { assertEquals(expected, "smeup/MUDRNRAPU00106".outputOf()) } + /** + *Assigns content of DS to a String not VARYING in EVAL where, size of DS is greater than String + * @see #LS24003755 + */ + @Test + fun executeMUDRNRAPU00107() { + val expected = listOf("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeean commodo ligula eget dolor. Aenean ma") + assertEquals(expected, "smeup/MUDRNRAPU00107".outputOf()) + } + /** * %DIFF with several DurationCodes * @see #LS24003282 diff --git a/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle new file mode 100644 index 000000000..3a51af3f6 --- /dev/null +++ b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle @@ -0,0 +1,55 @@ + D A40_A100 S 100 DIM(300) VARYING + D A40_DS DS + D A40_DS_F1 10 + D A40_DS_F2 29 + D A40_DS_F3 21 + D A40_DS_F4 01 + D A40_DS_F5 04 + D A40_DS_F6 01 + D A40_DS_F7 01 + D A40_DS_F8 10 + D A40_DS_F9 16 + D A40_DS_F10 02 + D A40_DS_F11 05 + D A40_DS_F12 100 + D A40_DS_F13 300 + D A40_A5 S 5 0 + + D OUTPUT S 100 + + C EVAL A40_DS_F1='Lorem ipsu' + C EVAL A40_DS_F2='m dolor sit amet, consectetue' + C EVAL A40_DS_F3='r adipiscing elit. Ae' + C EVAL A40_DS_F4='e' + C EVAL A40_DS_F5='an c' + C EVAL A40_DS_F6='o' + C EVAL A40_DS_F7='m' + C EVAL A40_DS_F8='modo ligul' + C EVAL A40_DS_F9='a eget dolor. Ae' + C EVAL A40_DS_F10='ne' + C EVAL A40_DS_F11='an ma' + C EVAL A40_DS_F12='ssa. Cum sociis natoque penatib' + c + 'us et magnis dis ' + C + 'partu rient montes, nasce' + C + 'tur ridiculus mus.' + C + ' Donec qua' + C EVAL A40_DS_F13='m felis, ultricies nec, pellen' + C + 'tesque eu, pretium' + C + ' quis, sem. Nulla conse' + C + 'quat massa quis ' + C + 'enim. Donec pede justo, ' + C + 'fringilla vel, ' + C + 'aliquet nec, vulputate' + C + ' eget, arcu. ' + C + 'In enim justo, rhoncus ' + C + 'ut, imperdiet a, ' + C + 'venenatis vitae, justo. ' + C + 'Nullam dictum ' + C + 'felis eu pede mollis ' + C + 'pretium. Integer ' + C + 'tincidunt. Cras dapibus' + + C EVAL A40_A5=1 + C EVAL A40_A100(A40_A5)=A40_DS + C EVAL OUTPUT=A40_A100(A40_A5) + C OUTPUT DSPLY From 9b723b70ab1b8d9bd26eb633f31262100a74e25f Mon Sep 17 00:00:00 2001 From: Davide Palladino Date: Thu, 8 Aug 2024 13:49:41 +0200 Subject: [PATCH 04/10] Removed logic for debug --- .../src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt index ba44a266a..b563e6f86 100644 --- a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt +++ b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt @@ -633,9 +633,6 @@ data class ConcreteArrayValue(val elements: MutableList, override val ele override fun setElement(index: Int, value: Value) { require(index >= 1) require(index <= arrayLength()) - if (!value.assignableTo(elementType)) { - println("boom") - } require(value.assignableTo(elementType)) { "Cannot assign ${value::class.qualifiedName} to ${elementType::class.qualifiedName}" } From 8ddbfd4263208810e0e6b0a3fffac4ad3533f5aa Mon Sep 17 00:00:00 2001 From: Davide Palladino Date: Thu, 8 Aug 2024 13:50:30 +0200 Subject: [PATCH 05/10] Refactored unused `setSubstring` with right logic, for the purpose of the next implementation --- .../main/kotlin/com/smeup/rpgparser/interpreter/values.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt index b563e6f86..9cd0c4faa 100644 --- a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt +++ b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt @@ -143,13 +143,12 @@ data class StringValue(var value: String, var varying: Boolean = false) : Abstra override fun asTimeStamp(): TimeStampValue = TimeStampValue.of(value) - fun setSubstring(startOffset: Int, endOffset: Int, substringValue: StringValue) { + fun setSubstring(startOffset: Int, endOffset: Int) { require(startOffset >= 0) require(startOffset <= value.length) require(endOffset >= startOffset) require(endOffset <= value.length) { "Asked startOffset=$startOffset, endOffset=$endOffset on string of length ${value.length}" } - substringValue.pad(endOffset - startOffset) - value = value.substring(0, startOffset) + substringValue.value + value.substring(endOffset) + value = value.substring(startOffset, endOffset) } fun getSubstring(startOffset: Int, endOffset: Int): StringValue { From a90b59907dd1800dd994f0aa023dde7339a002bc Mon Sep 17 00:00:00 2001 From: Davide Palladino Date: Thu, 8 Aug 2024 13:53:10 +0200 Subject: [PATCH 06/10] Removed restriction of size, by considering that RPG truncate the DS content if the target is smaller than source --- .../src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt index 9cd0c4faa..c54e7d1e1 100644 --- a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt +++ b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt @@ -967,7 +967,7 @@ data class DataStructValue(var value: String, private val optionalExternalLen: I // Check if the size of the value matches the expected size within the DS // TO REVIEW is DataStructureType -> true - is StringType -> expectedType.size >= this.value.length + is StringType -> true else -> false } } From 88377dc2cf15710e0505fbed86e5fb1c8a5b3e65 Mon Sep 17 00:00:00 2001 From: Davide Palladino Date: Thu, 8 Aug 2024 13:55:01 +0200 Subject: [PATCH 07/10] Applied fix with important refactoring of code, by using `when` construct. If the target is `StringType`, performs the right padding o truncating based of size and varying flag. --- .../com/smeup/rpgparser/interpreter/values.kt | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt index c54e7d1e1..5b8974624 100644 --- a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt +++ b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt @@ -635,20 +635,29 @@ data class ConcreteArrayValue(val elements: MutableList, override val ele require(value.assignableTo(elementType)) { "Cannot assign ${value::class.qualifiedName} to ${elementType::class.qualifiedName}" } - if (elementType is StringType && !elementType.varying) { - val v = when (value) { - is AbstractStringValue -> { - (value as StringValue).copy() + when (elementType) { + is StringType -> { + val v = when (value) { + is AbstractStringValue -> { + (value as StringValue).copy() + } + is DataStructValue -> { + value.asString().copy() + } + else -> TODO("Not yet implemented") } - is DataStructValue -> { - value.asString().copy() + + /* + * Setting the value based of varying flag and length of target. + */ + if (!elementType.varying && v.length() < elementType.length) { + v.pad(elementType.length) + } else if (v.length() > elementType.length) { + v.setSubstring(0, elementType.length) } - else -> TODO("Not yet implemented") + elements[index - 1] = v } - v.pad(elementType.length) - elements[index - 1] = v - } else { - elements[index - 1] = value + else -> elements[index - 1] = value } } From fedaa4a219ec91c48bb9ee8591e7b9c4418b2d94 Mon Sep 17 00:00:00 2001 From: Davide Palladino Date: Mon, 19 Aug 2024 10:44:42 +0200 Subject: [PATCH 08/10] Updated RPG programs with a standard high level comment --- .../test/resources/smeup/MUDRNRAPU00106.rpgle | 19 +++++++++++++++++++ .../test/resources/smeup/MUDRNRAPU00107.rpgle | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle index f3080e9c2..e6a34bae2 100644 --- a/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle +++ b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle @@ -1,3 +1,22 @@ + V* ============================================================== + V* 08/08/2024 APU001 Creation + V* ============================================================== + O * PROGRAM GOAL + O * Assignment the content of DS to an element of array that is + O * String type (not varying) with size smaller than DS. + O * After declaration of variable there is the assignment of + O * specific substring of "Lorem ipsum" to every field of DS. + O * Then, there is the assignment of DS content to an element + O * of array. In AS400 there is a truncate of content for adapting + O * to destination, smaller than DS. + O * The implementation is like the original source, by changing + O * only the name of variables and by adding the assignment + O * of substring to undestand about the behavior. + V* ============================================================== + O * JARIKO ANOMALY + O * Before the fix, the error occurred was + O * `Cannot assign DataStructValue to StringType`. + V* ============================================================== D A40_A100 S 100 DIM(300) D A40_DS DS D A40_DS_F1 10 diff --git a/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle index 3a51af3f6..209c61f06 100644 --- a/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle +++ b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle @@ -1,3 +1,22 @@ + V* ============================================================== + V* 08/08/2024 APU001 Creation + V* ============================================================== + O * PROGRAM GOAL + O * Assignment the content of DS to an element of array that is + O * String type (varying) with size smaller than DS. + O * After declaration of variable there is the assignment of + O * specific substring of "Lorem ipsum" to every field of DS. + O * Then, there is the assignment of DS content to an element + O * of array. In AS400 there is a truncate of content for adapting + O * to destination, smaller than DS. + O * The implementation is like the original source, by changing + O * only the name of variables and by adding the assignment + O * of substring to undestand about the behavior. + V* ============================================================== + O * JARIKO ANOMALY + O * Before the fix, the error occurred was + O * `Cannot assign DataStructValue to StringType`. + V* ============================================================== D A40_A100 S 100 DIM(300) VARYING D A40_DS DS D A40_DS_F1 10 From 3c51e719911722c2948521dd9751e222d8c4ebbe Mon Sep 17 00:00:00 2001 From: Davide Palladino Date: Mon, 19 Aug 2024 12:08:36 +0200 Subject: [PATCH 09/10] Added inline comment where error is occurred --- .../src/test/resources/smeup/MUDRNRAPU00106.rpgle | 2 +- .../src/test/resources/smeup/MUDRNRAPU00107.rpgle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle index e6a34bae2..a75bdea74 100644 --- a/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle +++ b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle @@ -69,6 +69,6 @@ C + 'tincidunt. Cras dapibus' C EVAL A40_A5=1 - C EVAL A40_A100(A40_A5)=A40_DS + C EVAL A40_A100(A40_A5)=A40_DS Jariko Runtime Error: `Cannot assign DataStructValue to StringType` C EVAL OUTPUT=A40_A100(A40_A5) C OUTPUT DSPLY diff --git a/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle index 209c61f06..222582294 100644 --- a/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle +++ b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle @@ -69,6 +69,6 @@ C + 'tincidunt. Cras dapibus' C EVAL A40_A5=1 - C EVAL A40_A100(A40_A5)=A40_DS + C EVAL A40_A100(A40_A5)=A40_DS Jariko Runtime Error: `Cannot assign DataStructValue to StringType` C EVAL OUTPUT=A40_A100(A40_A5) C OUTPUT DSPLY From eaa3aea1b3618a65e5c34ae1f277b76c21934887 Mon Sep 17 00:00:00 2001 From: Davide Palladino Date: Tue, 20 Aug 2024 10:18:43 +0200 Subject: [PATCH 10/10] Simplified tests --- .../MULANGT04EssentialsCodopAndBifTest.kt | 4 +- .../test/resources/smeup/MUDRNRAPU00106.rpgle | 61 ++++--------------- .../test/resources/smeup/MUDRNRAPU00107.rpgle | 61 ++++--------------- 3 files changed, 28 insertions(+), 98 deletions(-) diff --git a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt index fc7ca71ee..a54059e7b 100644 --- a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt +++ b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT04EssentialsCodopAndBifTest.kt @@ -60,7 +60,7 @@ open class MULANGT04EssentialsCodopAndBifTest : MULANGTTest() { */ @Test fun executeMUDRNRAPU00106() { - val expected = listOf("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeean commodo ligula eget dolor. Aenean ma") + val expected = listOf("Lorem ipsum dolor sit amet, consectetuer adipiscin") assertEquals(expected, "smeup/MUDRNRAPU00106".outputOf()) } @@ -70,7 +70,7 @@ open class MULANGT04EssentialsCodopAndBifTest : MULANGTTest() { */ @Test fun executeMUDRNRAPU00107() { - val expected = listOf("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aeean commodo ligula eget dolor. Aenean ma") + val expected = listOf("Lorem ipsum dolor sit amet, consectetuer adipiscin") assertEquals(expected, "smeup/MUDRNRAPU00107".outputOf()) } diff --git a/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle index a75bdea74..69b2bcfe0 100644 --- a/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle +++ b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00106.rpgle @@ -1,5 +1,7 @@ V* ============================================================== V* 08/08/2024 APU001 Creation + V* 20/08/2024 APU001 Simplification by removing several + V* fields of DS. V* ============================================================== O * PROGRAM GOAL O * Assignment the content of DS to an element of array that is @@ -17,58 +19,21 @@ O * Before the fix, the error occurred was O * `Cannot assign DataStructValue to StringType`. V* ============================================================== - D A40_A100 S 100 DIM(300) + D A40_A50 S 50 DIM(300) D A40_DS DS - D A40_DS_F1 10 - D A40_DS_F2 29 - D A40_DS_F3 21 - D A40_DS_F4 01 - D A40_DS_F5 04 - D A40_DS_F6 01 - D A40_DS_F7 01 - D A40_DS_F8 10 - D A40_DS_F9 16 - D A40_DS_F10 02 - D A40_DS_F11 05 - D A40_DS_F12 100 - D A40_DS_F13 300 + D A40_DS_F1 20 + D A40_DS_F2 20 + D A40_DS_F3 35 D A40_A5 S 5 0 - D OUTPUT S 100 + D OUTPUT S 50 - C EVAL A40_DS_F1='Lorem ipsu' - C EVAL A40_DS_F2='m dolor sit amet, consectetue' - C EVAL A40_DS_F3='r adipiscing elit. Ae' - C EVAL A40_DS_F4='e' - C EVAL A40_DS_F5='an c' - C EVAL A40_DS_F6='o' - C EVAL A40_DS_F7='m' - C EVAL A40_DS_F8='modo ligul' - C EVAL A40_DS_F9='a eget dolor. Ae' - C EVAL A40_DS_F10='ne' - C EVAL A40_DS_F11='an ma' - C EVAL A40_DS_F12='ssa. Cum sociis natoque penatib' - c + 'us et magnis dis ' - C + 'partu rient montes, nasce' - C + 'tur ridiculus mus.' - C + ' Donec qua' - C EVAL A40_DS_F13='m felis, ultricies nec, pellen' - C + 'tesque eu, pretium' - C + ' quis, sem. Nulla conse' - C + 'quat massa quis ' - C + 'enim. Donec pede justo, ' - C + 'fringilla vel, ' - C + 'aliquet nec, vulputate' - C + ' eget, arcu. ' - C + 'In enim justo, rhoncus ' - C + 'ut, imperdiet a, ' - C + 'venenatis vitae, justo. ' - C + 'Nullam dictum ' - C + 'felis eu pede mollis ' - C + 'pretium. Integer ' - C + 'tincidunt. Cras dapibus' + C EVAL A40_DS_F1='Lorem ipsum dolor si' + C EVAL A40_DS_F2='t amet, consectetuer' + C EVAL A40_DS_F3=' adipiscing elit. Aeean' + C + ' commodo lig' C EVAL A40_A5=1 - C EVAL A40_A100(A40_A5)=A40_DS Jariko Runtime Error: `Cannot assign DataStructValue to StringType` - C EVAL OUTPUT=A40_A100(A40_A5) + C EVAL A40_A50(A40_A5)=A40_DS Jariko Runtime Error: `Cannot assign DataStructValue to StringType` + C EVAL OUTPUT=A40_A50(A40_A5) C OUTPUT DSPLY diff --git a/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle index 222582294..b270730b0 100644 --- a/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle +++ b/rpgJavaInterpreter-core/src/test/resources/smeup/MUDRNRAPU00107.rpgle @@ -1,5 +1,7 @@ V* ============================================================== V* 08/08/2024 APU001 Creation + V* 20/08/2024 APU001 Simplification by removing several + V* fields of DS. V* ============================================================== O * PROGRAM GOAL O * Assignment the content of DS to an element of array that is @@ -17,58 +19,21 @@ O * Before the fix, the error occurred was O * `Cannot assign DataStructValue to StringType`. V* ============================================================== - D A40_A100 S 100 DIM(300) VARYING + D A40_A50 S 50 DIM(300) VARYING D A40_DS DS - D A40_DS_F1 10 - D A40_DS_F2 29 - D A40_DS_F3 21 - D A40_DS_F4 01 - D A40_DS_F5 04 - D A40_DS_F6 01 - D A40_DS_F7 01 - D A40_DS_F8 10 - D A40_DS_F9 16 - D A40_DS_F10 02 - D A40_DS_F11 05 - D A40_DS_F12 100 - D A40_DS_F13 300 + D A40_DS_F1 20 + D A40_DS_F2 20 + D A40_DS_F3 35 D A40_A5 S 5 0 - D OUTPUT S 100 + D OUTPUT S 50 - C EVAL A40_DS_F1='Lorem ipsu' - C EVAL A40_DS_F2='m dolor sit amet, consectetue' - C EVAL A40_DS_F3='r adipiscing elit. Ae' - C EVAL A40_DS_F4='e' - C EVAL A40_DS_F5='an c' - C EVAL A40_DS_F6='o' - C EVAL A40_DS_F7='m' - C EVAL A40_DS_F8='modo ligul' - C EVAL A40_DS_F9='a eget dolor. Ae' - C EVAL A40_DS_F10='ne' - C EVAL A40_DS_F11='an ma' - C EVAL A40_DS_F12='ssa. Cum sociis natoque penatib' - c + 'us et magnis dis ' - C + 'partu rient montes, nasce' - C + 'tur ridiculus mus.' - C + ' Donec qua' - C EVAL A40_DS_F13='m felis, ultricies nec, pellen' - C + 'tesque eu, pretium' - C + ' quis, sem. Nulla conse' - C + 'quat massa quis ' - C + 'enim. Donec pede justo, ' - C + 'fringilla vel, ' - C + 'aliquet nec, vulputate' - C + ' eget, arcu. ' - C + 'In enim justo, rhoncus ' - C + 'ut, imperdiet a, ' - C + 'venenatis vitae, justo. ' - C + 'Nullam dictum ' - C + 'felis eu pede mollis ' - C + 'pretium. Integer ' - C + 'tincidunt. Cras dapibus' + C EVAL A40_DS_F1='Lorem ipsum dolor si' + C EVAL A40_DS_F2='t amet, consectetuer' + C EVAL A40_DS_F3=' adipiscing elit. Aeean' + C + ' commodo lig' C EVAL A40_A5=1 - C EVAL A40_A100(A40_A5)=A40_DS Jariko Runtime Error: `Cannot assign DataStructValue to StringType` - C EVAL OUTPUT=A40_A100(A40_A5) + C EVAL A40_A50(A40_A5)=A40_DS Jariko Runtime Error: `Cannot assign DataStructValue to StringType` + C EVAL OUTPUT=A40_A50(A40_A5) C OUTPUT DSPLY