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 am getting a list of values from an amper variable (for example: France,England,Germany). I would like to display this list in my heading but sorted in ascending alphabetical order. Should I do a TABLE request off of this list? If so, how can I turn the amper into a data source? If not, are there better ways of doing this (assuming that I can not necessarily receive the list sorted).This message has been edited. Last edited by: ChannyS,
There a probably dozens of ways to do this. You could write them to a temp file, use a generic master filedef'd to this file to sort them and write another file. You can then do a repeat loop to read them into indexed variables which you can use in your heading.
I think Ginny's suggestion is the easiest and simplest way. There are examples in this forum of writing stuff to a temp file and writing out temp masters, and reading from a file.
As you are running windows you could do as Ginny suggests but instead of creating a generic MFD you could just issue a DOS command via the SYSTEM function to perform a DOS SORT on the temp file, then read it back in. Just as easy and could be adapted to any platform.
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
If all the values are separated by a comma space sequence, the following WF code will convert the one-line list into separate lines and sorting them (on Windows):
But you still have to have the values on separate lines. I didn't state that in my first post as I thought it was obvious. So do the first part of Waz' post then the TABLE with the default master. Or make a special master specific to the solution.
Yes, that would, in a sense, be the easiest solution.
However, I didn't want to necessarily rely on the front end to do the sorting. 1. Front ends aren't always built by the same team as the back ends and we can't always dictate to them what to do. 2. What if a new front end is built one day - do they know that they have to sort the data? Relying on the front end means that forever more, any front end that is built against your report will necessary conform to your rules. If possible, I'd rather have my reports do the work that they deem as necessary rather than rely on those calling my reports to do the work for me.
-DEFAULT &TESTVAR='UnitedStates, India, Germany, England, Italy';
-**This will separate the values and put in row wise (line by line). -SET &CRLF= HEXBYT(13,'A1') | HEXBYT(10,'A1') ; -SET &TEXT2=STRREP( &TESTVAR.LENGTH, &TESTVAR, 2, ', ', 2, &CRLF, &TESTVAR.LENGTH, 'A&TESTVAR.LENGTH' );
-**THIS COMMAND WILL RETURN THE WINDOWS SETTINGS, PATH AND CLASSPATH.
FILEDEF TEXT2 DISK C:\Kamesh\TEXT2.DAT -RUN
? FILEDEF
- TYPE BEFORE PROCESS
-**Writes the value in to file (line by line). -WRITE TEXT2 &TEXT2 -RUN -CLOSE TEXT2
-**Sorting the values using DOS command and saving it in separate file. -DOS SORT C:\Kamesh\TEXT2.DAT > C:\Kamesh\TEXT3.DAT
-DOS TYPE C:\Kamesh\TEXT2.DAT -DOS TYPE C:\Kamesh\TEXT3.DAT
-**It will clear the old file from cache. FILEDEF TEXT2 CLEAR
-**Retrieving the sorted file FILEDEF TEXT3 DISK C:\Kamesh\TEXT3.DAT -RUN