jyotika_anand Beginner
Joined: 28 Nov 2005 Posts: 5 Topics: 3
|
Posted: Wed Nov 30, 2005 1:51 am Post subject: Unable to find the length of the Value in a VARIABLE |
|
|
Hi,
I do have an uncommon problem in finding the Length of the Value in the field. Let me explain this with an example
In the working storage I have declared a variable, like..
01 WS-FIELD-1.
03 WS-FIELD1-DATA PIC 9(6) VALUE 1234.
03 WS-FIELD1-LEN PIC 9 VALUE ZEROS.
Ideally if I use the following syntax
MOVE LENGTH OF WS-FIELD1-DATA TO WS-FIELD1-LEN,
then it should actually move the actual length of the DATA in the field instead of moving the length of the defined field. In this case, its moving
6 to WS-FIELD1-LEN instead of 4 to WS-FIELD1-LEN.
I have also tried other option of using the INSPECT with the TALLYING CAUSE, like the example below
INSPECT WS-FIELD1-DATA TALLYING WS-FIELD1-LEN FOR LEADING ZEROS.
Even the above syntax doesn't seem to solve my problem,,, Can anyone look into it and post a reply ASAP.....................
Regards,
Jyotika |
|