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.
I'm having a problem storing a long list of information into an amper variable. I'm passing a deliminated list from a ASP page that I need to put the items in the list within single quotes to use in a WHERE IN clause.
I'm grabbing a variable from a webpage with the items deliminated by a '#' sign. If I try to break apart a list greater than 50 characters or so (this is just a guestimate), then the report will hang. If I comment out the "-SET &inList" line where I'm storing the list of tokens. Then the report will run. If I try to break apart a list less then 50 character and leave in the "-SET &inList" line the report will run. Right now I'm trying to store the new list back into the existing amper var. I tried storing the new list into a new amper var and I get the same problem.
I'm able to display these passed in variables, so I know everything is coming in ok. Weird thing is when I setup a -DEFAULT variable with this long list and run the report from within the WF Studio the report runs.
Below is my Loop to break apart the list.
Any suggestions?
-SET &TMPLST = &inList | ' *#';
-REPEAT ENDLOOP FOR &I FROM 1 TO &TMPLST.LENGTH -SET &VAR.&I = &I ; -SET &ctoken = GETTOK(&TMPLST, &TMPLST.LENGTH, &I, '#', 60, A60) ; -SET &ctoken = TRIM('L', &ctoken, &ctoken.LENGTH, ' ', 1, 'A&ctoken.LENGTH'); -IF &ctoken EQ '*' THEN GOTO EXITVARS ELSE GOTO CONT; -CONT -SET &ctoken.&I = '''' || &ctoken || ''''; -SET &inList = IF &I EQ 1 THEN &ctoken.&I ELSE &inList | ',' | &ctoken.&I; -ENDLOOP -EXITVARS[This message has been edited. Last edited by: <Mabel>,
I do have echo set on. I can't see any output because the page hangs halfway through. Nothing loads at all. Just a blank page with the progress bar halfway is what I see.
I've tweeked your program a bit and it works in 5.3.2. It should work in 5.2, probably not in 4.3 since there's probably line-length issues. Give this a try. The TRIM isn't doing anything since the output of the TRIM is being put in a DM variable that's the same length as the input.
No dice, Pietro De Santis. It seems like its a limitation to our WebFocus version from what I understand. Others ran into the same problem. Thanks anyways. Unless anyone knows of a work around to this?
-SET &outList = IF &I EQ 1 THEN &ctoken.&I ELSE &outList || ',' || &ctoken.&I; -ENDLOOP
-EXITVARS
-SET &TIMES = &I - 1;
TABLE FILE CAR PRINT MODEL WHERE COUNTRY IN ( -REPEAT ENDLOOP2 FOR &J FROM 1 TO &TIMES; &ctoken.&J -ENDLOOP2 ); ENDThis message has been edited. Last edited by: <Mabel>,
Have you tried to run the code I posted? It is a working example and should work on all versions of FOCUS. What may be the problem is the length of the token, if it really is 60, then there should be no problem, if it's longer than 78, then there may be a problem.
What is the error you're getting? Could you post us the ECHOed code?
I wasn't receiving a error but the report was bringing back no data for the sample code you last replied with. It's ok though, I figured out a work around to my problem. My other post about 'Remove trailing spaces from GETTOK' you were so graciously helped me with, helped in solving this problem. Instead of getting a token at a specific location I trimmed off the last token received from the begining of the list. For some reason our version of WebFocus kepting hanging when I had more than 6 or so tokens for any list I parsed through using the looping method shown above.
Pseudo code 1. Get token at position 1 from List A 2. Append token to new list with single quotes 3. Trim token off List A 4. Repeat