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.
We have files that we create monthly. Every month the file name changes depending on the month and the year. e.g. ybmart0901, ybmart0902, ect. We are trying to build a maintain app that will allow a user to update the current month file. Is there some way to dynamically enter the maintain file name?
Thanks, RonThis message has been edited. Last edited by: Kerry,
Posts: 38 | Location: Milwaukee | Registered: April 28, 2005
It looks like your idea might work for us. I was told by tech support that there was no way to make a MAINTAIN procedure dynamic. Maybe I asked the question wrong.
Thanks, Ron
Posts: 38 | Location: Milwaukee | Registered: April 28, 2005
Morning Ron - You DID ask the right question. When you are creating a Maintain application with forms, it is not possible to do: MAINTAIN FILE &FILE. The reason for this is, every control that is placed on the form is tagged as: Master.Segment.Field. If your Maintain does not have forms, and the field names ARE the same, then you could probably use Amper Variables and run the procedure as a FEX instead of an MNT.
Now, having said that, there is another thing you can do. Since Maintain DOES store all of the names in the MNT file for both the code and the Winforms you could open the Maintain procedure in Wordpad and do a global replace and change the name of the Master File monthly with the new name. It's more than just changing the file name on the Maintain line. The global replace would change the form objects as well. Again, this assumes that the segment and field names are the same. There may even be a way to do this with a macro.
I hope this helps.
Mark
Posts: 663 | Location: New York | Registered: May 08, 2003
The following will only work if the master/access files are always 100% the same across all the months (except for the naming of the file), and if it works, it will work for all database types.
You could create an html form that lists all the available months. Then you could create a fex that pick up the user's selection, transforms that to the correct name of the master and access file, and copies that master/access file to the current temp directory as master/access file without the month part. Within that copied master/access file references are still being made to the correct month file. Then you could possibly start the maintain, that uses only the master without month extension.
Just my 2ct's, hope it helps ...
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Thanks for all of your suggestions. We’ve come up with a kind of hybrid solution to our multi-month file name issue. What we’ve done is for all queries we use the EXEC command to call a focus procedure. By using this technique, the user can select the file name and we can then pass the filename to the procedure as an argument and get the data back into a MAINTAIN stack.
For all "update" type functionality, we use the CALL command to call a maintain procedure. In the maintain procedure we have an if statement based on the filename selected. We plan on changing the file names at the beginning of each year. By using the EXEC and CALL functionality, we have minimized and compartmentalized the code that will need to be changed each year.
Here is an som example code
Exec ybmartQuery from databasestack().filename sQueryString sRecordLimit into gridstack;
ybmartquery.fex code:
TABLE FILE &1 PRINT * &2 &3 ON TABLE PCHOLD END
CALL UPDATEPROC from gridstack selectperiodstack;
Here is an example of the UPDATEPROC maintain procedure:
MAINTAIN FILES YBMART0901 AND YBMART0902 AND YBMART0903 AND YBMART0904 AND YBMART0905 AND YBMART0906 AND YBMART0907 AND YBMART0908 AND YBMART0909 AND YBMART0910 AND YBMART0911 AND YBMART0912 FROM gridstack selectperiodstack
Infer YBMART0901.SEG01.YBPORT YBMART0901.SEG02.AS_OF_DATE into gridstack; Compute selectperiodstack.filename / A20;
IF selectperiodstack(selectperiodstack.focindex).filename EQ 'ybmart0901' THEN BEGIN For all update YBMART0901.SEG01.ISSUE_NAM YBMART0901.SEG01.TICKER from gridstack(1) ; TYPE "YBMART0901 has been updated"; ENDBEGIN ELSE IF selectperiodstack(selectperiodstack.focindex).filename EQ 'ybmart0902' THEN BEGIN For all update YBMART0902.SEG01.ISSUE_NAM YBMART0902.SEG01.TICKER from gridstack(1) ; TYPE "YBMART0902 has been updated"; ENDBEGIN . . . END
Thanks, Ron
Posts: 38 | Location: Milwaukee | Registered: April 28, 2005