chillmo
New User
Joined: 31 Aug 2017 Posts: 39 Location: USA
|
|
|
|
I have a requirement to convert an unpacked file to packed (sounds simple enough); however, there are three fields that I must interrogate the signage to produced the desired results.....this is where I'm running into issues. So, if there is a negative sign ('-') in positions 65, 73, and 85, I need to multiply the next field by -1 and convert it to a packed number. Only the first field has been, w/negative sign, has the correct value....the subsequent fields are all positive.
Code: |
IFTHEN=(WHEN=(65,1,CH,EQ,C'-'),
BUILD=(1:1,25,
26:26,3,ZD,TO=PD,LENGTH=2,
28:29,10,
38:39,10,
48:49,3,ZD,TO=PD,LENGTH=2,
50:52,8,
58:60,5,ZD,TO=PD,LENGTH=3,
61:66,7,ZD,MUL,-1,TO=PDC,LENGTH=4,
65:74,11,ZD,TO=PDC,LENGTH=6,
71:86,11,ZD,TO=PDC,LENGTH=6,
77:97,35,
112:132,1,
113:133,35,
148:168,33),HIT=NEXT),
IFTHEN=(WHEN=(73,1,CH,EQ,C'-'),
OVERLAY=(65:74,11,ZD,MUL,-1,TO=PDC,LENGTH=6),HIT=NEXT),
IFTHEN=(WHEN=(85,1,CH,EQ,C'-'),
OVERLAY=(71:86,11,ZD,MUL,-1,TO=PDC,LENGTH=6))
|
Here's my input file:
Code: |
99999-1234567-11111111100-22222222200MO
99999-1234567+22222222234-33333333300MO
99999-1234567-55555555500+44444444422MO
99999+1119999-13344441100+99999999900MO
99999+1234567+11111111100+22222222200MO
99999-1234567+44554545400-22222666200MO
|
Any assistance would be greatly appreciated! |
|