Index
As you know, you can get a CSV file (or a TXT, XLS and so on file) from the result of a query with ACS SQL Script… but if you need to generate a CSV directly from a SQL script you could mix SQL and CL command, as in the following example where we get a CSV file an IFS directory from a query on a NETSTAT system view:
create table qtemp.netstat as
(SELECT *
FROM qsys2.netstat_info)
with data;
cl: CPYTOIMPF FROMFILE(QTEMP/NETSTAT)
TOSTMF('/home/faq/netstat.csv')
STMFCCSID(PCASCII) RCDDLM(CRLF) ADDCOLNAM(*SQL);
And if you want schedule or call this script from another program you could execute it with RUNSQLSTM, as in this simple CL program
PGMRUNSQLSTM SRCFILE(FAQ400/SRC) SRCMBR(XNETSTAT) COMMIT(*NONE) OUTPUT(*PRINT)ENDPGM
Page: 1 2
Following a recent discussion on IBM TechXchange, I’d like to share a very useful guide by Anna Niederschulte about configuring…
I want to highlight the second post by Massimo Duca in his SQL Tips series. In this installment, we see…
Today I’d like to share an interesting article written by Marco Riva on his blog Markonetools: “Non è bello far…
I’d like to share with you this interesting post by Massimo Duca, the first in a series of articles dedicated…
In my last article “Remove old spooled files to keep track of the number of jobs in the system” I…
The system value QMAXJOB (valid range: 32,000 - 970,000; default = 163,520) defines the maximum number of jobs that can…