Hi,
Our customer using IBM i COBOL wants to call LANSA functions directly from COBOL.
There are RPG and CL samples in DC@F28, but there are no COBOL samples.
Does anyone have an example for calling LANSA functions from COBOL?
Best regards,
Taku
Direct calling LANSA functions from COBOL
-
René Houba
- Posts: 220
- Joined: Thu Nov 26, 2015 7:03 am
Re: Direct calling LANSA functions from COBOL
Hi Taku,
I have never seen an example related to this.
You might ask LANSA Support.
I have never seen an example related to this.
You might ask LANSA Support.
-
stevelee67
- Posts: 22
- Joined: Tue Mar 13, 2018 8:25 am
- Location: Madison WI
Re: Direct calling LANSA functions from COBOL
i'm not a COBOL guy (nor do i play one on TV) but i assume that it would be the same as any other external program call. you need to make sure your library list is correct but:
LANSA REQUEST(RUN) PROCESS(pppppppppp) FUNCTION(fffffff) PARTITION(xxx) should work.
(you may need to be able to call the exchange list function as well: M@EXCH )
if that doesn't work, you might need to wrap a CL around the Lansa call.
here is a reference to some documentation about this kind of thing (not specific to COBOL). it's focused on the exchange list handling, and it's not terribly illuminating, but it should give at least a starting point.
https://docs.lansa.com/14/en/lansa015/c ... nge_c2.htm
LANSA REQUEST(RUN) PROCESS(pppppppppp) FUNCTION(fffffff) PARTITION(xxx) should work.
(you may need to be able to call the exchange list function as well: M@EXCH )
if that doesn't work, you might need to wrap a CL around the Lansa call.
here is a reference to some documentation about this kind of thing (not specific to COBOL). it's focused on the exchange list handling, and it's not terribly illuminating, but it should give at least a starting point.
https://docs.lansa.com/14/en/lansa015/c ... nge_c2.htm
The path to wisdom does, in fact, begin with a single step. Where people go wrong is in ignoring all the thousands of other steps that come after it.
Hogfather (Terry Pratchett)
Hogfather (Terry Pratchett)
-
Taku Izumi
- Posts: 63
- Joined: Thu Dec 15, 2016 2:03 pm
Re: Direct calling LANSA functions from COBOL
Hi,
LANSA Support also had not a sample for this.
I tried writing COBOL program, but found that I had to redefine so many fields used in the RPG sample, since COBOL doesn't allow field IDs containing @. It's hard work, so I gave up COBOL.
I am going to suggest the customer to use CL program.
Thanks,
Taku
LANSA Support also had not a sample for this.
I tried writing COBOL program, but found that I had to redefine so many fields used in the RPG sample, since COBOL doesn't allow field IDs containing @. It's hard work, so I gave up COBOL.
I am going to suggest the customer to use CL program.
Thanks,
Taku