Focal Point
Report from DB2 QTEMP

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

July 08, 2008, 08:46 PM
jelli4908
Report from DB2 QTEMP
Does anyone know if I can create a report from the QTEMP library in DB2?

I currently have an RPG program that generates a report that I need to replicate in WebFOCUS. This program builds temporary files in QTEMP to report against. I don't see any point in "reinventing the wheel", so I would like to run this program then report against the temp files.

Note that I have not tried this yet, but I am wanting to get ideas before I start this project.

Thanks,
Josh


WebFOCUS 8.0.09
Windows, DB2 iSeries, ODBC
Output: Excel, HTML, PDF, AHTML
July 08, 2008, 09:38 PM
Tom Flynn
jelli,

"Welcome" to the WebFOCUS world!!!

QTEMP can be gotten to via your DB2 adapter, or, an ODBC adapter, because it is a directory.

Then, you can create a MASTER/METADATA against all the temporary table(s) you would like to report from.

BUT, what if 12 people run the same program, with different parameters, at the same time, against the same table?? Last in, wins!!!

Unless, you are referring to an aggregate table(s) which hold(s) the data for multiple reports..

If not, in WebFOCUS, these 12 users would have "their own" temporary space where the SQL procedure you wrote, and called from WebFOCUS, to "create" these temporary files in QTEMP, won't be needed in QTEMP anymore.

In WebFOCUS, you would execute the SQL procedure, which would create the termporary files in the user's private/temporary area, the report will then be generated, and, then, at the end of execution, those temporary files would automatically be deleted.

So, in answer to your question, YES, you can access QTEMP and create METADATA/MASTER for all, or, just for the ones you want.

Hope this helps!!!

Tom

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


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
July 08, 2008, 11:06 PM
jelli4908
Tom,

Thank you for the info. Very helpful.

I do however have a question about this statement:

quote:
Originally posted by Tom Flynn:

If not, in WebFOCUS, these 12 users would have "their own" temporary space where the SQL procedure you wrote, and called from WebFOCUS, to "create" these temporary files in QTEMP, won't be needed in QTEMP anymore.

In WebFOCUS, you would execute the SQL procedure, which would create the termporary files in the user's private/temporary area, the report will then be generated, and, then, at the end of execution, those temporary files would automatically be deleted.



If I take this approach, wouldn't I have to reproduce the file the RPG program is creating in SQL? This is what I am trying to avoid so I don't have to redo what someone else has already done. I'm trying to take the lazy route. Smiler But from what you say I may have to regenerate the request in SQL for the concurrent users to run the report?

Thanks,
Josh


WebFOCUS 8.0.09
Windows, DB2 iSeries, ODBC
Output: Excel, HTML, PDF, AHTML
July 09, 2008, 08:12 AM
oztimbotim
I'm assume your running on an AS/400 or iseries box, every job that runs has its own qtemp library, so you will have issues resolving any objects in that qtemp library. You would be better off creating your own temporary holding library and copying your files there after the rpg program has run.


7.6.5 iseries
July 09, 2008, 09:55 AM
Tom Flynn
Hi Josh,

So, the question is:

Will the contents of the file change based on user parameters??
If no, which means the contents of the temporary files will remain stagnant, then you are good to go.
If yes, then there is more analyses to be done.

You've given a generic scenario, I am sure there is more to it. If you are tryin to "replace" a process using RPG
with WebFOCUS, then it "may" have to be re-written; I don't know.

Can you call a RPG program from WebFOCUS. I never have, so, I can't speak to that.

BUT, if you can, and the temp tables are created in QTEMP, you'll need SQL to extract from there as the master will not be generated. Also, from my previous response:

What if 12 people run the same program, with different parameters, at the same time, against the same table?? Last in, wins!!!

Hope this helps...

Tom

P.S.
quote:
I'm trying to take the lazy route.

Seems to always come back and bite me on the a$$. Do the analysis and do it right the 1st time!! (Just my opinion!!)


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe