Mainframe Subsystem Support includes a segment exit routine called IMSDBUEA that you can use to convert segments from EBCDIC to ANSI. You can use it in three ways:
IMSDBUEA uses a segment layout (.slf) file to determine which fields of each segment need to be converted, so you must create an .slf file using the IMS database editor before you can use IMSDBUEA. The .slf file must be in the directory specified by the ES_IMSDAT environment variable, or if the ES_IMSDAT environment variable is not set the .slf file must be in the current directory.
How you use IMSDBUEA depends on whether you are using the database management utility or the command line:
PROCEDURE DIVISION.
*=========================================================*
***** Load the MFIMSDBU module first.
set ws-ptr to entry "MFIMSDBU"
if ws-ptr = null
display "Cannot Load MFIMSDBU DLL"
display "Need to Die gracefully."
stop run
end-if
MOVE 02 TO SEGEXIT-VERSION
MOVE 00 TO SEGEXIT-FUNC
MOVE 'P155' TO SEGEXIT-DBD
MOVE 'P155SEG' TO SEGEXIT-SEGM
MOVE 10 TO SEGEXIT-SEGM-LTH
MOVE 10 TO SEGEXIT-SEGM-MAX-LTH
MOVE P155SEG TO SEGEXIT-DATA
CALL 'IMSDBUEA' USING SEGEXIT-PARMS
SEGEXIT-DATA.
mftech MOVE 02 TO SEGEXIT-VERSION
mftech MOVE 01 TO SEGEXIT-FUNC
mftech MOVE 'P155' TO SEGEXIT-DBD
mftech MOVE 'P155SEG' TO SEGEXIT-SEGM
mftech MOVE 10 TO SEGEXIT-SEGM-LTH
mftech MOVE 10 TO SEGEXIT-SEGM-MAX-LTH
mftech MOVE P155SEG TO SEGEXIT-DATA
mftech
mftech CALL 'IMSDBUEA' USING SEGEXIT-PARMS
mftech SEGEXIT-DATA.