Skip to main content

We are getting communication error while calling WINAPI. Earlier it was running fine but somehow from today onward its started giving this error.

My code looks like as below:

 

call WINAPI CPIC-INIT using by reference ws-conversation-id

                                                               symdest

                                                               ws-cm-rc

 

We are getting communication error 20 while doing this. Any thoughts

We are getting communication error while calling WINAPI. Earlier it was running fine but somehow from today onward its started giving this error.

My code looks like as below:

 

call WINAPI CPIC-INIT using by reference ws-conversation-id

                                                               symdest

                                                               ws-cm-rc

 

We are getting communication error 20 while doing this. Any thoughts

I am assuming that the communication error 20 is something that is being returned in ws-cm-rc as a return code from the call itself, correct?

This would indicate that the call is working fine from the COBOL side and the error is actually occurring within the called software itself. Have you checked with the vendor of the software you are calling, what a communication error means? I would think that perhaps the ws-conversation-id that you are passing is not valid or that some other previous call that established the communications channel failed. I know nothing about the actual program you are calling as it is not part of the Micro Focus software.

Thanks

We are getting communication error while calling WINAPI. Earlier it was running fine but somehow from today onward its started giving this error.

My code looks like as below:

 

call WINAPI CPIC-INIT using by reference ws-conversation-id

                                                               symdest

                                                               ws-cm-rc

 

We are getting communication error 20 while doing this. Any thoughts

WINAPI isn't what you're calling; it's how you're calling it (the calling convention). What you're calling is CPIC-INIT.

The name CPIC-INIT suggests you're calling a CPI-C (Common Programming Interface - Communications) library, and since this is Windows, that probably means the CPI-C client provided with Microsoft's SNA Server or Host Integration Server. CPI-C is used pretty much exclusively for IBM's SNA network protocol family.

So you should consult the documentation for SNA Server or HIS, or whatever CPI-C provider you're using. This isn't a COBOL issue.

I believe for CPIC-INIT the ws-conversation-id is an output parameter, so the likely problem is either the contents of symdest, or more likely either SNA Server / HIS isn't running properly, or the target host (probably an IBM mainframe) isn't accepting the connection. But those are outside the scope of Micro Focus software, and need to be diagnosed using the CPI-C documentation and diagnostic tools such as logs.