|
/free source = %trim(sourcelibname + '/' + %trim(sourcefilename); dest = %trim(destlibname + '/' + %trim(destfilename); cmd = 'CPYF FROMFILE(' + %trim(source) + ') TOFILE(' + %trim(dest) + ') MBROPT(*REPLACE) CRTFILE(*YES) FMTOPT(*NOCHK)'; /end-free Those extra apostrophes are causing part of the problem. Also, your file name variables look like they are the library and the file name concatenated together. Anything you pass to QCMDEXC has to look exactly like it would if you typed it in on the command line. Francis Lapeyre IS Dept. Programmer/Analyst Stewart Enterprises, Inc. -----Original Message----- From: rpg400-l-bounces+flapeyre=spamcop.net@xxxxxxxxxxxx [mailto:rpg400-l-bounces+flapeyre=spamcop.net@xxxxxxxxxxxx] On Behalf Of as400tech@xxxxxxxxxxx Sent: Monday, May 10, 2004 3:55 PM To: rpg400-l@xxxxxxxxxxxx Subject: Help with qcmdexc List, I have the following eval statement in my RPG program: EVAL CMD = 'CPYF(''' + %TRIMR(SOURCE) + ''') TOFILE(''' + %TRIMR(DEST) + ''') MBROPT(*REPLACE) + CRTFILE(*YES) FMTOPT(*NOCHK)' When it executes, I get the following error: String beginning 'CPYF ' not valid command name. However, in debug the string looks like this: ....5...10...15...20...25...30...35...40...45...50...55...60 1 'CPYF('LIB1 FILE1 ') TOFILE('LIB1 FILE2 ') ' 61 'MBROPT(*REPLACE) CRTFILE(*YES) FMTOPT(*NOCHK) ' 121 ' ' We are running V5R2. Any help in figuring out what I am doing wrong will be greatly appreciated. Thanks, Terry -- http://www.fastmail.fm - And now for something completely different. _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
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.