• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

RPG Call

BBushley

Active Member
List users

I need to make a call to run an AS400 RPG program. Is there a business
function that does this. I looked at the sample on the Knowledge Garden but
it's Greek to me no pun intended to our neighbors and list users from
Greece.

Bob Bushley
Haskel International
Burbank, Ca. U.S.A.

JDE XE(B7333)ver SP13
AS400 ver V4R5
DB2
 

a_jimenez

Member
Use the Business function "Execute External Program" source module B34A1030
If you are running the job on the as/400 the command will begin with "CALL
PGM(XXXX/YYYY)" if the job is running on a fat client, or NT app server then
use "c:\winnt\rmtcmd.exe CALL PGM(XXXX/YYYY)"


Armando Jimenez
 

BBushley

Active Member
SORRY FOR THE TROUBLE ON THIS!

I CREATED A UBE THAT HAS A EVENT RULE IN THE HEADER (NO OTHER SECTIONS) WITH
A VARIABLE EQUAL TO CALL PGM(SYAN/P550101R) (SYAN BEING THE AS400 LIBRARY
AND P550101R BEING THE REPORT UBE) I USED THE VARIABLE IN THE BUSINESS
FUNCTION B34A1030

MY PROBLEM: IT LOOKS AS THOUGH THE PROGRAM NEVER EXECUTES ON THE AS400 THERE
IS NO OUTPUT/REPORT.

QUESTION: AM I DOING SOMETHING INCORRECTLY?

Bob Bushley
Haskel International
Burbank, Ca. U.S.A.

JDE XE(B7333)ver SP13
AS400 ver V4R5
DB2
Windows 2000
 

a_jimenez

Member
You may want to call a CL program so that you can set your library
list correctly. Also remember if you are running your UBE local then you
must use the "c:\winnt\rmtcmd.exe" in front of your call.


Armando Jimenez
 

dschlieder

Well Known Member
Bob,

I may be late or maybe you already have this figured out, but here is how we solved that problem a couple of years ago that gives us a lot of flexibility.

1) Create a table to hold triggers for specific UBEs and Versions. In that table, you enter records that have items such as the UBE Name, the Version, a trigger number (if you want) and the command to run. We have additional fields so we can use FTP on the AS400 to actually start programs on our legacy VAX, such as IP address, user names, etc.

2) Create a similar table to hold your log. Additional key fields would be date and time, user ID and machine key, etc.

3) Create a BSFN. This BSFN is added to your UBE at whatever point in the UBE you need. You pass to that the UBE name, the version (using system variables) and a trigger number (if you want multiple triggers to occur on the same UBE/Version.

That BSFN attempts to retrieve the data from the definition table. Even if it does not find a record in table 1, it always adds a record to table 2. If, and only if, it actually found a definition in table 1, it then does an update of table 2 on the record it just added. Then you have a log of every tine this BSFN is called, in case you want to trace some action.

4) On the AS400, create an after update trigger on table 2. This is a AS400 trigger, not ER in OneWorld on the table. That trigger will call a CL program on the AS400.

5) Write the CL program on the AS400 that will be called whenever table 2 is updated. This CL program will then read information about the updated record. The record includes the CL program you want to call for that trigger. It then calls that CL program. It gets more involved for calling remote programs.

We have not yet needed to use the trigger number as we have not had the need to have this action happen more than once per UBE, but if we ever do, it will be there. We use these triggers about 25 times a day, mostly starting jobs on our VAX.

Hope this is of some help,

Dave Schlieder
 

BBushley

Active Member
Thank You Everyone!

I have successfully got the RPG program running from XE.
However in the RPG program we have to set the library list using CHGLIBL
inside the CL.


Bob Bushley
 
Top