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 new to web focus so my quesiton might be rather basic. I'm trying to figure out what code/funtion to use to break out a value in a field. I'm hoping that a define statement could be used. The data currently has two pieces of information concatenated together - booking number and passenger number. The booking number portion of the value can change in length, but the passenger number value is alwys the last three charcters In example 9TRS6A01A, the booking number is 9TRS6A and the passenger number is 01A. I know in excel and Access that a function can be used to count the length of the field and then use a left Function statement minus three to get only the booking number value. Does such functions exist in Web Focus or is there any other technique that I should use so I can create a field value that is only the booking number?
ThanksThis message has been edited. Last edited by: Kerry,
Webfocus 76 Platform: IBM P5 Operating System: AIX EXCEL, PDF, HTML
You'll have to download the "Using Functions" manual for this. See the doc link in the upper right corner of this page. And yes, you can do this in a DEFINE or a COMPUTE.
You will first use the ARGLEN function to determine how many significant characters, not trailing spaces, are in the field. You can then use this number and some arithmetic to figure out how to use two SUBSTR functions to extract the two fields. For instance, in your example, ARGLEN would return a 9. By subtracting 3, you would know the length of the booking number, etc.
To my fellow posters, don't post the code just yet. Let's see what Cruzer can do with the hints above.
Cruzer, if this doesn't help, post again and we'll give you more clues.
Another, maybe simpler, method would be to do an edit on the right justified field. You can do this in define or compute as a one-liner: something like edit(rjust(field,.,.),'$..$999'). And Ginny is right - look up the Using Functions manual, it descibes it all.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
You could also use the reverse() function, grab the first three characters with an edit, and then use reverse on your output to get it back to the correct value.
WF 7.7.05 HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files HTML, Excel, PDF
I find function in Focal Forum like Linus suggest by search "right character". I still no understand why people not use search in Focal Forum. Many other forum use search but Focal Forum have tech support as well.
Each search find me many post, I read and learn. Lots of solution very quick
Kofi
Client Server 8.1.05: Apache; Tomcat;Windows Server 2012 Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012
Also download "Creating Reports with WebFOCUS Language" for your version. On very basic questions like this, you are apt to be told to read the manual.
Pat WF 7.6.8, AIX, AS400, NT AS400 FOCUS, AIX FOCUS, Oracle, DB2, JDE, Lotus Notes
Posts: 755 | Location: TX | Registered: September 25, 2007
Here's another thought. If the two pieces of information are seperated by a character (space, dash, tilde, etc) look up POSIT to help determine the length of both pieces of information. This way if the length of the passenger number ever changes, you do not have to change your code.
Originally posted by Kofi: I still no understand why people not use search in Focal Forum. Many other forum use search but Focal Forum have tech support as well.
to me such a skill would be a pre-requisite for a position here as a WF developer - the ability to take the initiative to look it up yourselves
Developer Studio 7.64 Win XP Output: mostly HTML, also Excel and PDF
"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
Posts: 285 | Location: UK | Registered: October 26, 2007
While I do think it's necessary to point out to people that the there is search function for the forum, it's not always that easy when you are completely new.
I know when I first started writing reports in webfocus, I was bewildered by the conflicting choices to getting things done. Coming from a limited language background (RPG), having multiple ways to total columns (SUBTOTAL,SUB-TOTAL(WHAT?), SUBFOOT etc.) was just not getting into my thick skull. I searched, got a hundred posts but was unable to decipher which pertained to my situation.
But with the help of people like Susannah, Ginny, MGrackin, pietro, etc. And yeah, they chastised me for not searching properly, but eventually I was able to move forward and get a grip around how this WF thing works. So sometimes just asking a question and getting a reasonable answer, or just a hint on what to search for, can do more for person and get them to a point where they can be more self-sufficient, faster than just reading forums and manuals.
/RANT OFF
Lloyd Prendergast Michael Kors (USA), Inc. Phone: 201-453-5076 Fax: 646-354-4776 Lloyd.Prendergast@Michaelkors.com