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



Jerry,

This is a known problem with passing parameters greater than 32 bytes.
There are two ways I commonly get around it.

1. You either have to put the parameters into one long string with a
data structure.
2. Use a data area.

It works interactively since the memory is already allocated to your job
and in memory correctly.



Sharon Wintermute

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
GKern@xxxxxxxxxxxxxxxx
Sent: Tuesday, December 09, 2008 2:51 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Passing Parms from RPGLE to RPGLE

I've searched the archives but am still stumped.

This is basically a wrapper for Aaron Bartell's RPGMAIL utility.

I created a *CMD to prompt for four 256 byte *CHAR values.

I created an RPGLE that is specified as the program to process the
command. Below is that code.

If I call the code using the CALLP (which is shown below as ***)
everything works fine. However when trying to execute a SBMJOB the
parameters received by the called program are incorrect. The first parm
contains all four parms, the second parm contains parms 2, 3, & 4, the
third parm contains parms 3 & 4 and the fourth parm contains only the
fourth parm. I usually encounter problems like this with CL and that is
why this is all RPG. I don't think the CMD is the culprit since if I
bypass it and do a straight sbmjob from the command line I get the same
results. The parms as seen in debug are correct in this RPGLE. It's when

they are received by the XRPGMAIL program that they are corrupted.

What am I missing?

* 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('
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
+

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


Regards, Jerry

Gerald Kern - MIS Project Leader
Lotus Notes/Domino Administrator
IBM Certified RPG IV Developer
The Toledo Clinic, Inc.
4235 Secor Road
Toledo, OH 43623-4299
Phone 419-479-5535
gkern@xxxxxxxxxxxxxxxx


This e-mail message, including any attachments, is for the sole use of
the
intended recipient(s) and may contain confidential and privileged
information. Any unauthorized use, disclosure or distribution is
prohibited. If you are not the intended recipient, please inform the
sender by reply e-mail and destroy this and all copies of this message.

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.