hi
i have a
05 X PIC S9(07) COMP-3
and would like to redefine it as a
05 X12 redefines X.
10 X-1 PIC S9(02) COMP-3 and
10 X-2 PIC S9(05) COMP-3
what's wrong with that ?
i get an abend ASRA !
thanks for your help
claudeb
I don't know what ASRA is but looks to me like you will have a problem with signs at the very least. If you only accessed X-2 and X-1 (for instance) it would probably be ok but as soon as you try to access X you will find signs in the middle of a numeric packed field. Initialize X-1 and
X-2 and you will get 00 0C 00 00 in X (where 0C is +).
Claudeb
According to my manual, s9(7) comp-3 requires 4 bytes, while s9(2) comp-3 requites 2 bytes and s9(5) comp-3 requires 3 bytes for a total of 5 bytes. I've always moved a comp-3 field to a non-comp field before redefining.
The problem with the redefines is that the length is not equal but also the redefines does not create two signed fields!
If x contains +1234567 the hexacedimal value will be x'1234567C'. You probably want to get the first two ciphers off from the comp-3 field which is possible, but not with this definition. You can define x-1 as a single byte and put it in front of a valid signed field if that is what you need. So if x-1 has a picture x, you can define something like:
IF you move x-1 to front-of-comp-3, you can use the numeric field trick-number, but it has a 10 times higher value.
The other and much easier way is of course to move it to a normal numeric field but even then you have some difficulties with the sign. You can define it as a separate sign. The unsigned pic 9(7) field can be redefined for the separate ciphers.
If you want to manipulate sections of a numeric value using a redefinition, i think you should ditch the comp-3 all together. Also, to evade problems with signs, lose those, too.
A definition like
will provide access to the first two, resp. the last five digits of X seperately.
In spite of it's obvious limitations, you will at least have none of the problems mentioned above.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.