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



GKern wrote:

What am I missing?

Jerry:

Beyond everything else others have already said (and you seem to understand okay), I see two additional details.

* Program Status Data Structure D PSDS SDS D CPF_MSG 40 46 D Command S 3000 D CloseParens C ')' D Sbmjob_Pt1 C 'SBMJOB CMD(CALL PGM(XRPGMAIL) PARM('

Here, you're using the CMD() parameter and CALL at the same time. Although CALL is indeed a "command" in itself, it doesn't have strongly typed parameters. I'm going to say that CALL isn't a "real" command to distinguish it from other commands that are intended to provide explicit parameter support.

As such, the support that is built into CMD() cannot do any meaningful handling of stuff that you supply for the CALL parameters. All it can do is 'default handling.'

It's possible to avoid the default handling by using the RQS() parameter instead of CMD() and building an explicit request string. You end up with the exact string that you want to be sent as the request, and you don't need to be surprised by what the default handling will do.

Now, if you use a "real" command instead of CALL, then the CMD() parameter will give much better results. The definitions of the parameters for a "real" command become important for determining how the values get used. The default handling has far less influence.

A guideline to think about is to use CALL when you don't have an appropriate "real" command, and to limit or avoid the use of CMD() when you aren't going to put a "real" command in for its value.

D QUOTE C '''' D/Copy Qrpglesrc,Cmdexec D/copy qsource,XRPGMAILPR D/Copy Qrpglesrc,ZRPGMAILPR D ZRPGMAIL PI D From_PR 256 Const D To_PR 256 Const D Subject_PR 256 Const D Text_PR 256 Const *?+++++++++++++++++ M A I N L I N E C A L C S +++++++++++++++++ C Eval Command = Sbmjob_Pt1 + C Quote + %TrimR(From_PR) + Quote + C ' ' + Quote + %TrimR(To_PR) + Quote + C ' ' + Quote + %TrimR(Subject_PR) + Quote + C ' ' + Quote + %TrimR(Text_PR) + Quote +

And here, you're trimming the parms. Unless you _want_ to pass values that don't have their trailing blanks, you probably shouldn't be trimming the blanks off.

Shortening the first parm value will cause the second value to be in a different memory location. It will begin in memory at an address that's within the definition of the first parm value. The same is true of later values.

Other than those two details, plus comments from others, it looks pretty good.

Tom Liotta

C CloseParens + CloseParens C Eval CPF_MSG = 'CPF0000' C CallP(E) Cmdexec (Command: %Size(Command)) C*** CallP XRPGMAIL(From_PR:To_PR:Subject_PR:Text_PR) C Eval *INLR = *On
This is the copybook containing the PR

D ZRPGMAIL PR ExtPgm('ZRPGMAIL') D From_PR 256 Const D To_PR 256 Const D Subject_PR 256 Const D Text_PR 256 Const



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.