× 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.



On 08-Jan-2015 11:21 -0600, Thomas Burrows wrote:
<<SNIP>>

Have included the CL code.

PGM
DCL VAR(&NUM) TYPE(*DEC) LEN(4 0) VALUE(0)
DCLF FILE(FILE_NAME)

READ: RCVF
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(TAG_END))

CRTDUPOBJ OBJ(SAW_DATA) FROMLIB(FRNTST031) +
OBJTYPE(*FILE) TOLIB(QTEMP) +
NEWOBJ(&FILE_NAMES)
MONMSG MSGID(CPF2130)


FWiW, although probably not an issue, because IIRC the data set was relatively small...

Rather than creating an empty physical file into which some actual data will be copied and thus remain as duplicated storage, the prior CRTDUPOBJ statement and the next CPYF statement could be combined and replaced by a CREATE VIEW such that the DBF export would extract the portioned data via a logical view selecting that data; effectively:

CREATE VIEW QTEMP/&FILE_NAMES AS
( SELECT A.*
FROM FRNTST031/SAW_DATA
WHERE RRN(A) BETWEEN &STR_POS AND &FIN_POS
) -- to mimic effect of MONMSG and MBROPT(*REPLACE),
-- apparently use instead: CREATE OR REPLACE


CPYF FROMFILE(FRNTST031/SAW_DATA) +
TOFILE(QTEMP/&FILE_NAMES) +
MBROPT(*REPLACE) FROMRCD(&STR_POS) +
TORCD(&FIN_POS)

CPYTOIMPF FROMFILE(QTEMP/&FILE_NAMES) TOSTMF('/ +
home/dir1/FILE_NAMES.TXT') +
MBROPT(*REPLACE) STMFCODPAG(*PCASCII) +
RCDDLM(*CR)

GOTO CMDLBL(READ)

TAG_END: ENDPGM

<<SNIP>>

Prior to the loop through the data defining the file names and portions of data to copy, the following derived key access path hopefully would be used for optimization of the statement in the VIEWs:

create index qtemp/saw_data_rrn
on FRNTST031/SAW_DATA
( rrn(SAW_DATA) )


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.