View previous topic :: View next topic
|
Author |
Message |
santosh_dorge
New User
Joined: 03 Dec 2006 Posts: 8 Location: Mumbai
|
|
|
|
Hi all,
I have the following declaration
01 gorup-name.
.
.
.
05 A 9(14) comp-3
05 A-re redefines A.
10 AA 9(10) comp-3.
.
.
.
and following code
move some-group to group-name
IF A is not numeric
move zero to a.
if aa not = zero
continue
else
move aa to bb
end-if
I have checked with input file.In each case I am getting zero value for AA.Please let me know if there is any problem with the code |
|
Back to top |
|
|
santosh_dorge
New User
Joined: 03 Dec 2006 Posts: 8 Location: Mumbai
|
|
|
|
santosh_dorge wrote: |
Hi all,
I have the following declaration
01 gorup-name.
.
.
.
05 A 9(14) comp-3
05 A-re redefines A.
10 AA 9(10) comp-3.
.
.
.
and following code
move some-group to group-name
IF A is not numeric
move zero to a.
if aa = zero
continue
else
move aa to bb
end-if
I have checked with input file.In each case I am getting zero value for AA.Please let me know if there is any problem with the code |
|
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
santosh_dorge wrote: |
Code: |
01 gorup-name.
.
05 A 9(14) comp-3
05 A-re redefines A.
10 AA 9(10) comp-3.
.
and following code
move some-group to group-name
IF A is not numeric
move zero to a.
if aa not = zero
continue
else
move aa to bb
end-if |
I have checked with input file.In each case I am getting zero value for AA.Please let me know if there is any problem with the code |
There could be,why are you redefining to a different length? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please post some of your input data in hex (in Browse , turn HEX ON, then cut/past a few entries into your reply post).
Also, while it is possible to define comp-3 fields as you have, they should be defined with an odd number of digits. Your "9(14) comp-3" field will take 8 bytes not 7. Whether you allow for it or not, the system needs 1/2 byte for the sign in a pcaked decimal field.
My guess is that the code ALWAYS detects "not numeric". When you post some hex data, we will be able to see if that is the case. |
|
Back to top |
|
|
Santoshdorge
New User
Joined: 27 Jun 2006 Posts: 48 Location: Pune
|
|
|
|
Here is hex data
for A
00076271
0009920F
and for AA
000762
000992 |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Change A to 9(15) comp-3.
The redefines will not work as you've "cut off" the least significant digits including the sign. The value that is left is pretty much useless. It is not a usable binary number and it is not a comp-3 number.
What is the goal of the shorter redefine? The content of AA will not contain any useful value. If the A field contains dollars and cents, the redefines cuts off the single dollars and all of the cents (7.01).
Your initial post says that you get zero in AA, but your actual data is not zeros?
To sum up, i'd suggest changing the definition of A and posting why the short redefine. Then we will be able to help more.
If you change A and get around the zeros, you may get an 0c7 later, but we can work thru that as well. |
|
Back to top |
|
|
Santoshdorge
New User
Joined: 27 Jun 2006 Posts: 48 Location: Pune
|
|
|
|
Thanks Dick.
My problem got solved. |
|
Back to top |
|
|
|