Why not have the call in a CL and just submit that, which in turn calls
the RPG.....
From: GKern@xxxxxxxxxxxxxxxx
To: rpg400-l@xxxxxxxxxxxx
Date: 12/09/2008 02:52 PM
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.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/rpg400-l.
This transmission may contain information that is privileged, confidential
and/or exempt from disclosure under applicable law. If you are not the
intended recipient, you are hereby notified that any disclosure, copying,
distribution, or use of the information contained herein (including any
reliance thereon) is STRICTLY PROHIBITED. If you received this
transmission in error, please immediately contact the sender and destroy
the material in its entirety, whether in electronic or hard copy format.
Thank you.
As an Amazon Associate we earn from qualifying purchases.