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.

New TIBCO Community Coming Soon
In early summer, TIBCO plans to launch a new community—with a new user experience, enhanced search, and expanded capabilities for member engagement with answers and discussions! In advance of that, the current myibi community will be retired on April 30. We will continue to provide updates here on both the retirement of myibi and the new community launch.

What You Need to Know about Our New Community
We value the wealth of knowledge and engagement shared by community members and hope the new community will continue cultivating networking, knowledge sharing, and discussion.

During the transition period, from April 20th until the new community is launched this summer, myibi users should access the TIBCO WebFOCUS page to engage.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] MAINTAIN file name question

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] MAINTAIN file name question
 Login/Join
 
Silver Member
posted
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,
Ron

This message has been edited. Last edited by: Kerry,
 
Posts: 38 | Location: Milwaukee | Registered: April 28, 2005Report This Post
Gold member
posted Hide Post
Might be simplistic, but can't you populate an amper variable with the file name before the MAINTAIN statement?

-* strip the month and year from the system date and append to the static text.
-SET &FILENAME = 'ybmart' | 'yr_mth' ;
MAINTAIN FILE &FILENAME
.....


Laure


Prod: WebFOCUS 7.7.03 - MRE, BID, - WindowsXP - Oracle 9i, SQLServer, DevStudio 7.7.3 - Apache Tomcat , Output: HTML, Excel 2013 and PDF
 
Posts: 78 | Location: Florida | Registered: December 07, 2006Report This Post
Silver Member
posted Hide Post
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, 2005Report This Post
Master
posted Hide Post
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, 2003Report This Post
Silver Member
posted Hide Post
Mark,
Thanks for clearing this up. I wasn't making the correct distinction between a fex and a mnt. I didn't know there was that big of a difference.

Unfortuantely we use this monthly file naming technique in a number of different instances, which makes using MAINTAIN a tough sell.

Ron

Ron
 
Posts: 38 | Location: Milwaukee | Registered: April 28, 2005Report This Post
Master
posted Hide Post
Ron
Please let me know if I can be of any assistence in any way. You can e-mail me directly at:
Mark_Derwin@IBI.Com

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Platinum Member
posted Hide Post
Ron,

If the databases are Focus files you could:

-SET &DBNAME = 'YBMART' || &MONTH || '.foc';

USE &DBNAME AS YBMART
END

So you would have one Master for the maintain, and a sliding datasource name. I'm not sure if this will work, but it is another approach.

Or, maybe you could change the DATASET attribute in a common Master, but only for Focus, VSAM, or flat file types.


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
 
Posts: 165 | Location: Detroit Metro | Registered: September 17, 2003Report This Post
Virtuoso
posted Hide Post
Ron,

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, 2007Report This Post
Member
posted Hide Post
Ron:

Try these
DYNAM ALLOC FILE [master name] DA [file included server path] SHR REU


WebFOCUS 7.6.5
Windows
 
Posts: 6 | Registered: October 15, 2008Report This Post
Silver Member
posted Hide Post
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, 2005Report 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     [SOLVED] MAINTAIN file name question

Copyright © 1996-2020 Information Builders