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.

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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]Reusing FTM in a report

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Reusing FTM in a report
 Login/Join
 
Silver Member
posted
Hello everyone!

I currently have a scheduled procedure that fires off each day, and adds its' output to an ftm file. The cumulative output is emailed to me each day as a spreadsheet.

Here is the basic logic:

FILEDEF HOLD_APP DISK holdapp/2018Summary.ftm

(REPORT LOGIC)

TABLE FILE HOLD1
SUM
FIELD1
FIELD2
(ETC)
BY FIELD3
BY DATE
BY HIGHEST FIELD4
ON TABLE HOLD AS HOLD_APP
END

TABLE FILE HOLD_APP
PRINT
FIELD1
FIELD2
FIELD3
(ETC)
ON TABLE PCHOLD FORMAT XLSX
END

How would I go about using the accumulated data from 2018Summary.ftm in a separate report? I looked at "Saving and Retrieving HOLD files" in the user manual, but I'm messing something up.

I've tried:

APP PATH HOLDAPP

FILEDEF 2018SUMMARY DIR holdapp\2018summary.ftm

TABLE FILE 2018SUMMARY
PRINT *
END

but I don't have any metadata associated with 2018summary. I thought using HOLD AS would create the metadata, but that doesn't seem to be the case. Can anyone point me in the right direction?

This message has been edited. Last edited by: rray9895,


WebFOCUS 8.105M, Windows 10, App Studio
 
Posts: 47 | Registered: October 22, 2014Report This Post
Expert
posted Hide Post
The Master for the Hold file will disappear at the end of the request.

Try this:

ON TABLE HOLD AS holdapp/2018Summary
This will save the Master in app folder holdapp.

And then

TABLE FILE holdapp/2018SUMMARY


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Silver Member
posted Hide Post
quote:
Originally posted by Francis Mariani:
The Master for the Hold file will disappear at the end of the request.

Try this:

ON TABLE HOLD AS holdapp/2018Summary
This will save the Master in app folder holdapp.


I'm getting help from a legend.

One thing, I forget when writing my code in the example that I am APPENDING

