Calling RPG Program from One World

kcmathew

Member
I am trying to call a RPG program from One World. I am passing 2 parameters to the the RPG program. The RPG program writes to a workfile which i then read in my Business Function. I have written a Business Function that does this. The Business Function works fine when I run it in a UBE (UBE running in Batch and not locally). However the Business Function does not work when it is in an interactive application. The parameters to the RPG program do not get passed for some reason when I do it in the Interactive Appl.I cannot figure out why.
Any ideas would be appreciated.

Thanks,
Mat
 
Hi Mat.

We tried the same thing here, with multiple parameters being passed.
As close as I can figure, the BSFN cannot execute the RPG program "locally"
because it resides as an "external" program on the enterprise server.

It seems that the BSFN itself must be executed after the UBE has been
submitted
to the enterprise server. This proves to be inconvenient for testing
purposes,
since you have to deploy the UBE before you can test it.

If anybody else has managed to get this working locally, I would love to
hear about it.

Joseph Sadler,
World Vision Canada.
Helping the children of war and poverty, the world over.
Xe SP13, NT4 SQL 7, AS/400.




kcmathew
<kcmathew@altavist To: [email protected]
a.com> cc:
Sent by: Subject: Calling RPG Program from One World
owner-jdeowdevml@j
delist.com


05/24/01 05:12 PM
Please respond to
jdeowdev






I am trying to call a RPG program from One World. I am passing 2 parameters
to the the RPG program. The RPG program writes to a workfile which i then
read in my Business Function. I have written a Business Function that does
this. The Business Function works fine when I run it in a UBE (UBE running
in Batch and not locally). However the Business Function does not work when
it is in an interactive application. The parameters to the RPG program do
not get passed for some reason when I do it in the Interactive Appl.I
cannot figure out why.
Any ideas would be appreciated.

Thanks,
Mat


--------------------------
Visit the forum to view this thread at:
http://198.144.193.139/cgi-bin/wwwthreads/showflat.pl?Cat
=&Board=OWDEV&Number=11582
 
A different solution to the problem would be;

1, Create a work table consisting of your two fields (your parameters ) plus some way of controlling in case of multiple calls.

2, Create a trigger program on that file which after insert calls your RPG program.

3, When running from an application use table IO to write to the workfile and let the trigger run. When the workfile is ready (you can think of a way to do this - another file, a record type, etc.) you let your business function process it.

I hope this helps.

Adrian.

Xe SP15 Update1 applied AS400 V4R4 DB2, World A73 Cum 11 00X2
 
This is how we did it at Stewart & Stevenson.
1. Create processing potions
2. Use a work field, long enough to hold all the calling command plus parms.
3. Concatenate the call command including processing options.
4. Use Work field in the Business function "Execute External Program" source
module B34A1030.

Armando Jimenez
Stewart & Stevenson
XE, AS/400, V4R5
 
RE: Calling RPG Program from One WorldDid you run this off the server?. =
We tried the same thing and it ran fine locally,but did not go thru on =
the server.
Could you let us know how the final workfield looks after the =
concatenation.

Thanks,
AS/400 V4R5 XE-SP15 Co-existence.
----- Original Message -----=20
From: Armando Jimenez=20
To: '[email protected]' ; [email protected]=20
Sent: Tuesday, May 29, 2001 6:41 AM
Subject: RE: Calling RPG Program from One World


This is how we did it at Stewart & Stevenson.=20
1. Create processing potions=20
2. Use a work field, long enough to hold all the calling command plus =
parms.=20
3. Concatenate the call command including processing options.=20
4. Use Work field in the Business function "Execute External Program" =
source module B34A1030. =20

Armando Jimenez =20
Stewart & Stevenson=20
XE, AS/400, V4R5=20
 
Concatenation I found can be ugly when doing this in JDE because the only concatenate that I could find was one that concatenates 2 fields together. Here's a snippet of the code that I used to concatenate variables into the parameters for a program:

VA frm_CommandPath_256 = ' '
VA frm_CommandPath_256 = concat(rtrim([VA frm_CommandPath_256],' ' ),'C:\WINNT\Debug\CallAS400 "system name" "library/program parm40(')
VA frm_CommandPath_256 = concat(rtrim([VA frm_CommandPath_256],' ' ),concat([FC Alpha Description],') parm100('))
VA frm_CommandPath_256 = concat(rtrim([VA frm_CommandPath_256],' ' ),concat([FC Description],')"'))


My main problem was that there's a bug in the version of OneWorld that we have that drops the single quotes when you try to edit the line. I'm not sure how far you can nest concat's, but I'm going to try some more when we get the fix on the system.

FYI - CallAS400 is just a simple C program(that I found somewhere and modified) that executes commands on the AS/400 using ClientAccess.

-mary
 
Hi Mary,

A little bit unfortunate that you started a new issue under the original issue/thread. It would be better to start a new one. Never mind this time.

In response to your issue:
I have also faced this problem and reported it to JDE Response line. I faced it not only with single but with double quotes too and not only in trim functions but in almost all string functions.
I found it on XE SP 13. JDE response line was able to reproduce the problem. Thay also located the SAR# 4519248. They reported me that the issue has been corrected starting with SP 13.1.

I was able to work arround the problem using ER variables instead of string constants. E.g.:

evt_Space_EV01 = " "
evt_Text1_DSC01 = "C:\folder\"
evt_Text2_DSC01 = "filename.txt"
evt_Text3_DSC01 = concat(rtrim(evt_Text1_DSC01,evt_Space_EV01),rtrim(evt_Text2_DSC01,evt_Space_EV01))

Hope could help.

Regards,
Zoltán

P.S.: Please, place your system configuration information into your signature (next time :))

B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
 
Hi Zoltan,

I didn't mean to start another issue. I was really just replying to AS400Guru's request for an example of the concatenated string and mentioning for reference that there's a problem with JDE dropping the quotes.

Thanks for your suggestion of using variable to hold some of this information, though. I'll have to try that.

We are just in the OneWorldXE implementation stage and in the trial and error and discovery mode. I'm glad that there's a forum like this available to share information.

-mary




B7333 SP13 AS/400
 
Hi Mary,

You are very welcome on the Forum/List!
Please, forget my words about "to start another issue". I appreciate that you wanted to help.

Good luck for your OneWorldXE implementation stage and in the trial and error and discovery mode. I am sure that we will read You soon again here :))

Zoltán
P.S.: Nice to see your signature. I tell you that JDE do not like the name B7333 anymore, they prefer XE.

B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
 
Back
Top