WHAT IS DECIMAL DATA ERROR IN RPG IV...WHEN WILL IT HAPPENS?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / narendra
If you have defined any field as numeric and the value
being inserted into that field is character then system
will throw the message "decimal data error".
Is This Answer Correct ? | 31 Yes | 8 No |
Answer / priya
Decimal data error occurs primarily when numeric field receives invalid values/numbers. The same goes for the case of parameter passing.
When the file is opened by a program and the record containing the invalid data is read, you will not get an error.
But if the field containing the invalid data is read in the program, and some arithematic operation is performed with that value it gives decimal data error.
For eg by being the Factor1 of a MOVEx operation, or either factor in an ADD, SUB, DIV, MULT etc., or on the right-hand side of an EVAL, or if it is involved in a WRITE or UPDATE operation -- then it will be checked, and then the program will fail.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / arun
for abv to Mr.Madhusudhan
"Parameter passing also this occurs in cl prog"
bcoz if we pass the parameters in different formates then
it will occurs data decimal error
plz say if i am incorrect
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / venkat
suppose if i declare data area with the length of 8 char
and i am receiving that data area as data structure and if i give only 7 char value. if i compile the program program will compile but if you call that program it will throw the error as decimal data error
Is This Answer Correct ? | 2 Yes | 0 No |
which type of object is used in db2/400?
what is the function of rlu ?
define a output queue?
what would be the effect on the field where reverse image, underline and highlight display attributes are active ?
Can anybody know difference between SNDUSRMSG AND SNDPGMMSG IN CL PROGRAMMING? IF DON'T KNOW MAIL ME @ gkarthik.as400@gmail.com
What is the maximum number of subfiles that can be specified in a display file?
i have one physical file which is having two logical files. logical a have unique keyword and logical b doesnt have a unique keyword. can i give duplicate values while updating through physical file. if no why?
i am using non join multiple format my 3 database file is like that pf97 R REC ENAME ETENNO ESTATUS K ENAME pf98 R REC1 ENAME ESAL K ENAME PF99 R REC3 ENAME CRDCARD EID K EID & MY NON JOIN LOGICAL FILE IS ALSO SAME EXCEPT RECORD NAMES BEFORE I TRIED WITH 2 FILES SO ITS SAYS ERROR I.E.(Key field attributes must be same as for previous formats. ) SO I CHANGED KEYFIELD ACCORDING TO PF SO ITS WORKING BUT AFTER ADDING 3 FILES ITS SAYING SAME ERROR . I DONT KNOW I NEW IN AS400 PLLZ HELP ME I HAVE ONE MORE QUE. CANT BE USE DIFFERENT KEYFIELD (NOT ACCORDING TO PF) IN NON JOIN LOGICAL FILE.
how do you pass parameters in cl?
which are the query selection criteria, which can be given in a query?
what is the disadvantage of using global variable?
I have to execute 12000 CL Commands one by one.. So, I have created a file called COMMAND. This file has only 1 field called STRING. This file had 12000 records, and all these records are CL Commands (ex: CALL PGM(PGM1)), etc) I have written a CL which will read all the record and do sbmjob.. But it is not working... Plz help me to exexute all these 12000 commands..