WHAT IS DECIMAL DATA ERROR IN RPG IV...WHEN WILL IT HAPPENS?

Answer Posted / madhusudhan

For the above answer posted by Narendra, there are 19
People who told yes, but did they test this or verify.
Create a Char variable of Lenth 5 and Numeric variable of
lenth 5 and see the result .
D Num1 S 5 P 0
D Char1 S 5 A INZ('ABCDE')
C MOVE Char1 Num1
C Num1 DSPLY

Num1 will not give a Decimal Data error , instead it gives
the values Num1 = 12345. If you use eval
C EVAL Num1 = Char1
Eval will fail during compilation itself.
As per my analysis , Decimal Data error occurs when junk
values or special characters are passed to Numeric
variable. ( Ex : !, @ , #.$) . For testing Intialize the
above variable Char1 with atleast one special character and
just see the result.

This is only one example which i have given , and i heard
that during Parameter passing also this occurs , but dont
know in which scenerio , if anyone knows more on Decimal
Data error, kindly plz post.

Is This Answer Correct ?    24 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what does check opcode is used?

972


What Does 'sr' In Columns 7-8 Of C Specs Mean?

1068


Hello, I have created a CMD type object. In one of the fields in Display file , I would like to see All the Source files present by pass the name of Library. Tried using CHoice(Keyword) and Choicepgm on PARM , but doesn't seems to be working. Any help please..

1787


how can u check no of records in a file?

682


what is the maximum number of subroutines allowed in rpg?

1064






what is arrival sequence?

1114


What is the Difference between command attention key and command function key ?

790


any one have give AS400 study material? pls pass it to gopalsai789@gmail.com

1229


how to declare a constant variable in the freeformat?

963


what is the maximum number of parameters allowed in rpg?

1042


what is the purpose of indicators in rpg?

1097


difference between view and index ?

713


what is the maximum number of fields under a record format of physical file?

1006


What is the difference between non-join logical files and join logical files?

618


can a single screen format occupy a screen area above and below a subfile format ?

1026