TechTalk: Reuse an open query file in a CL program.

CL
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

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

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$0.00 Raised:
$