|
Rick, We don't do a lot of OPNQRYF's feeding Cobol programs so I can't help you much there, however, I noticed you do not have an OPNSCOPE parm on your OPNQRYF statement. This could bite you depending on how your job calls are set up. The majority of our jobs use OPNSCOPE(*JOB) to ensure that the open query file doesn't carry over into another job. Terry > -----Original Message----- > From: rick.baird@xxxxxxxxxxxxxxx [mailto:rick.baird@xxxxxxxxxxxxxxx] > Sent: Monday, March 15, 2004 11:20 AM > To: COBOL400-L@xxxxxxxxxxxx > Subject: [COBOL400-L] reading a file organized by OPNQRYF > > > Just another quick question from a guy who'd really rather > not have to fart > around with this stuff.... :) I'm converting a bunch of > flat file FMTDTA > stuff to use OPNQRYF instead. > > when reading a file in cobol that's been sorted via opnqryf, is there > anything I need to worry about as far as COBOL syntax? > > this is what I have: > > OVRDBF FILE(HISTRY4) SHARE(*YES) > OPNQRYF FILE((HISTRY4)) QRYSLT( + > 'HPEROD *EQ ' *CAT &PERIOD *BCAT + > '*AND LMRKTC *NE "00" + > *AND HITEM *NE 0') + > KEYFLD((HITEM) (LMRKTC)) > > and in my cobol: > > SELECT HISTRY4 ASSIGN TO DATABASE-HISTRY4 > ORGANIZATION IS INDEXED > ACCESS MODE IS SEQUENTIAL > RECORD KEY IS EXTERNALLY-DESCRIBED-KEY > FILE STATUS IS FILE-STATUS-01. > > OPEN INPUT HISTRY4 > > READ HISTRY4 AT END > MOVE "Y" TO EOF-HISTRY4. > > CLOSE HISTRY4 > > If I'm missing something obvious, I'd appeciate the heads up - I'm > particularly concerned about the ACCESS MODE and RECORD KEY > clauses of the > SELECT Statement. - indexed, sequential with external key - (not the > file's natural key) > > I'm changing a ton of these, and I won't have a chance to > test till I'm > done, and I'd like to get it right the first time. > > Thanks a ton, > > Rick
As an Amazon Associate we earn from qualifying purchases.
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.