Page 1 of 1
Direct calling LANSA functions from COBOL
Posted: Thu Feb 15, 2024 11:27 am
by Taku Izumi
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
Re: Direct calling LANSA functions from COBOL
Posted: Thu Feb 15, 2024 7:44 pm
by René Houba
Hi Taku,
I have never seen an example related to this.
You might ask LANSA Support.
Re: Direct calling LANSA functions from COBOL
Posted: Sun Feb 18, 2024 7:56 am
by stevelee67
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
Re: Direct calling LANSA functions from COBOL
Posted: Thu Feb 22, 2024 7:30 pm
by Taku Izumi
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