‎2008 Jul 03 5:34 PM
i define as
constants: cc type C value '000000'.
and i get a warning during syntax check as
value specification is longer than the corresponding field.
why ? how to correct ?
thks
‎2008 Jul 03 5:38 PM
The constant in your case should be defined as or else it assumes it as 1 char.
CONSTANTS:cc(6) type c value '000000',
-Anthony.
‎2008 Jul 03 5:37 PM
Hi,
Change the declaration as mentioned below.
constants: cc type char6 value '000000'.
Generally the length of the value specified should not be greater than lengh of the data type.
In your example..you have type c which is of length 1 but you have specified the value which is of length 6.
Thanks
Naren
‎2008 Jul 03 5:38 PM
The constant in your case should be defined as or else it assumes it as 1 char.
CONSTANTS:cc(6) type c value '000000',
-Anthony.
‎2008 Jul 03 5:40 PM
‎2008 Jul 03 5:43 PM
U can use this statement as well.
CONSTANTS:cc type c length 6 value '000000'.
Regards,
Joy.
‎2008 Jul 03 8:45 PM
Hi,
When you declare a variable as constant it means that the field length should be specified such that the field should be restricted to store values greater than its range in the entire program.
The value assignment to the constant is that it stores the value entirely if its with in range or does not try to store if its out of the length range...
Because they allow you to store data under a particular name within the memory area of a program. Its like synchronous.... Stores anything with in range.... stores nothing if its out of bounds.
Hope this would make to clear you issue.
Regards
Narin Nandivada.