Please help with syntax
Posted: Tue Nov 22, 2011 4:49 am
I'm writing a quick code to examine the address line so that if it starts with C/O or CO, I will move those info into Attention line, The address line should starts with any characters like PO, P.O. or with numeric.
So, I have this following suedo code:
Address line begins with C/O or CO
Search for PO, P.O, or P.O.
----Set subscripts to 1
----Do unitl subscripts is 30 - :x where x = 3, 4,5
----if address (sub:3) = 'PO ' success
----if address (sub:4) = 'P O ' or 'P.O.' success
----if address (sub:5) = 'P.O. ' success
If not found, search for first numeric digit
----if address (sub:1) numeric
Move Address (1:sub - 1) to Attention
Move Address (sub:30) to Address line.
Please help me translate these into COBOL, I'm learning about index and subcribe....Thank you.
So, I have this following suedo code:
Address line begins with C/O or CO
Search for PO, P.O, or P.O.
----Set subscripts to 1
----Do unitl subscripts is 30 - :x where x = 3, 4,5
----if address (sub:3) = 'PO ' success
----if address (sub:4) = 'P O ' or 'P.O.' success
----if address (sub:5) = 'P.O. ' success
If not found, search for first numeric digit
----if address (sub:1) numeric
Move Address (1:sub - 1) to Attention
Move Address (sub:30) to Address line.
Please help me translate these into COBOL, I'm learning about index and subcribe....Thank you.