G
Guest
I get data from an external source (beyond my control) that I use in my
program. One field is a concatenated string. I need to unconcatenat that
string to get to a (root item number). That program is written in "Cobol"
Rule A: String should end with a number, except when there is a "W" then
should end in "W"
ex (xlb114r) = (xlb114) or (xlb114wr) = (xlb114w)
Rule B: If string contain "/" , string before "/" should end with a number,
then the "/" and any number and/or "W"
ex (xmr115/4sy) = (xmr115/4) or (amr115/4syw) = (xmr115/4w)
Rule B-2: If after "/" there is not any numbers and/or "W" the apply Rule A
without the "/"
ex (xs12pt/aa) = (xs12) or (xs12pt/aaw) = (xs12w) "notice no "/"
Rule C: string with "-", Apply Rule A and keep "-" and everthing after "-"
ex (xan72aa-7.5) = (xan72-7.5)
The ultimate return would be (xs12aa/ptw4-7.5) = (xs12w/4-7.5)
program. One field is a concatenated string. I need to unconcatenat that
string to get to a (root item number). That program is written in "Cobol"
Rule A: String should end with a number, except when there is a "W" then
should end in "W"
ex (xlb114r) = (xlb114) or (xlb114wr) = (xlb114w)
Rule B: If string contain "/" , string before "/" should end with a number,
then the "/" and any number and/or "W"
ex (xmr115/4sy) = (xmr115/4) or (amr115/4syw) = (xmr115/4w)
Rule B-2: If after "/" there is not any numbers and/or "W" the apply Rule A
without the "/"
ex (xs12pt/aa) = (xs12) or (xs12pt/aaw) = (xs12w) "notice no "/"
Rule C: string with "-", Apply Rule A and keep "-" and everthing after "-"
ex (xan72aa-7.5) = (xan72-7.5)
The ultimate return would be (xs12aa/ptw4-7.5) = (xs12w/4-7.5)