Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Amper variable size limit?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Amper variable size limit?
 Login/Join
 
<kvn>
posted
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>,
 
Report This Post
Expert
posted Hide Post
what i would do is set echo on and run it and look at the output to see where the breakdown is happening.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
<kvn>
posted
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.
 
Report This Post
<Pietro De Santis>
posted
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.

If you have any questions, please ask.

Pietro.
 
Report This Post
<Pietro De Santis>
posted
Whoops - forgot the program!

-SET &ECHO=ALL;

-SET &inList =
'ABCDEF000#ABCDEF001#ABCDEF002#ABCDEF003#ABCDEF004#ABCDEF005#
ABCDEF006#
ABCDEF007#ABCDEF008#ABCDEF009#' ||
- 'ABCDEF010#ABCDEF011#ABCDEF012#ABCDEF013#
ABCDEF014#ABCDEF015#ABCDEF016#
ABCDEF017#ABCDEF018#ABCDEF019#' ||
- 'ABCDEF020#ABCDEF021#ABCDEF022#ABCDEF023#
ABCDEF024#ABCDEF025#ABCDEF026#
ABCDEF027#ABCDEF028#ABCDEF029#' ||
- 'ABCDEF030#ABCDEF031#ABCDEF032#ABCDEF033#
ABCDEF034#ABCDEF035#ABCDEF036#
ABCDEF037#ABCDEF038#ABCDEF039#' ||
- 'ABCDEF040#ABCDEF041#ABCDEF042#ABCDEF043#
ABCDEF044#ABCDEF045#ABCDEF046#
ABCDEF047#A
BCDEF048#ABCDEF049#' ||
- 'ABCDEF050#ABCDEF051#ABCDEF052#ABCDEF053#ABCDEF054#ABCDEF055#
ABCDEF056#ABCDEF057#
ABCDEF058#ABCDEF059';

-SET &outList = '';

-REPEAT ENDLOOP FOR &I FROM 1 TO &inList.LENGTH

-SET &VAR.&I = &I ;
-SET &ctoken = GETTOK(&inList, &inList.LENGTH, &I, '#', 60, A60) ;
-*-SET &ctoken = TRIM('B', '&ctoken', &ctoken.LENGTH, ' ', 1, 'A&ctoken.LENGTH');
-IF &ctoken EQ '' THEN GOTO EXITVARS ELSE GOTO CONT;
-CONT
-SET &ctoken.&I = '''' || &ctoken || '''';

-SET &outList = IF &I EQ 1 THEN &ctoken.&I ELSE &outList || ',' || &ctoken.&I;
-ENDLOOP

-EXITVARS

TABLE FILE CAR
PRINT MODEL
WHERE COUNTRY IN
(
&outList
);
END

This message has been edited. Last edited by: <Mabel>,
 
Report This Post
<kvn>
posted
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?
 
Report This Post
<Pietro De Santis>
posted
This should work. What version are you on?

-SET &ECHO=ALL;

-SET &inList =
- 'ABCDEF000#ABCDEF001#ABCDEF002#ABCDEF003#
ABCDEF004#ABCDEF005#ABCDEF006#ABCDEF007#
ABCDEF008#ABCDEF009#' ||
- 'ABCDEF010#ABCDEF011#ABCDEF012#ABCDEF013#
ABCDEF014#ABCDEF015#ABCDEF016#ABCDEF017#
ABCDEF018#ABCDEF019#' ||
- 'ABCDEF020#ABCDEF021#ABCDEF022#ABCDEF023#
ABCDEF024#ABCDEF025#ABCDEF026#ABCDEF027#
ABCDEF028#ABCDEF029#' ||
- 'ABCDEF030#ABCDEF031#ABCDEF032#ABCDEF033#
ABCDEF034#ABCDEF035#ABCDEF036#ABCDEF037#
ABCDEF038#ABCDEF039#' ||
- 'ABCDEF040#ABCDEF041#ABCDEF042#ABCDEF043#
ABCDEF044#ABCDEF045#ABCDEF046#ABCDEF047#
ABCDEF048#ABCDEF049#' ||
- 'ABCDEF050#ABCDEF051#ABCDEF052#ABCDEF053#
ABCDEF054#ABCDEF055#ABCDEF056#ABCDEF057#
ABCDEF058#ABCDEF059';

-SET &outList = '';

-REPEAT ENDLOOP FOR &I FROM 1 TO &inList.LENGTH

-SET &VAR.&I = &I ;
-SET &ctoken = GETTOK(&inList, &inList.LENGTH, &I, '#', 60, A60) ;
-*-SET &ctoken = TRIM('B', '&ctoken', &ctoken.LENGTH, ' ', 1, 'A&ctoken.LENGTH');
-IF &ctoken EQ '' THEN GOTO EXITVARS ELSE GOTO CONT;
-CONT
-SET &ctoken.&I = '''' || &ctoken || '''';

-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
);
END

This message has been edited. Last edited by: <Mabel>,
 
Report This Post
<kvn>
posted
5.2.3 I believe. No luck with that approach either. It didn't like the WHERE clause being made like that. Oh well. Thanks for all your help though.
 
Report This Post
<Pietro De Santis>
posted
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?
 
Report This Post
<kvn>
posted
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

This method worked.
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Amper variable size limit?

Copyright © 1996-2020 Information Builders