|
Another possible method,.. within one CLP is to do a RTVMBRD of the PF to retrieve the number of records. Then while looping through the RCVF increment a record counter. When the record counter = Nbr of records in PF then goto your next process, POSDBF, etc.. Regards, Jon A. Erickson Sr. Programmer Analyst 800.COM Inc. 1516 NW Thurman St Portland, OR 97209-2517 Direct: 503.944.3613 Fax: 503.944.3690 Web: http://800.com -----Original Message----- From: MCPARTLAND, Stan [mailto:stanley.mcpartland@bently.com] Sent: Thursday, December 30, 1999 2:23 PM To: 'RPG400-L@midrange.com' Subject: RE: Another CL Question - RCVF Kerwin, You cannot process a file in a CL program after it has reached EOF. You should be able to get by without two programs if you execute both DSPOBJD commands before the RCVF command and process records based on the value of the library variable. Use OUTMBR(*FIRST *ADD) on the second (and subsequent) DSPOBJD commands. >From the CL Programming manual: - The file remains open until the procedure or OPM program returns or when the end of file is reached. When end of file is reached, message CPF0864 is sent to the CL procedure or program, and additional operations are not allowed for the file. The procedure or program should monitor for this message and take appropriate action when end of file is reached. Regards, Stan McPartland I know this is a RPG list but I don't know of a CLP list. I have a CLP that is basically the following. The main process is to read all of the files in a library do some things with it and then read all of the files from a related library and do some things. See example: DCLF FILE(QTEMP/FILE) DSPOBJD OBJ(LIB1/*ALL) OBJTYPE(*FILE) + OUTPUT(*OUTFILE) OUTFILE(QTEMP/FILE) + OUTMBR(*FIRST *REPLACE) LOOP1: RCVF DEV(*FILE) RCDFMT(*FILE) WAIT(*YES) MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(EOF1)) /* Code... */ GOTO CMDLBL(LOOP1) EOF1: DLTF FILE(QTEMP/FILE) DSPOBJD OBJ(LIB2/*ALL) OBJTYPE(*FILE) + OUTPUT(*OUTFILE) OUTFILE(QTEMP/FILE) + OUTMBR(*FIRST *REPLACE) LOOP2: RCVF DEV(*FILE) RCDFMT(*FILE) WAIT(*YES) MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(EOF2)) /* Code... */ GOTO CMDLBL(LOOP2) EOF2: DLTF FILE(QTEMP/FILE) My problem is that when it gets to the second rcvf it acts as if it has hit the EOF before processing the first record. I have tried putting in ovrdbf in several ways, but never got it to work. There has to be a way to reset the pointer or message to allow for the second rcvf. I ended up splitting this up into two CLP's and doing it that way. Any thoughts? Kerwin S. Crawford Toastmaster Inc. System Analyst +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-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.