so it actually looks like
FILEDEF HOLD_APP DISK holdapp/2018Summary.ftm (APPEND


does that effect how I need to reference it? I would think I would need the ON TABLE HOLD AS HOLD_APP in order for it to append, or am I overthinking it?


WebFOCUS 8.105M, Windows 10, App Studio
 
Posts: 47 | Registered: October 22, 2014Report This Post
Expert
posted Hide Post
Providing that the fields and their formats do not change, you should be OK in doing that.

However, a more secure / robust(?) method would be to insert the output from HOLD1 into a table (be it FOCUS or RDBMS etc.) using SQL or FOCUS MODIFY - depending upon your skills.

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, 2004Report This Post
Silver Member
posted Hide Post
DBMS is a no go. If I'm understanding you correctly, that would be placing the output directly in our database. That would be a nightmare to finagle considering how rarely I need to do this. Our IT department keeps that too locked down.

quote:
However, a more secure / robust(?) method would be to insert the output from HOLD1 into a table (be it FOCUS


Where would I go to get some more information about this?


WebFOCUS 8.105M, Windows 10, App Studio
 
Posts: 47 | Registered: October 22, 2014Report This Post
Silver Member
posted Hide Post
Alright, I'm still not doing something correctly apparently

APP PATH IBISAMP HOLDAPP

FILEDEF HOLD_TEST DISK holdapp/HOLDtest2.ftm (APPEND

TABLE FILE CAR
PRINT COUNTRY
CAR
MODEL
WHERE RECORDLIMIT EQ 1
ON TABLE HOLD AS holdapp/HOLDtest2.ftm
END



I'm getting the ftm file, but it still isn't producing metadata. I'm overlooking something simple, I'm sure but I'm not sure what.


WebFOCUS 8.105M, Windows 10, App Studio
 
Posts: 47 | Registered: October 22, 2014Report This Post
Expert
posted Hide Post
1. Your DDNAME is HOLD_TEST, your ON TABLE HOLD AS is not referencing your FILEDEF.
2. Your APP PATH command is overriding what you have access to.

To check what you have access to, at the top of any focexec, do:
? PATH
-EXIT

This will display all folders availble to you; see if holdapp is there.

If not, Change to baseapp(AND, don't use mixed case, it will all be converted to lowercase anyway):

  
-* Don't do this
-* APP PATH IBISAMP HOLDAPP

FILEDEF HOLD_TEST DISK baseapp/holdtest2.ftm (APPEND

TABLE FILE CAR
PRINT COUNTRY
CAR
MODEL
WHERE RECORDLIMIT EQ 1
ON TABLE HOLD AS HOLD_TEST FORMAT ALPHA
END


The above works fine...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Silver Member
posted Hide Post
Tom,

Without the APP PATH I get this:

 0 ERROR AT OR NEAR LINE      3  IN PROCEDURE ADHOCRQ FOCEXEC *
 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: CAR
 BYPASSING TO END OF COMMAND


The CAR synonym is in the IBISAMP app path. Several tables I reference are not in baseapp, and I always have to reference APP PATH in order to use them in a procedure.


WebFOCUS 8.105M, Windows 10, App Studio
 
Posts: 47 | Registered: October 22, 2014Report This Post
Expert
posted Hide Post
That means your APP PATH is not set up on your Reporting Server, OR, ibisamp is not part of the path(should be, talk to your admin).
Fine, include it, all will still work, IF, holdapp is a valid folder...
If not, APP PATH IBISAMP BASEAPP AnyOtherFolderThatIsRequired...

Main thing is to use the DDNAME of the FILEDEF...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Silver Member
posted Hide Post
Tom,

I think I'm not communicating something correctly. Creating the ftm file in the application path isn't a problem, I also need it to create the metadata. Using the method you described above (APP PATH logic discussion is kind of getting us off track), the holdtest2.ftm file is getting created but I still don't have a synonym to reference in another procedure.


WebFOCUS 8.105M, Windows 10, App Studio
 
Posts: 47 | Registered: October 22, 2014Report This Post
Expert
posted Hide Post
Add APP HOLD BASEAPP after your APP PATH


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
FILENAME=HOLD_TEST, SUFFIX=FIX , IOTYPE=STREAM, $
SEGMENT=HOLD_TES, SEGTYPE=S0, $
FIELDNAME=COUNTRY, ALIAS=E01, USAGE=A10, ACTUAL=A10, $
FIELDNAME=CAR, ALIAS=E02, USAGE=A16, ACTUAL=A16, $
FIELDNAME=MODEL, ALIAS=E03, USAGE=A24, ACTUAL=A24, $


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
According to the doc:
APP HOLDMETA appname Specifies the application name for HOLD Master Files.

Wouldn't that force the master file for your hold file to go to a specific app path?


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Silver Member
posted Hide Post
quote:
Originally posted by BabakNYC:
According to the doc:
APP HOLDMETA appname Specifies the application name for HOLD Master Files.

Wouldn't that force the master file for your hold file to go to a specific app path?

APP PATH IBISAMP
APP HOLDMETA HOLDAPP

FILEDEF HOLD_TEST DISK holdapp/holdtest2.ftm (APPEND

TABLE FILE CAR
PRINT COUNTRY
CAR
MODEL
WHERE RECORDLIMIT EQ 1
ON TABLE HOLD AS HOLD_TEST FORMAT ALPHA
END


Result: FTM file created, No metadata created

quote:
Add APP HOLD BASEAPP after your APP PATH


APP PATH IBISAMP HOLDAPP
APP HOLD HOLDAPP

FILEDEF HOLDTEST2 DISK holdapp/holdtest2.ftm (APPEND

TABLE FILE CAR
PRINT COUNTRY
CAR
MODEL
WHERE RECORDLIMIT EQ 1
ON TABLE HOLD AS HOLDTEST2 FORMAT ALPHA
END


Result: This totally works. My ftm file is getting created, AND I've got metadata. However, when I reference it in another procedure:

APP PATH HOLDAPP

TABLE FILE HOLDTEST2
PRINT *
END


Zero records returned.

I go to the reporting server and look at the synonym, I do sample data and get the same result.

My ftm file is at holdapp/holdtest2.ftm
My synonym (holdapp/holdtest2.mas) looks like this:

quote:
FILENAME=HOLDTEST2, SUFFIX=FIX , IOTYPE=STREAM, $
SEGMENT=HOLDTEST, SEGTYPE=S0, $
FIELDNAME=COUNTRY, ALIAS=E01, USAGE=A10, ACTUAL=A10, $
FIELDNAME=CAR, ALIAS=E02, USAGE=A16, ACTUAL=A16, $
FIELDNAME=MODEL, ALIAS=E03, USAGE=A24, ACTUAL=A24, $


I'm so close, yet so far.


WebFOCUS 8.105M, Windows 10, App Studio
 
Posts: 47 | Registered: October 22, 2014Report This Post
Expert
posted Hide Post
When reporting from the file:
 
APP PATH HOLDAPP
FILEDEF HOLDTEST2 DISK holdapp/holdtest2.ftm
-RUN
TABLE FILE HOLDTEST2
PRINT *
END
 

OR - this may work as well...
APP PATH HOLDAPP
-RUN
TABLE FILE holdapp/HOLDTEST2
PRINT *
END
 

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Silver Member
posted Hide Post
That is it!

Figured it out!

I needed to include the FILEDEF when referencing it

APP PATH IBISAMP HOLDAPP

FILEDEF HOLDTEST2 DISK holdapp/holdtest2.ftm

TABLE FILE HOLDTEST2
PRINT *
END


Totally works!

Thank you all for your help!


WebFOCUS 8.105M, Windows 10, App Studio
 
Posts: 47 | Registered: October 22, 2014Report 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]Reusing FTM in a report

Copyright © 1996-2020 Information Builders