Pootytaint
Programmer
I have a program where the incoming address file is 50 bytes long. The problem is there is no delimiter other than space. 123 main st Orlando fl 30992 or PO BOX 23432 CASA GRANDE AZ 85122. I need to move 123 main st to addr1, orlando fl addr2 and 30992 to zip. I figured out how to get the zip out with:
move 0 to ws-tally, ws-data-length.
INSPECT FUNCTION REVERSE(CU-MAIL-ADDR) TALLYING WS-TALLY FOR LEADING SPACES
COMPUTE WS-DATA-LENGTH = LENGTH OF CU-MAIL-ADDR - ws-tally
MOVE CU-MAIL-ADDR(1:WS-DATA-LENGTH) TO WS-HOLD-ZIP1.
My question is what is the best way to read backwards from start of zip to get city/state (also accounting for 'SAN Diego' and move to addr2 and keep going back to move the rest to address1? Any ideas would be appreciated. I have looked through several scenarios on here, but they were'nt quite like this. Thanks!
move 0 to ws-tally, ws-data-length.
INSPECT FUNCTION REVERSE(CU-MAIL-ADDR) TALLYING WS-TALLY FOR LEADING SPACES
COMPUTE WS-DATA-LENGTH = LENGTH OF CU-MAIL-ADDR - ws-tally
MOVE CU-MAIL-ADDR(1:WS-DATA-LENGTH) TO WS-HOLD-ZIP1.
My question is what is the best way to read backwards from start of zip to get city/state (also accounting for 'SAN Diego' and move to addr2 and keep going back to move the rest to address1? Any ideas would be appreciated. I have looked through several scenarios on here, but they were'nt quite like this. Thanks!