× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I use the old school database job for these things.

With a user option in PDM for the SBMDBJOB command and source members
like the example below, submitting SQL SELECTs to batch is easy.

//BCHJOB JOB(EX_DBJOB) JOBD(MYJOBD) OUTQ(MYOUTQ) +
RTGDTA(QCMDB) +
INLLIBL(+
QTEMP +
MYLIB +
PRODFILES +
UTIL) +
LOG(4 0 *SECLVL) +
LOGCLPGM(*YES) +
INQMSGRPY(*RQD) +
HOLD(*NO) +
SWS(00000000)


OVRPRTF FILE(QPQXPRTF) +
PAGESIZE(*N 198) DRAWER(2) +
SAVE(*YES) OVRSCOPE(*CALLLVL)


RUNSQLSTM SRCFILE(QINLINE) SRCMBR(QINLINE) COMMIT(*NONE) DATFMT(*ISO) +
DBGVIEW(*LIST)


/* For printed output, I use this custom command that uses the STRQMQRY
trick */
EXCSQLSTM SQLSTM('+
select * +
from QTEMP/OUTF +
') OUTPUT(*PRINT)


/* If I want to keep the data in my library, I either CREATE TABLE
directly */
/* to my library or do a CPYF from qtemp to my library.
*/
CPYF FROMFILE(QTEMP/OUTF) TOFILE(MYLIB/MYFILE) MBROPT(*ADD) +
CRTFILE(*YES)


/* Write SQL source between //DATA and //. Insert lines as needed. */
//DATA FILE(QINLINE) FILETYPE(*SRC) ENDCHAR('//') IGCDTA(*NO)
-- Create table
CREATE TABLE QTEMP/OUTF01 AS (
select DISTINCT CVCVCD, CVCVLC, CVDEDC, count(*)
from cvgdetl, cusdetl_DE
where CVCUSN = cdCUSN
and CVRENN = cdRENN
and CVSEQN = cdSEQN
and cdstat = 'DE'
group by CVCVCD, CVCVLC, CVDEDC
) WITH DATA ;
RENAME TABLE QTEMP/OUTF01 TO OUTF ;
//
SNDMSG MSG('Data Base Batch Job complete.') TOUSR(*SYSOPR)
//ENDBCHJOB

HTH,
Reggie

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.