Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tricky Sub String Problem

Status
Not open for further replies.

DrSmyth

Technical User
Jul 16, 2003
557
GB
I've got a very tricky problem with substrings that is sending me slowly bold!!!

Basically I have a memo field in a db2 database that has various pieces of information in it, each piece of information is seperated by a colon :)), there are exactly ten colons in each record and if a piece of information is not present in the field then the multiple colons are placed together. Here is a couple of examples (Using only first 4 colons

Johnny:7:West:421:N
Iain::East::Y
Dave:9::294:Y

The problem i have is that i need to report on the text between the 7th and 8th colons....

In the above examples if i was trying to get the information between the 1st and secound colons i would have
7

9

The fields always vary in the amount of data that is held in them so this will never be in a fixed position.

I've tried with UDO's but they don't seem to achieve the goal (Actually tried a series of 8 UDO's in an attempt to strip away a colon at a time)

Does anybody have any ideas whether it be at a report, universe, sdk or whatever level????



 
I've managed to figure this out and it got very very confusing!!!!!

Basically i made 16 udo's each one stipping away a colon...
and giving me the remaining string..

Simple when you give it some!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top