Another option to use might possibly be to write a python script.
I don't know why I've ignored this language for so long, but there are all kinds of things you can do on Windows, Linux and now IBMi with Python and it appears to be fast.
I'm currently working on a presentation on how to build a CL wrapper around your python calls. I'll publish an article when it's ready on the Github site.
This might be an interesting use case to show off the database apis.
FWIW - If Python had been running back on the IBMi a while back I could have saved a lot of time writing RPG and Java layers to create some cool system utilities.
Regards,
Richard Schoen
Director of Document Management
e. richard.schoen@xxxxxxxxxxxxxxx
p. 952.486.6802
w. helpsystems.com
------------------------------
message: 4
date: Wed, 10 Jan 2018 07:16:54 -0500
from: Rob Berendt <rob@xxxxxxxxx>
subject: RE: Convert a database file to Html format
IBM i Access Client Solutions supports:
Comma Separated Values (.csv)
Tab Delimited Text (.txt)
Text (.txt)
Microsoft Excel (.xlsx)
Microsoft Excel 97-2003 (.xls)
OpenOffice (.ods)
Dos Random (.dsr)
We have a few IBM i commands we've downloaded, wrote or modified that are close
Command Library Text
SQL2CSV ROUTINES SQL to CSV
SQL2XLS ROUTINES SQL to Excel
SQL2XML ROUTINES SQL to XML
IBM has a utility called net.data which is pretty simple to use but it's been a long time since I've used it.
https://www-03.ibm.com/systems/power/software/i/netdata/
A simple display of a table could be done with a source member like this %DEFINE { dbtable="ROUTINES.BKPLOG"
DTW_HTML_TABLE = "YES"
DTW_SHOWSQL = "YES"
%}
%FUNCTION(DTW_SQL) query() {
select BLGRPN as Group,
BLLIBN as Library,
BLDATE as Date,
BLTIME as Time,
Case BLMSGN
When 0 then 'Err: Unknown Error'
When 1 then 'Library Saved'
When 2 then 'Err: Partial Save'
When 5 then 'Err: Not Found'
When 6 then 'Err: Save Failed'
Else char(blmsgn)
End as MessageNbr
from $(dbtable)
where (days(current date) -
days(date(substr(digits(bldate),5,2)||'/'||
substr(digits(bldate),7,2)||'/'||
substr(digits(bldate),1,4)) ))<4
and (blmsgn < 3 or
blmsgn in(5,6)
)
order by BLDATE desc, BLTIME desc %}
%HTML(REPORT) {
<HTML>
<BODY>
<H2>Here are the results of your query:</H2>
@query()
</BODY>
</HTML>
%}
Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com
As an Amazon Associate we earn from qualifying purchases.