|
Howard I have had success using the method below with the POSDBF cmd. The key to using POSDBF is to read and process the last record...but dont read any further don't set on CPF0864...or LR. Been awhile since I last tried this but it does work once you get it right...I can't remember at this point if the OPNDBF and CLOSE file cmds are necessary... Also it might be more straightforward to just use two CL's like others have mentioned... Best of luck with your program... > PGM > > DCLF QADSPOBJ > > MAINLOOP: > > DSPOBJD OUTFILE(MYLIB/QADSPOBJ)*REPLACE > OVRDBF QADSPOBJ MYLIB/QADSPOBJ > > RTVMBRD MYLIB/QADSPOBJ NBRRCDS(&RECORDS) > > OPNDBF MYLIB/QADSPOBJ > POSDBF *FIRST > > READ: RCVF > > &COUNT = &COUNT + 1 > > ------- > > Proces Record > > ------- > > IF &COUNT *EQ &RECORDS ( last record ) DO > &COUNT = 0 > CLOSE MYLIB/QADSPOBJ > GOTO MAINLOOP > ENDDO > > GOTO READ > > ENDPGM > Weatherly, Howard wrote: > I am having a problem with a CL program that is designed to be a > daemon that continuously monitors a library for data that will be > FTP'd to it. The process works ok on the first iteration but there > after gives a CPF0864 on a RCVF. > > Is there something that I must reset to allow recurring DSPOBJD to an > outputfile to work? It appears that the DSPOBJD is in fact working > each time but when I do the RCVF I get the End of File. > > I have excerpted the control structure from the CL for reference > since I am probable not explaining the problem very well. > > If anyone can help, I sure will appreciate it TIA Howard. > > PGM > > > > DCLF FILE(QSYS/QADSPOBJ) > > . > > . > > REDUEX: > > MONMSG MSGID(CPF2123 CPF4102) EXEC(GOTO + > > CMDLBL(NODATA)) > > . > > . > > DSPOBJD OBJ(CCMSDTA/PASS*) OBJTYPE(*FILE) + > > OUTPUT(*OUTFILE) OUTFILE(CCMSDTA/QADSPOBJ) > > OVRDBF FILE(QADSPOBJ) TOFILE(CCMSDTA/QADSPOBJ) + > > MBR(*ALL) > > . > > . > > GETDATA: > > RCVF > > > > MONMSG MSGID(CPF0864) EXEC(DO) /* Ck EOF */ > > GOTO CMDLBL(CLOSE) <<<<<<<This becomes true > on successive passes after the first!!!!!! > ENDDO > <<<<<<< it is ok when it really is the end of a list but I need to > . > <<<<<<<check for new data arriving in the library. > . > > ALCOBJ OBJ((&ODOBNM *FILE *EXCL)) > > CHGVAR VAR(&MEMBER) VALUE(&ODOBNM) > > . > > . > > PROCESS: > > . > > . > > GOTO CMDLBL(GETDATA) > > > > NODATA: /* No Requests Found, Set Next Iteration */ > > GOTO CMDLBL(CHECKEND) > > > > CLOSE: /* Close list of Requests to Process */ > > DLTF FILE(CCMSDTA/QADSPOBJ) <<<<<<< Theese were > not always here, I added them to > RCLRSC > <<<<<<< see if this would help > . > > > > . > CHECKEND: > IF COND(%SWITCH(1XXXXXXX)) THEN(GOTO + > CMDLBL(ENDPROG)) > . > <<<<<<<< Here the program calls CICS sleep function > GOTO CMDLBL(REDUEX) >>>>>>>> GO > SEE IF THERE ARE NEW REQUESTS > > >>>>>>>> At this point I would suspect that if any new > > >>>>>>>> files appeared the process would repeat > ENDPROG: > ENDPGM > > ______________________________________________________________________ > ___ > Howard Weatherly > > hweatherly@dlis.dla.mil > howard.weatherly@ctg.com > hweath@ibm.net > > -- Jim W http://www.netcom.com/~jimwelsh/welcome/welcome.html mailto:jimwelsh@ix.netcom.com +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.