× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



>
> 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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.