|
> > If I do something like the following: > > pgm = 'RECSHPNOT'; > CALLP pgm(inputFile: outputFile); > > it thinks I am trying to reference 'pgm' as an array rather than use the > value in 'pgm'. > That's because 'pgm' in this instance is the name of a prototype, not the name of a program. Making it a variable wouldn't help you, even if that made sense, because it would be changing the name of the prototype, not changing the name of the program object that the prototype calls. > Anybody think of a way I can do this in /Free? It looks like I will have to > go back to fixed for this particular situation. . . Sure, just specify a variable in your EXTPGM() statement. Like this: D PgmName s 10A D SomePgm PR ExtPgm(PgmName) D string 200A const D length 15P 5 const /free PgmName = 'QCMDEXC'; SomePgm('SNDMSG MSG(''Hi'') TOUSR(KLEMSCOT)': 200); PgmName = 'OTHERPGM'; SomePgm('Hey, it worked!': 200); *inlr = *on; /end-free
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.