|
> Can my main program be correct and complete as far as a sub procedure is > concerned if it has only these two lines?: > > D/copy protosrc,pDoCmd > .... > C callp (e) docmd('WRKSPLF') Not quite. Presuming that we're still talking about a pure /copy regime, and not service programs. What we need is a second /copy, for the 'pi' part. The reason for that is the compiler doesn't know how to sort the D-specs. If we mix the PR and PI specs in one /copy member, the compiler will put the PI specs before the calculations, which is a no-no. Here's one way to do the full thing, based on prior posts: ======================= QPROTOSRC, member AAAAS * Wrapper to process OS400 commands D doCmd pr D Command 1000a const varying ======================= QRPGLESRC, member AAAAS p doCmd b export D doCmd pi D Command 1000a const varying D QCmdExc pr extpgm('QCMDEXC') D 1000a const D 15p 5 const c callp qcmdexc(Command:%len(Command)) P e ======================= QRPGLESRC, member AAAA h dftactgrp(*no) actgrp('QILE') /copy qprotosrc,aaaas c callp(e) DoCmd('WRKSPLF') c eval *inlr=*on /copy qrpglesrc,aaaas ======================= Compile AAAA and call it. You should be able to see your spooled files! As interesting side-note is that the procedure DoCmd defines the procedure QCMDEXC, so there's no need for a second PR spec in the QPROTOSRC /copy member! Neat, eh? --buck
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.