|
Chris, Although this is not an RPG question and should be posted on the midrange-L list I'll keep quiet about it and be brief. AFAIK, if you want to mix hard coded constants with variables, I've always built the OVRDBF command string as one big variable then passed it to QCMDEXC. Or just build the parameter value as a variable. So you would have something like this in your CL program: Plan A CHGVAR &COMMAND ('OVRDBF FILE(' *CAT &FILENAME *TCAT ')' *CAT ' POSITION(*KEY 3 @' *CAT &FILENAME *CAT '"' *CAT &KEYV *CAT '" *CAT ' SHARE(*YES) SEQONLY(*NO)') CALL QCMDEXC &COMMAND &CMDLENGTH -or- Plan B CHGVAR &POSITION ('*KEY 3 @' *CAT &FILENAME *CAT '"' *CAT &KEYV *CAT '"') OVRDBF FILE(&FILENAME) POSITION(&POSITION) SHARE(*YES) SEQONLY(*NO) I've not tested if the POSITION keyword allows a variable. If not, you -must- use plan A. CHRIS.CHRISTODOULOU@denso.com.au wrote: > Can any one tell me why the following the occurs > > This works Fine > > OVRDBF FILE(ABC1) POSITION(*KEY 3 @ABC1 > 'EXZKPFR$ QDDSSRC DEVSLIB ') + > SHARE(*YES) SEQONLY(*NO) > RCVF > > and this does not > > OVRDBF FILE(ABC1) POSITION(*KEY 3 @ABC1 + > &KEYV) SHARE(*YES) SEQONLY(*NO) > RCVF > > where &KEYV = 'EXZKPFR$ QDDSSRC DEVSLIB ' > also tried &KEYV = ''EXZKPFR$ QDDSSRC DEVSLIB '' > > Message Unmonitored message CPF4137 occurred at statement 1600 is sent. > +--- | 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-2025 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.