Focal Point
[SOLVED] Generating One Report In Multiple Locations

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1707073236

July 22, 2013, 02:04 PM
Stephen Tetreault
[SOLVED] Generating One Report In Multiple Locations
Hello,

I hope I am posting this in the correct location. I was wondering if it is possible to run a single webfocus report and have its output generate in two separate locations.

For example, my report currently works and I use:

APP MAP FOCHOLD &&SDRIVE|Clients\ClientName\Validation
APP HOLD FOCHOLD
FILEDEF EXAMPLENAME DISK &&SDRIVE|Clients\ClientName\Validation\Client_Summary.pdf


This works for generating a report at this given location. However, when I try something like:

APP MAP FOCHOLD &&SDRIVE|Clients\ClientName\Validation
APP HOLD FOCHOLD
FILEDEF EXAMPLENAME DISK &&SDRIVE|Clients\ClientName\Validation\Client_Summary.pdf
FILEDEF EXAMPLENAME DISK &&SDRIVE|Clients\DifferentClient\Validation\Client_Summary.pdf


It does not generate this output in both locations, it generates the report in the last given location. Is there a way to achieve this? A secondary question would be if there is a way to achieve this, will it work with all file types (mainly PDF and CSV)?

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6
Windows, All Outputs
July 22, 2013, 02:11 PM
Rakesh P
it looks like the the file name is overriding.
try something like this

APP MAP FOCHOLD &&SDRIVE|Clients\ClientName\Validation
APP HOLD FOCHOLD
FILEDEF EXAMPLENAME DISK &&SDRIVE|Clients\ClientName\Validation\Client_Summary.pdf

APP MAP FOCHOLD &&SDRIVE|Clients\ClientName\Validation
APP HOLD FOCHOLD
FILEDEF EXAMPLENAME DISK &&SDRIVE|Clients\ClientName\Validation\Client_Summary.pdf


APP MAP FOCHOLD &&SDRIVE|Clients\ClientName\Validation
APP HOLD FOCHOLD
FILEDEF EXAMPLENAME DISK &&SDRIVE|Clients\DifferentClient\Validation\Client_Summary.pdf


Webfocus 7.1.6, Webfocus 7.7, Webfocus 8
July 22, 2013, 04:20 PM
susannah
what about a simpler approach?
just produce the pdf into your agent
then copy it out to as many places as you want, with a good old DOS command
CMD COPY Client_Summary.pdf &&SDRIVE|Clients\etc...




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
July 22, 2013, 04:29 PM
Stephen Tetreault
Thank you for the response!

Yes, I could always utilize a DOS command I just wanted to know if there was a way to accomplish it within Data Migrator within a webfocus report. This is one example I gave but the functionality would be spread across many clients if there was a quick way to do this within webfocus.

Is there really no way to do this because a .fex or .mas gets generated in one place and cannot be created in multiple locations?


WebFOCUS 7.6
Windows, All Outputs
July 22, 2013, 04:58 PM
Francis Mariani
You can't expect WebFOCUS to generate a report in two locations simply because you issued two FILEDEF statements. Since the two statements use the same 'ddname', the second overrides the first.

You can either run the report request twice or use susannah's idea of copying the file.

I would map the two paths as different apps and then use the APP COPYFILE command to copy the PDF from one app folder to the other:

APP COPYF[ILE] app1[/app1a...] {filename1|*} filetype1 app2[/app2a...]
{filename2|*} {filetype2|*} [IFEXIST] [DROP]



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
July 23, 2013, 02:43 AM
GamP
Think simple ... as Susannah advises.
What about this:
TABLE FILE GGSALES
SUM UNITS
BY CATEGORY
ON TABLE HOLD AS APPFOLDER1/FILE1 FORMAT PDF
END
HOLD AS APPFOLDER2/FILE2 FORMAT PDF
You can repeat this extra HOLD for as many times as you like, provided you do not do anything to 'disturb' the internal matrix (like a -RUN or some other Focus command).


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
July 23, 2013, 08:40 AM
Stephen Tetreault
Thank you for the advice and responses everyone, I will try out what has been recommended here today.


WebFOCUS 7.6
Windows, All Outputs
July 23, 2013, 10:30 AM
Francis Mariani
GamP, very interesting! Where is this documented?


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
July 23, 2013, 10:39 AM
susannah
brilliant , Gamp... i remember this technique now..buried way deep in the gray matter...
July 23, 2013, 05:12 PM
David Briars
quote:
Where is this documented?

I've used this command when I was using FOCUS for z/OS.

In the FOCUS for Mainframe v7.7 manual you will find:
From a report request, use

ON TABLE HOLD [AS filename] [FORMAT fmt] [MISSING {ON|OFF}][VIA program]

or

hold_field HOLD [AS filename] [FORMAT fmt] [MISSING {ON|OFF}][VIA program]

After a report is executed, use

HOLD [AS filename] [FORMAT fmt] [MISSING {ON|OFF}][VIA program]  

I did not see the 'HOLD after a report is executed' in the corresponding section of the WebFOCUS manual/documentation. Perhaps it was inadvertently omitted?

This message has been edited. Last edited by: David Briars,




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
July 23, 2013, 05:27 PM
Francis Mariani
This looks intriguing
quote:
[VIA program]



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
July 23, 2013, 08:43 PM
j.gross
quote:
[VIA program]


It's not the first time you asked about this: ON TABLE HOLD ... VIA program (2005!)


I found one snippet of documentation:

ON TABLE HOLD [AS filename][FORMAT fmt][MISSING {ON|OFF}][VIA program]

. . .

VIA program

For external applications only. It is a user-coded program that creates the HOLD data file. It defaults to the FOCUS internal format for fields; the ALPHA option is also available. Other formats, such as FOCUS or LOTUS, are not available when you use a program with the HOLD command.


-- apparently Focus will feed the program records (rows from the internal matrix), one at a time -- with a record layout corresponding either to SAVB or SAVE format.

(No mention of what is presented of the Table request has multiple verbs ... but I guess the multi-level internal-matrix structure gets flattened)

This message has been edited. Last edited by: j.gross,
July 24, 2013, 10:56 AM
DavSmith
GamP is correct. That is the easiest method to store a couple of one-offs on the fly. I prefer to use report caster ftp if there a lot of report copies that need to be stored.

Performing a separate HOLD/SAVE after the END of the main request has been around since my early VAX days, at least.



In FOCUS since 1985 - WF 8.009/8.104 Win 8 Outputs: ALL of 'em! Adapters: Sql Server Teradata Oracle
July 24, 2013, 12:14 PM
Stephen Tetreault
Kept it simple and used a !COPY /Y command before the "-EXIT" at the end of the report. The "ON TABLE HOLD AS" suggestion was a great idea but since these reports all have "-RUN" in them after each TABLE FILE, it wasn't viable in my case.

Thanks all for the time and suggestions!


WebFOCUS 7.6
Windows, All Outputs