Focal Point
[CLOSED] Is it Possible to do Multiple EXEC or EX commands in one procedure?

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

September 26, 2019, 03:07 PM
J.Hines
[CLOSED] Is it Possible to do Multiple EXEC or EX commands in one procedure?
The full use case of this is looping through a list (or HOLD file) of FEX names and executing each one deferred. I have no idea whether that's possible or if there's a better way to think about that.

For right now, I'm just wondering if I can do multiple EXEC/EX (not sure which is better; I just found out about this command today). Right now, this is only running the first report:

 
-SET &BOD = 'SEDAN';
-SET &SEA = 4;
-SET &rpt1 = 'jdhcarbody';
-SET &rpt2 = 'jdhcarseats';
-RUN
EX &rpt1 BODY=&BOD
EX &rpt2 SEAT=&SEA
-RUN
 




THANKS!

This message has been edited. Last edited by: FP Mod Chuck,



Prod: 8.2.0.4 OS:Windows 10 Output:AHTML, Excel 2007+

The life of a designer is a life of fight against the ugliness.
September 26, 2019, 03:27 PM
MartinY
Should work to run multiple. I do have.
But try as per the following way :

-SET &BOD = 'SEDAN';
-SET &SEA = 4;
-SET &rpt1 = 'jdhcarbody.fex';
-SET &rpt2 = 'jdhcarseats.fex';
-RUN
EX &rpt1 BODY=&BOD
EX &rpt2 SEAT=&SEA
-RUN



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
September 26, 2019, 05:05 PM
Waz
I would suggest adding a -RUN between the EX commands, but it should work.

Assuming your fexes are on the reporting server and not in the repository.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

September 27, 2019, 08:15 AM
J.Hines
@MartinY: Thanks. So your change was just adding ".fex" right? Those 2 reports are XLSX format, and if Excel is open, then 2 reports to run, but it's two instances of the first report. If Excel has to be started, then only the first runs. So in either case, I'm not getting the 2nd report.

@Waz: they are on the reporting server for my contrived example, but my real use case is in the repository. What would be different about trying to do it from there, because that translation always trips me up.



Prod: 8.2.0.4 OS:Windows 10 Output:AHTML, Excel 2007+

The life of a designer is a life of fight against the ugliness.
September 27, 2019, 11:16 AM
MartinY
quote:
Originally posted by J.Hines:
@MartinY: Thanks. So your change was just adding ".fex" right? Those 2 reports are XLSX format, and if Excel is open, then 2 reports to run, but it's two instances of the first report. If Excel has to be started, then only the first runs. So in either case, I'm not getting the 2nd report.


Yes, only add ".fex"

Excel output !!! Not the same game. I thought that you were executing several fex to perform HOLD files, not produce Excel output file format.
Not sure that you can to such a thing using EX.
There is a few other technic to produce multiple Excel report but in one Excel file with multiple tabs, not multiple files. Except if you are using Report Caster.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
September 29, 2019, 11:04 AM
Doug
quote:
but it's two instances of the first report. If Excel has to be started, then only the first runs. So in either case, I'm not getting the 2nd report.

Do you use different "AS 'Excel File Name' in the PCHOLD line?




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
September 29, 2019, 05:41 PM
Waz
There is no difference, sort of.

Are the two excel documents to be returned as one or two documents ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

September 30, 2019, 10:02 AM
J.Hines
They need to be returned as multiple documents. Some of them (most actually) already are multi-tab.



Prod: 8.2.0.4 OS:Windows 10 Output:AHTML, Excel 2007+

The life of a designer is a life of fight against the ugliness.
September 30, 2019, 04:50 PM
Waz
Well that is not going to happen as separate documents

As far as I know WebFOCUS can only return one item for a call.

Could you instead run this via ReportCaster and have it email the two documents ?

You could also call EDAEMAIL and send the documents.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

October 01, 2019, 09:46 AM
jgelona
If the distribution of your documents is the same, run the job in report caster with each "EX" being a separate task. Report caster will return 1 report in a task. If there are multiple reports in a task, the task has to be split up, for example, task 1 collects data, task 2 is report 1, task 3 is report 2, etc. Each report can be a compound document.

If the distribution list for the reports are different, then you have to have Report Caster start the first job, then in the post processing or in the fex it self, have Report Caster fire off the next job, then that job fire the 3rd job and so on. There are several ways to do this. You may be able to use DSTRUN, or Restful Web Services or use MODIFY to update the next run date/time of the job in Report Caster. We use the last method. With WebFOCUS 8, IBI introduced the current security model and since we are a SSO shop, DSTRUN stopped working. It would even work with the alternate security zone. IBI identified a bug with the alternate security zone (vers 8.0.08) and it is supposed to be fixed now but we have already converted to updating the next run date/time and it works so we probably won't go back (we have 60 jobs that run this way). Depending on how your security is configured, it may or may not work. If you search the forum for DSTRUN you'll find a lot of discussions.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
October 01, 2019, 10:38 AM
Doug
quote:
There are several ways to do this
I know that J.Hines is on 8.1.0.4, but, just as added info, ReportCaster (RC) can, as of 8.2.0.4 (or5), run dependent on the successful completion of another RC Job.