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



Yes you can pass parameters to a .exe, we do that today at our shop to bridge the gap between 5250 sessions and web applications. The .exe just needs to support the input of parameters (which is easy to do in Main() part of the .NET exe).

Example .NET program with input parameters:

static void Main(string[] args)
{
if (args.Length != 0)
{
foreach (string s in args)
{
if (s.ToUpper().Contains("/K="))
{
// do something with the K switch
}
if (s.ToUpper().Contains("/P="))
{
// do something with the P Switch
}
}
}

On the AS400 side of things it looks like this:

D IECMD C 'STRPCCMD PCCMD(''\\server\-
D myexe.exe \ARRTLaunch /K=CallLog /P=-
D '
D IEEND S 3 INZ(''')')

-----Original Message-----
From: Bryce Martin [mailto:bmartin@xxxxxxxxxxxxxxxxxx]
Sent: Thursday, August 23, 2012 9:40 AM
To: .net use with the System i
Subject: Re: [SystemiDotNet] Can we pass parameter from CL orRPGLE tocall a .Net program on a windows server?

Yea, I'm already using the RUNRMTCMD to do a tax update procedure right now. But I'm not passing any parameters for that. Its just a batch type process that runs. I'd like to do something similar but be able to pass a parameter or list of parameters to the executable... not sure if that is possible using RUNMRMTCMD (I know that executables can use args from command lines, but not sure if this can be done from that command... will look at it more..)

Thank You
Bryce Martin
National Ticket Company
570-672-2900 ext. 226


-----Original Message-----
From: systemidotnet-bounces@xxxxxxxxxxxx
[mailto:systemidotnet-bounces@xxxxxxxxxxxx] On Behalf Of Matt Olson
Sent: Thursday, August 23, 2012 10:30 AM
To: .net use with the System i
Subject: Re: [SystemiDotNet] Can we pass parameter from CL orRPGLE tocall a .Net program on a windows server?

Well the other solution is to make that bit of logic a web service, or a .ashx file like the previous poster was indicating. Both options are going to require that the functionality be hosted on an IIS web server though. This is the most modular approach in that you could then consume that logic in any programming language and/or program.

A quick google search for examples of calling web services via RPG requires making a C or C++ shim that you then call from RPG. Not elegant at ALL when you consider it's a 5 minute ordeal with any modern programming language:
http://www.ibm.com/developerworks/systems/library/es-webservicesrpg/.

If this is always going to be interactive, you could use the STRPCCMD to call a windows executable. If it's not interactive, then one other option is to use the Run Remote Command function which interacts with an IBM installed windows service (the incoming remote command daemon). If you have to undergo any sort of SOX or PCI audits however you may want to look elsewhere as this will surely cause problems for you as I don't think any authentication exists in this process and the security auditors would be up in arms with the mere fact that you could execute remote programs on a system in this manor.

See here for more details:
http://www.mcpressonline.com/networking/general/pc-commands-from-the-as4
00.html

-----Original Message-----
From: Bryce Martin [mailto:bmartin@xxxxxxxxxxxxxxxxxx]
Sent: Thursday, August 23, 2012 9:13 AM
To: .net use with the System i
Subject: Re: [SystemiDotNet] Can we pass parameter from CL or RPGLE tocall a .Net program on a windows server?

Matt and Bill,
I'm trying to avoid this scenario where the IBM i is writing directly to the MSSQL database. This is because I have to write this functionality in .Net anyway for other .Net based programs, so I really just want it to be able to be called from everywhere. I'd rather not maintain two identical pieces of logic. If we need to, we will, but since we're only writing the IBM i integration as a stop gap until we get the system replaced in the next year I'd like to use what I was planning on writing in .Net anyway. So maybe a web service type approach would be better, but then there is special coding in order to make this work from the IBM i anyway, right?

Thank You
Bryce Martin
National Ticket Company
570-672-2900 ext. 226

-----Original Message-----
From: systemidotnet-bounces@xxxxxxxxxxxx
[mailto:systemidotnet-bounces@xxxxxxxxxxxx] On Behalf Of Erhardt, Bill
Sent: Thursday, August 23, 2012 9:01 AM
To: .net use with the System i
Subject: Re: [SystemiDotNet] Can we pass parameter from CL or RPGLE tocall a .Net program on a windows server?

RJS has a product RPG2SQL that lets you write directly from an RPG program to any Server Based db.

-----Original Message-----
From: systemidotnet-bounces@xxxxxxxxxxxx
[mailto:systemidotnet-bounces@xxxxxxxxxxxx] On Behalf Of Bryce Martin
Sent: Thursday, August 23, 2012 8:57 AM
To: systemidotnet@xxxxxxxxxxxx
Subject: [SystemiDotNet] Can we pass parameter from CL or RPGLE to call a .Net program on a windows server?

I have an external, MSSQL database table that I have to write CRUD actions for in .Net. These need to be "callable" in some way from our IBM i programs. So if we create a new product on our IBM i we need to add it to this MSSQL database. So I need to pass a product ID to the .Net program that resides on the Windows server within our network. How do you guys do this? There is lots of stuff about calling CL or RPG from .Net, but I'm having trouble finding enough stuff about the other way around. I can call the .exe but its all about passing parameters now.



Thank You

Bryce Martin

National Ticket Company <http://www.nationalticket.com/>

570-672-2900 ext. 226



--
This is the .net use with the System i (SystemiDotNet) mailing list To post a message email: SystemiDotNet@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/systemidotnet
or email: SystemiDotNet-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/systemidotnet.
--
This is the .net use with the System i (SystemiDotNet) mailing list To post a message email: SystemiDotNet@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/systemidotnet
or email: SystemiDotNet-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/systemidotnet.
--
This is the .net use with the System i (SystemiDotNet) mailing list To post a message email: SystemiDotNet@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/systemidotnet
or email: SystemiDotNet-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/systemidotnet.
--
This is the .net use with the System i (SystemiDotNet) mailing list To post a message email: SystemiDotNet@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/systemidotnet
or email: SystemiDotNet-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/systemidotnet.
--
This is the .net use with the System i (SystemiDotNet) mailing list To post a message email: SystemiDotNet@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/systemidotnet
or email: SystemiDotNet-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/systemidotnet.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.