As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
TABLE FILE MYFILE PRINT MY_LOC COMPUTE JCITY/A20 = GETTOK(MY_LOC, 52, -2, ' ', 30, JCITY); WHERE READLIMIT EQ 10 WHERE RECORDLIMIT EQ 10 END
SAMPLE VALUES FOR MY_LOC/a52=3928 MyStreet MyCity MyState with space as delimiter. I just need to get MYCITY MYSTATE. but it wont returns nothing when i say -2.Is there anyother way to extract those strings with delimiters as space. Am i missing something here? Please help!!! BTW: Im using WF 5.23 and running some adhoc stuff.
Thx in advance
Posts: 289 | Location: Houston,TX | Registered: June 11, 2004
Susanah, Although it does look like its not a space but I had a space as delimiter i mean it was a ' ' in my argument. Also, I tried the following: TABLE FILE SOMEFILE PRINT STOR_LOC COMPUTE JCITY/A52 = GETTOK(STOR_LOC, 52, -2, ' ', 52, 'A52'); COMPUTE TESTPOSIT/I2=POSIT(STOR_LOC, 52, ' ', 2, 'I2'); COMPUTE TESTPARAG/A52=PARAG(52, STOR_LOC, ',', 52, TESTPARAG);
the output was (with a | between columns): STOR_LOC |JCITY |TESTPOSIT |TESTPARAG
718 AVE G KENTWOOD LA | |4 |718 AVE G KENTWOOD LA
It basically dint return any data for JCITY and I dont know how to use POSIT to find if I can actually get the substring I need to extract.
From the above values I just need to extract KENTWOOD LA in my field JCITY.
Please help!!!
Thx a bunch!
Posts: 289 | Location: Houston,TX | Registered: June 11, 2004
ah! i figured out whats going on. You need to RJUST your MY_LOC variable first, if you're going to want to token thru it from the right (that -2). Otherwise, you're finding the first blank, which is at the end of the input left-adjusted original string anyway. So that's why you're getting nada in your output. You can actually RJUST your input , or ... Say your input field is A15, then -SET &MYVAR = 'KENTWOODbLAbbbb'; (those b are blanks, ok?) -SET &HOWLONG=ARGLEN(15, &MYVAR, 'I2'); -SET &STATE=GETTOK(&MYVAR , &HOWLONG, -1, ' ', &HOWLONG, 'A2'); -* Using the ARGLEN function determines just how long the string really is within the field space. In this case &HOWLONG is 11. So, telling GETTOK to read just 11 characters will bring you back the LA.
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003