Here's a code segment that illustrates a way to reuse an open query file from inside a CL program:
PGM OVRDBF FILE(QCUSTCDT) + SHARE(*YES) OPNQRYF FILE((QCUSTCDT)) + KEYFLD((CITY *DESCEND)) CALL PGM(CUSTLST1) POSDBF OPNID(QCUSTCDT) + POSITION(*START) CALL PGM(CUSTLST2) CLOF OPNID(QCUSTCDT) ENDPGM
The Position Database File (POSDBF) command returns the file pointer to the start of the file. This way, you can process the same selections and reuse the same access path without spending time to process another Open Query File (OPNQRYF) command.
- Mike Hockley
LATEST COMMENTS
MC Press Online