Focal Point
Need to Extract a text string that varies, from a variable string

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4261020132

June 04, 2007, 04:50 PM
Denny99
Need to Extract a text string that varies, from a variable string
I work at a bank and telephone calls and emails are sent to work queues awaiting some technician to take ownership of the Help Desk ticket. Now for the problem-- I have a database filed named "Work Description" and within this field I'm only concerned with extracting the "TO" queue information. For example the following work description "from WIP Dispatched to Queue DFW - PACE.", I'm only interested in extracting "DFW - PACE" nothing else and within work description "from WIP C E No to Queue DFW - Staffware Suppt." I'm only interested in extracting "DFW - Staffware Suppt". Thus I'm only interested in anything that follows "to Queue " and excludes the ending period(".").

I've been trying various verbs (i.e. Gettok, Posit etc...) with no success. Is there any one out there that can lead me in the correct direction? Thanks a million!
June 04, 2007, 05:22 PM
susannah
Dennis, POSIT will very definitely work, in combination with SUBSTR function.
POSIT , where the string you're searching for is 'to Queue', would give you the integer 21, the position of the 't' in your example.
and then SUBSTR will extract the substring of the inbound string starting with postion 30, or the value of POSIT + 9 (the length of 'to Queue ')




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
June 04, 2007, 05:44 PM
Darin Lee
You would probably have to use POSIT to get the position of the period as well as it can be in a variable spot depending on length of the queue name. Then calculate the sublength (end - (start+9)) and use it in SUBSTR
SUBSTR(inlength, parent, start, end, sublength, outfield)


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
June 05, 2007, 03:15 AM
Alan B
Susannah and Darin are correct in one approach, but there are always multiple choices:
inField/A100 = 'from WIP Dispatched to Queue DFW - PACE.';
shortString/A100 = GETTOK(STRREP(100,inField,9,'to Queue ',1,'%',100,'A100'),ARGLEN(100,inField,'I3')-9,-1,'%',100,'A100');



Alan.
WF 7.705/8.007