Skip to main content

Cobol environment in mainframe dialect; a few programs need to a call C DLL with ASCII requirements

  • September 24, 2021
  • 1 reply
  • 0 views

We have a Cobol environment where the programs are compiled with the mainframe dialect. A few of these programs need to call a C DLL which requires ASCII parameters.

We can't used the _CODESET subroutine (because the COMP-X field is not supported in the mainframe dialect). Is there a different routine similar to _CODESET that works in a mainframe dialect environment?

Or, can we set the dialect to MF for just these few programs? When parameters are passed from Cobol program A compiled with the mainframe dialect to Cobol program B compiled with the MF dialect, how are the parameters passed? in Ebcdic? Or are they converted to ASCII on entry into Program B? 


#EnterpriseDeveloper

1 reply

  • 0 replies
  • September 28, 2021

We have a Cobol environment where the programs are compiled with the mainframe dialect. A few of these programs need to call a C DLL which requires ASCII parameters.

We can't used the _CODESET subroutine (because the COMP-X field is not supported in the mainframe dialect). Is there a different routine similar to _CODESET that works in a mainframe dialect environment?

Or, can we set the dialect to MF for just these few programs? When parameters are passed from Cobol program A compiled with the mainframe dialect to Cobol program B compiled with the MF dialect, how are the parameters passed? in Ebcdic? Or are they converted to ASCII on entry into Program B? 


#EnterpriseDeveloper

Michael

See if this helps:

EBCDIC to ASCII:

MOVE FUNCTION DISPLAY-OF(
     FUNCTION NATIONAL-OF(WS-EBCDIC-DATA),819)
                            TO WS-ASCII-DATA

To Convert back ...

MOVE FUNCTION DISPLAY-OF(
     FUNCTION NATIONAL-OF(WS-ASCII-DATA,819),1140)
                            TO WS-EBCDIC-DATA

Regards

Vijay