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 need to concatenate a list of company names separated by a comma. We can have up to 2000 companies to list. Is there another way for me to accomplish this? It appears that there is an & variable limit length of 7000 because if I select 140 records, it works fine. If I select 141 I get an EDA Server Crash error.
-SET &ctr = 1 ; -SET &&NEWCOMPANYNAME = '';
TABLE FILE DIRECTDB_COMPANYDIMENSION BY COMPANYID NOPRINT BY COMPANYNAME ON TABLE HOLD AS HCOMPANY END
Currently we list all companies that could be used in the query criteria for our reports. It will very seldom reach that limit but it has the potential to do so. I will check to see if I can just set the limit at 140. Thanks.
Posts: 118 | Location: Wisconsin | Registered: January 16, 2008
I could try create a couple more loops and sequentially rename them based on the count and then concatenate all of the & variables after it is finished. Rather kludgy but as a last resort I will probably try it.
Do you have any idea why this syntax doesn't work. It concatenates exactly the way it is supposed to but truncates the result at 1220 characters. As the next new company is concatenated, it drops off the first one to add the next one. Why won't this use the full A7000 available? It can't get any more straight forward than this.
DEFINE FILE DIRECTDB_COMPANYDIMENSION DUMY/A1 = '' ; END
TABLE FILE DIRECTDB_COMPANYDIMENSION PRINT DUMY COMPUTE D_NEWCOMPANY/A7000 = IF DUMY EQ LAST DUMY THEN COMPANYNAME || ',' | SUBSTR(7000, LAST D_NEWCOMPANY, 1, 7000, 7000, 'A6000') ELSE COMPANYNAME ; ON TABLE HOLD AS HCOMPANY END
Posts: 118 | Location: Wisconsin | Registered: January 16, 2008
TABLE FILE DIRECTDB_COMPANYDIMENSION PRINT DUMY COMPUTE D_NEWCOMPANY/A7000 = IF DUMY EQ LAST DUMY THEN COMPANYNAME || ',' | SUBSTR(7000, LAST D_NEWCOMPANY, 1, ---- needs this 6000, 6000, 'A6000') ELSE COMPANYNAME ; ---- needs this ON TABLE HOLD AS HCOMPANY END
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006
John, It does not matter how you massage the code A7000 is not valid.
The rules are
alphanumeric in a Focus DB maximum 3968 characters
alphanumeric in a XFocus DB maximum 4096 characters
alphanumeric in a Fixed format file maximum 4095 characters
If your query (where you will use the list of companies) is in FOCUS, why not create a file with one comapny on each line? Then it will not matter how many companies you have, and you can use the IN FILE syntax.
Diptesh WF 7.1.7 - AIX, MVS
Posts: 79 | Location: Warren, NJ, USA | Registered: October 25, 2006
Diptesh, That is not going to work if you potentially have a file of upto a 100K because of the 16K limit for a file used in WHERE and the 32K limit using IF
A way to create the string that you require in a flat file is to pre allocate the file as a fixed length file. This will write the file without the normal CR/LF.
And effectivly create a single row of your potentially needed 100,000 bytes with no problem but there are limitations on what you can do with that data record in WebFocus.
In your case the code would be
FILEDEF HCOMPANY DISK HCOMPANY.FTM (LRECL 51 RECFM F -RUN TABLE FILE DIRECTDB_COMPANYDIMENSION PRINT COMPUTE D_NEWCOMPANY/A51 = COMPANYNAME | ','; ON TABLE SET HOLDLIST PRINTONLY ON TABLE SAVE AS HCOMPANY END -RUN -SET &MAXLRECL=(&LINES * 51) + &LINES; -READ HCOMPANY &FULLRECL.A&MAXLRECL.EVAL.
The output file will appear as a single string. However it does add a leading space to each D_NEWCOMPANY.
The -READ will create a variable upto 32740 bytes (WF 7.6.7)
This is a built in WebFocus Limitation.
Any number between 32740 and 32767 (32K -1) crashes the server and any number above 32768 (32K) returns an invalid format error.
There is NO WAY that you can concat to any total variable length greater than 32767 (32K -1) it will crash the server.
I still have to ask though, Why do you need such a potentially long string variable?
It can not be used for anything in WebFocus and the only way to print it would be landscape on a toilet roll.
Please consider this closed. I am unable to produce the output that is necessary for our reports so I am going to generate the string with a SQL stored procedure and pass that to a fex to display on the report. I used a substring function to remove the trailing blanks but then when I use -READ for that field, it adds the empty characters back into the field. Thanks for your help.
Posts: 118 | Location: Wisconsin | Registered: January 16, 2008