|
|
| Author |
Message |
Bill O'Boyle
Senior Member
Joined: 14 Jan 2008 Posts: 368 Location: Orlando, FL, USA
|
|
|
|
Is this a Bit-Map formatted message-area, such as a Visa, MasterCard, JCB, etc Authorisation request and you're trying to extract (parse) this data?
Just curious....
Regards,
Bill |
|
| Back to top |
|
 |
References
|
|
 |
Marso
Senior Member
Joined: 13 Mar 2006 Posts: 354 Location: Israel
|
|
|
|
From what I understood, in the MOVE FILE(X:Y) TO TEMP-FIELD,
the part FILE(X:Y) contains exactly the comp-3 value.
If we define TEMP-FIELD-R PIC X(8) JUST RIGHT,
then we may be able to get somewhere.
After MOVE FILE(X:Y) TO TEMP-FIELD-R,
we can calculate the length of the left part (Z = 8 - Y)
and MOVE LOW-VALUES TO TEMP-FIELD-R (1:Z)
Then use a REDEFINES to have a working COMP-3 field.
Does it work? Anybody tempted to write down some code? |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 9179 Location: 221 B Baker St
|
|
|
|
Hello,
If i understand correctly (and i may not ), comparing the characters in the fields and reporting the differences (in hex) will provide the required output with no need to find a way to work with comp-3 data. |
|
| Back to top |
|
 |
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1526
|
|
|
|
Here's something that might work. The PD pseudo code looks OK (haven't tested). The BI section needs more definition by the OP.
Eg. Do the BI fld lengths limit themselves to 2, 4, 8 or can they be any lengths within the 8 byte COMP limit. If so, that raises the ques of negative binary number represtntation (hi order bits of 1).
PS. I used pic s9(18) as the limit. If arith extend is used that would change.
What say you Arav?
| Code: |
01 wrk-area.
05 wrk-numeric-grp.
wrk-pd pic s9(18) comp-3
wrk-bi-x pic x(8).
wrk-bi redefines
wrk-bi-x pic s9(18) comp.
move lo-vals to wrk-numeric-grp
eval type
when 'pd'
compute wrk-strt = (length of wrk-pd - orig-len) + 1
move orig-rec(orig-strt:orig-len) to wrk-pd(wrk-strt:)
when 'bi'
if orig-fld is neg
move hi-vals to bi-wrk-x
end-if
compute wrk-strt = (length of wrk-bi - orig-len) + 1
move orig-rec(orig-strt:orig-len) to wrk-bi(wrk-strt:)
when 'an'
do the easy part
end-eval
.
|
|
|
| Back to top |
|
 |
|
|