TRANMSG — Translate messages

Description

The TRANMSG macro returns a translated message or messages in a requested language. TRANMSG translates any of the following forms of messages:
  • Self-defined text
  • A message text block (MTB)
  • A message parameter block (MPB)
  • A combination of the above
TRANMSG uses a message input/output block (MIO) as input. You can either create the MIO, or let TRANMSG create it for you. You must create the MIO if you are translating multi-line messages with continuation lines. If you create the MIO for multi-line messages, it must contain the following:
  • Code of the desired language
  • Addresses of the messages to be translated
  • Address of an output buffer in the calling program's address space into which TRANMSG is to return the translated messages.

You must also set the MIOCONT flag on in the MIO for multi-line messages with continuation lines.

Otherwise, use parameters on TRANMSG to provide that information, so TRANMSG can build the MIO correctly.

Upon return, each translated message is in the output buffer in the form of an MTB, and the MIO contains the addresses of the MTBs. If the translated message has more than one line, the MTB will indicate multiple lines by showing more than one message entry area within the MTB associated with the translated message.

See z/OS MVS Programming: Assembler Services Guide for more information on using TRANMSG.

Environment

The requirements for the caller are:

Environmental factor Requirement
Minimum authorization: Problem state and any PSW key.
Dispatchable unit mode: Task or SRB
Cross memory mode: PASN=HASN=SASN or PASN¬=HASN¬=SASN
AMODE: 24- or 31-bit
ASC mode: Primary
Interrupt Status: Enabled for I/O and external interrupts
Locks: No locks held
Control parameters: Not applicable

Programming requirements

Before invoking TRANMSG, you must obtain storage for:
  • The MIO
  • The output buffer where TRANMSG will return the translated messages.

The size of the storage you will need for the MIO and output buffer depends on the number and size of messages you are translating. See z/OS MVS Data Areas in z/OS Internet Library at http://www.ibm.com/systems/z/os/zos/bkserv/ for a mapping of the MIO. Storage must be in the address space in which the calling program issued TRANMSG.

You must include the following mapping macros:
  • CNLMMIO
  • CNLMMCA

Restrictions

If TRANMSG builds the MIO for your application:
  • Message translation starts at the first message in the message entry list (list addr in the INBUF parameter).
  • The first message must contain a message identifier.
  • You must supply all parameters on TRANMSG.

If you provide a formatted MIO, the only required parameter is MIO.

Input register information

Before issuing the TRANMSG macro, the caller must ensure that register 13 contains the address of an 18-word save area, which can be provided through the use of standard linkage conventions.

Output register information

When the TRANMSG macro returns control, the output registers contain the following values:
Register
Contents
0
The contents of the high-order halfword are not part of the intended programming interface. The low-order halfword contains a reason code.
1
Used as a work register by system
2-13
Unchanged
14
Used as a work register by system
15
Return code

Some callers depend on register contents remaining the same before and after issuing a service. If the system changes the contents of registers on which the caller depends, the caller must save them before issuing the service, and restore them after the system returns control.

Performance implications

Translating multiple messages on one invocation of TRANMSG is more efficient than invoking TRANMSG multiple times with one message for each invocation.

Syntax

If you build the MIO, code the TRANMSG macro as follows:

Syntax Description
      
     name name: Symbol. Begin name in column 1.
   
One or more blanks must precede TRANMSG.
   
TRANMSG  
   
One or more blanks must follow TRANMSG.
   
MIO=msg block addr msg block addr: RX-type address or register (2) - (12).
   

If you want the TRANMSG macro to build the MIO, code TRANMSG as follows:

Syntax Description
   
   name name: Symbol. Begin name in column 1.
   
One or more blanks must precede TRANMSG.
   
TRANMSG  
   
One or more blanks must follow TRANMSG.
   
MIO=msg block addr msg block addr: RX-type address or register (2) - (12).
   
,MIOL=length of block addr length of block addr: RX-type address or register (2) - (12).
   
,INBUF=(list addr, num of list addr: RX-type address or register (2) - (12).
   entries addr) num of entries: RX-type address or register (2) - (12).
   
,OUTBUF=output buffer addr output buffer addr: RX-type address or register (2) - (12).
   
,OUTBUFL=output buffer output buffer length addr: RX-type address or register (2) - (12).
   length addr  
   
,LANGCODE=lang code addr lang code addr: RX-type address or register (2) - (12).
   

Parameters

The parameters are explained as follows:

MIO=msg block addr
Specifies the address, or a register, containing the address of an area containing the MIO or the address where TRANMSG is to build or find the MIO. If you have built the MIO, code only this parameter. Specify all other parameters only if TRANMSG is to build the MIO.
,MIOL=length of block addr
Specifies the address of a fullword or a register containing the length in bytes of the MIO. The length value is right-justified and padded with blanks. This parameter is required if TRANMSG is to build the MIO.
,INBUF=(list addr, num of entries addr)
Specifies the address of a register pointing to the list of addresses of the self-defined text, MPB, or MTB that TRANMSG is to use as input, and the number of entries in the list, respectively. This parameter is required if TRANMSG is to build the MIO.
,OUTBUF=output buffer addr
Specifies the address of a register containing the address of the output buffer into which TRANMSG is to return translated messages in the form of MTBs. This parameter is required if TRANMSG is to build the MIO.
,OUTBUFL=output buffer length addr
Specifies the address of a fullword or a register containing the length in bytes of the output buffer. This parameter is required if TRANMSG is to build the MIO.
,LANGCODE=lang code addr
Specifies the address of, or a register pointing to, the 3-byte character field containing the code of the language into which you want the messages translated. z/OS MVS Programming: Assembler Services Guide contains a list of language codes. This parameter is required if TRANMSG is to build the MIO.

Return and reason codes

While TRANMSG provides return and reason codes in registers 15 and 0, respectively, you can determine exactly which message failed by looking at the reason code returned for each message in the MIOREAS field of the MIO variable data area. See z/OS MVS Data Areas in z/OS Internet Library at http://www.ibm.com/systems/z/os/zos/bkserv/ for a mapping of the MIO.

When TRANMSG completes, register 15 contains one of the following hexadecimal return codes:

Hexadecimal Return Code Meaning
00 Processing completed successfully.
04 Processing complete. The output is complete, but TRANMSG might not have translated everything (for example, one variable in your message might not have translated).
08 Processing complete. The output is usable, but incomplete (for example, you might not have received all lines of a multiline message).
0C Processing ended prematurely. The output is unusable. Possible causes are:
  • You have attempted to translate too many messages at one time.
  • The MIO is not valid
  • The output buffer is too small for any messages.
10 Processing did not complete. The output is unpredictable.

When TRANMSG completes, the low-order halfword of register 0 contains one of the following hexadecimal reason codes:

Hexadecimal Return Code Hexadecimal Reason Code Meaning
00 00 Successful processing.
04 07 This reason code is for internal diagnostic purposes only. Record it and supply it to the appropriate IBM® support personnel.
04 08 This reason code is for internal diagnostic purposes only. Record it and supply it to the appropriate IBM support personnel.
04 0B This reason code is for internal diagnostic purposes only. Record it and supply it to the appropriate IBM support personnel.
04 0C The passed storage address is not valid.
04 0D This reason code is for internal diagnostic purposes only. Record it and supply it to the appropriate IBM support personnel.
04 1A TRANMSG returned a token value as text.
04 1B The translated message is not a valid mixed DBCS string.
04 1C A substitution token that is in the MPB is not in the message skeleton.
04 1D A substitution token that is in the message skeleton is not in the MPB.
04 1F The internal day code is not valid.
04 21 The required date format is not available. TRANMSG used the default.
04 22 A date formatting failure occurred.
04 23 The required time format is not available. TRANMSG used the default.
04 24 This reason code is for internal diagnostic purposes only. Record it and supply it to the appropriate IBM support personnel.
04 25 This reason code is for internal diagnostic purposes only. Record it and supply it to the appropriate IBM support personnel.
04 32 Input for the date format is not numeric. TRANMSG returned the date without formatting it.
08 01 The language you requested is not available. TRANMSG returned a U.S. English message.
08 03 The buffer space is insufficient for the output parameter blocks. The output was truncated.
08 14 The message identifier is longer than the text of the message continuation.
08 18 The input message length is not valid.
08 19 The input message does not match a message in the run-time message file.
08 1E TRANMSG did not find a match in the target language run-time message file.
08 20 This reason code is for internal diagnostic purposes only. Record it and supply it to the appropriate IBM support personnel.
08 2B This reason code is for internal diagnostic purposes only. Record it and supply it to the appropriate IBM support personnel.
08 33 TRANMSG could not match the message ID in the message skeleton to those contained in the run-time message file.
08 34 TRANMSG attempted to match message text against an English message skeleton with translated line numbers. Input to TRANMSG must be an MPB when you use English message skeletons with translated line numbers.
0C 02 TRANMSG did not copy the input parameter block from the caller's address space.
0C 04 TRANMSG was unable to copy the MIO from the caller's address space.
0C 05 The MIO acronym is not valid.
0C 06 TRANMSG was unable to copy the MIO and output parameter blocks to the caller's address space.
0C 0A TRANMSG could not obtain storage.
0C 10 The length of the MIO is less than the minimum length for a valid MIO.
0C 11 The length of the MTB is less than the minimum length for a valid MTB.
0C 12 The length of the MPB is less than the minimum length for a valid MPB.
0C 13 The MTB record count is not valid. The message record count must be one (1).
0C 15 The input message has a length less than three. A valid input message must have at least one character each for the message identifier and the message text, separated by a blank character.
0C 17 The MVS™ message service is unavailable.
0C 26 The translation request terminated. The MMS user exit has set the processing indicator to a nonzero value.
0C 27 The entry installation exit has failed.
0C 28 The exit installation exit has failed.
0C 29 The continuation ID in a multi-line message has zero length.
0C 2A The MIO invocation type is not valid.
0C 31 The MIOXLATE field in the MIO is not valid.
0C 39 The MIO is too small.
0C 3A The number in the list of entries is not a valid value.
10 09 This reason code is for internal diagnostic purposes only. Record it and supply it to the appropriate IBM support personnel.

If you translate multiple lines of message text

The return code and reason code you receive will reflect the most severe condition. Multiple lines of message text can be either multi-line messages or multiple messages. You will need to check the MIOREASN field contained within the variable message entry areas of the MIO to determine processing status of each line. The MIOREASN field provides reasons for the errors.

If you received return codes 0 or 4, check field MIOTRUNC in the MIO to see if TRANMSG processed all message input.

It is possible that the output buffer was not large enough to hold all the translated messages. A return code of 0 or 4 might indicate this situation. Check the MIOTRUNC field of the MIO. If MIOTRUNC is 0, TRANMSG processed all messages. If MIOTRUNC is nonzero, it contains the number of the first message that did not fit into the input buffer.

If TRANMSG processing ended prematurely

You can increase the output buffer size, then reissue TRANMSG, or you can redrive message translation (that is, restart message translation at the point where it ended.) You can redrive message translation by using the same MIO and input and output data areas. Save the output of the failing message translation before redriving because TRANMSG reuses these fields on subsequent calls to translate the remaining messages. To redrive message translation, do the following:
  1. First, determine where processing stopped. The nonzero number in the MIOTRUNC field is the number of the output message TRANMSG truncated because it did not fit into the output buffer. For example, if you issue TRANMSG to return five translated messages, and the output buffer can hold only three messages, TRANMSG will not return the fourth and fifth message in the output buffer. When TRANMSG completes, the MIOTRUNC field would contain a value of 4.
  2. Set the MIOXLATE field of the MIO to the value of the MIOTRUNC field; in this case, 4.
  3. If the first message to be translated is a continuation message (contains no message ID), also set the MIOMID field to the message value, and the MIOMIDL field to the message ID length of the associated continuation message.
  4. Issue TRANMSG again to translate the remaining messages, starting, in this case, with the fourth message.

Repeat this process until MIOTRUNC is 0, indicating that all input messages have been processed.

If you don't want to redrive using the same MIO, allocate a new, larger output buffer, change the MIO output buffer pointer, the length fields MIOBFPTR and MIOBFSIZ, and the MIOXLATE field. Issue TRANMSG again until MIOTRUNC is 0.

Example 1

Translate U.S. English text to Japanese using self-defined text as input. TRANMSG will build the MIO.
TRANSSDT CSECT
TRANSSDT AMODE  31
TRANSSDT RMODE  ANY
         STM    14,12,12(13)
         BALR   12,0
         USING  *,12
         ST     13,SAVE+4
         LA     15,SAVE
         ST     15,8(13)
         LR     13,15

***********************************************************************
*        GETMAIN STORAGE AREA FOR THE MIO                             *
***********************************************************************
*                                                                     *
         GETMAIN RU,LV=STORLEN,SP=SP230
         LR    R4,R1              SAVE STORAGE ADDRESS
         USING MIO,R4
         L     R2,MLENGTH         OBTAIN LENGTH OF MIO AREA
         AR    R2,R1              CALCULATE ADDRESS OF OUTPUT BUFFER
*                                                                     *
***********************************************************************
*        ISSUE TRANSLATE FOR MESSAGE                                  *
***********************************************************************
*                                                                     *
         TRANMSG MIO=MIO,MIOL=MLENGTH,INBUF=(SDTA,ONE),                C
               OUTBUF=(R2),OUTBUFL=OUTAREAL,LANGCODE=LC
***********************************************************************
*        FREE STORAGE AREA FOR THE MIO                                *
***********************************************************************
*                                                                     *
         FREEMAIN RU,LV=STORLEN,SP=SP230,A=(4)
*                                                                     *
***********************************************************************
         L     13,SAVE+4
         LM    14,12,12(13)
         BR    14
         DROP
***********************************************************************
MLENGTH  DC    A(MLEN)
OUTAREAL DC    A(STORLEN-MLEN)
SDT      DC    H'37'
         DC    CL37'XXXX01 ENGLISH MESSAGE WITH ID XXXX01'
SDTA     DC    A(SDT)
LC       DC    CL3'JPN'
SP230    EQU   230
ONE      DC    F'1'
SAVE     DC    18F'0'
R1       EQU   1
R2       EQU   2
R4       EQU   4
MLEN     EQU   (MIOVDAT-MIO)+MIOMSGL
STORLEN  EQU   512
***********************************************************************
         DSECT
         CNLMMCA
         CNLMMIO
         END TRANSSDT

Example 2

Translate U.S. English text to Japanese. Build your own MIO.
TRANS2A  CSECT
TRANS2A  AMODE  31
TRANS2A  RMODE  ANY
         STM    14,12,12(13)
         BALR   12,0
         USING  *,12
         ST     13,SAVE+4
         LA     15,SAVE
         ST     15,8(13)
         LR     13,15
*                                                                     *
***********************************************************************
*        GETMAIN STORAGE AREA                                         *
***********************************************************************
*                                                                     *
         GETMAIN RU,LV=STORLEN,SP=SP230
         LR    R4,R1
         XC    0(MIOVDAT-MIO,R4),0(R4)         CLEAR MIO HEADER SECTION
         MVC   MIOACRN-MIO(L'MIOACRN,R4),=C'MIO ' SET ACRONYM
         MVI   MIOVRSN-MIO(R4),$MIO_VERSION       SET VERSION NUMBER
         MVC   MIOSIZE-MIO(4,R4),MLENGTH          SAVE MIO SIZE
         MVC   MIOLANG-MIO(L'MIOLANG,R4),=C'JPN'  SET LANGUAGE NAME
         L     R3,MLENGTH                         CALCULATE OUTAREA ADD
         AR    R3,R4                              GET MIO ADDRESS
         ST    R3,MIOBFPTR-MIO(,R4)               SET OUTAREA ADDRESS
         MVC   MIOBFSIZ-MIO(L'MIOBFSIZ,R4),OUTAREAL SET OUTAREA LENGTH
         LA    R3,1
         ST    R3,MIOXLATE-MIO(,R4)               SET TO FIRST MSG
         MVI   MIOMID-MIO(R4),C' '                INIT MSGID TO SPACES
         MVC   MIOMID-MIO+1(L'MIOMID-1,R4),MIOMID-MIO(R4)
         LA    R3,MIOMSGL                         GET LENGTH OF MIO
         ST    R3,MIOVDATL-MIO(,R4)         SAVE VARIABLE AREA LENGTH
         LA    R3,1
         ST    R3,MIOMSGNO-MIO(,R4)               SET NUMBER OF MSGS    C
                                                     TO TRANSLATE
         LA    R3,MIOVDAT-MIO                     GET OFFSET TO VAR. AREA
         ST    R3,MIOOFFST-MIO(,R4)               SAVE OFFSET TO 1ST MSG
         AR    R3,R4                           POINT TO MIO VARIABLE AREA
         XC    0(MIOMSGL,R3),0(R3)                CLEAR MSG ENTRY AREA
         LA    R2,SDT                          OBTAIN INPUT AREA ADDRESS
         ST    R2,MIOINPTP-MIOMSG(,R3)            SAVE INPUT AREA ADDRESS
         MVI   MIOINFL-MIOMSG(R3),MIOXLATF        INDICATE TRANSLATE
*                                                                     *
***********************************************************************
*        ISSUE TRANSLATE FOR MESSAGE                                  *
***********************************************************************
*                                                                     *
         TRANMSG MIO=(R4)
*                                                                     *
***********************************************************************
*        FREE STORAGE AREA                                            *
***********************************************************************
*                                                                     *
         FREEMAIN RU,LV=STORLEN,SP=SP230,A=(4)
*                                                                     *
***********************************************************************
         L     13,SAVE+4
         LM    14,12,12(13)
         BR    14
         DROP
***********************************************************************
         DS    0F
MLENGTH  DC    A(MLEN)
OUTAREAL DC    A(STORLEN-MLEN)
SDT      DC    H'37'
         DC    CL37'XXXX01 ENGLISH MESSAGE WITH ID XXXX01'
INAREA   DC    A(SDT)
LC       DC    CL3'JPN'
SP230    EQU   230
ONE      DC    F'1'
SAVE     DC    18F'0'
R1       EQU   1
R2       EQU   2
R3       EQU   3
R4       EQU   4
MLEN     EQU   (MIOVDAT-MIO)+MIOMSGL
STORLEN  EQU   512
***********************************************************************
         DSECT
         CNLMMCA
         CNLMMIO
         END TRANS2A

Example 3

Translate three single-line U.S. English messages to Japanese using self-defined text as input.
TRANMULT CSECT
TRANMULT AMODE  31
TRANMULT RMODE  ANY
         STM    14,12,12(13)
         BALR   12,0
         USING  *,12
         ST     13,SAVE+4
         LA     15,SAVE
         ST     15,8(13)
         LR     13,15
*                                                                     *
***********************************************************************
*        GETMAIN STORAGE AREA                                         *
***********************************************************************
*                                                                     *
         GETMAIN RU,LV=STORLEN,SP=SP230
         LR    R4,R1                     SAVE STORAGE ADDRESS
         USING MIO,R4
         L     R2,MLENGTH                OBTAIN LENGTH OF MIO AREA
         AR    R2,R1                CALCULATE ADDRESS OF OUTPUT BUFFER
*                                                                     *
***********************************************************************
*        ISSUE TRANSLATE FOR MESSAGE                                  *
***********************************************************************
*                                                                     *
         TRANMSG MIO=MIO,MIOL=MLENGTH,INBUF=(SDT1A,THREE),             C
               OUTBUF=(R2),OUTBUFL=OUTAREAL,LANGCODE=LC
***********************************************************************
*        FREE STORAGE AREA                                            *
***********************************************************************
*                                                                     *
         FREEMAIN RU,LV=STORLEN,SP=SP230,A=(4)
*                                                                     *
***********************************************************************
         L     13,SAVE+4
         LM    14,12,12(13)
         BR    14
         DROP
***********************************************************************
MLENGTH  DC    A(MLEN)
OUTAREAL DC    A(STORLEN-MLEN)
SDT1     DC    H'33'
         DC    CL33'XXXX0A THIS IS MESSAGE NUMBER ONE'
SDT2     DC    H'33'
         DC    CL33'XXXX0B THIS IS MESSAGE NUMBER TWO'
SDT3     DC    H'35'
         DC    CL35'XXXX0C THIS IS MESSAGE NUMBER THREE'
SDT1A    DC    A(SDT1)
SDT2A    DC    A(SDT2)
SDT3A    DC    A(SDT3)
LC       DC    CL3'JPN'
SP230    EQU   230
THREE    DC    F'3'
SAVE     DC    18F'0'
R1       EQU   1
R2       EQU   2
R4       EQU   4
MLEN     EQU   (MIOVDAT-MIO)+(3*MIOMSGL)
STORLEN  EQU   512
***********************************************************************
         DSECT
         CNLMMCA
         CNLMMIO
         END TRANMULT

Example 4

Translate U.S. English text to Japanese using an MTB as input. Create the input MTB.
TRANMTBA CSECT
TRANMTBA AMODE  31
TRANMTBA RMODE  ANY
         STM    14,12,12(13)
         BALR   12,0
         USING  *,12
         ST     13,SAVE+4
         LA     15,SAVE
         ST     15,8(13)
         LR     13,15
*                                                                     *
***********************************************************************
*        GETMAIN STORAGE AREA                                         *
***********************************************************************
*                                                                     *
         GETMAIN RU,LV=STORLEN,SP=SP230
         LR    R4,R1              SAVE STORAGE ADDRESS
         USING MIO,R4
         L     R2,MLENGTH         OBTAIN LENGTH OF MIO AREA
         AR    R2,R4              CALCULATE ADDRESS OF MTB
         USING MTB,R2
         MVC   MTBACRN,=C'MTB '      SET ACRONYM
         MVI   MTBVRSN,$MTB_VERSION  SET VERSION NUMBER
         MVC   MTBLNGCD,LC           SET LANGUAGE CODE
         LA    R3,MTBLEN             CALCULATE SIZE OF MTB
         ST    R3,MTBSIZE            SAVE MTB SIZE
         LA    R3,MTBVDAT-MTB        OBTAIN LENGTH OF MTB HEADER
         ST    R3,MTBOFFST           SAVE OFFSET TO MTB VARIABLE AREA
         MVC   MTBCOUNT,ONE          SAVE RECORD COUNT
         MVC   MTBVDATL,SDTLEN       SAVE MTB VARIABLE AREA SIZE
         AR    R3,R2                 POINT TO MTB VARIABLE AREA
         USING MTBMSG,R3
         MVC   MTBMSG(39),SDT        SET MESSAGE LENGTH
         ST    R2,LIST               SAVE MTB ADDRESS LIST
         LA    R3,39(,R3)            SAVE ADDRESS OF OUTPUT BUFFER
***********************************************************************
*        ISSUE TRANSLATE FOR MESSAGE                                  *
***********************************************************************
*                                                                     *
         TRANMSG MIO=MIO,MIOL=MLENGTH,INBUF=(LIST,ONE),                C
               OUTBUF=(R3),OUTBUFL=OUTAREAL,LANGCODE=LC
***********************************************************************
*        FREE STORAGE AREA                                            *
***********************************************************************
*                                                                     *
         FREEMAIN RU,LV=STORLEN,SP=SP230,A=(4)
*                                                                     *
***********************************************************************
         L     13,SAVE+4
         LM    14,12,12(13)
         BR    14
***********************************************************************
MLENGTH  DC    A(MLEN)
OUTAREAL DC    A(STORLEN-(MLEN+MTBLEN))
SDT      DC    H'37'
         DC    CL37'XXXX01 ENGLISH MESSAGE WITH ID XXXX01'
LC       DC    CL3'JPN'
SP230    EQU   230
ONE      DC    F'1'
ZERO     DC    F'0'
SDTLEN   DC    F'39'
SAVE     DC    18F'0'
LIST     DC    F'0'
R1       EQU   1
R2       EQU   2
R3       EQU   3
R4       EQU   4
STORLEN  EQU   512
MLEN     EQU   (MIOVDAT-MIO)+MIOMSGL
MTBLEN   EQU   (MTBVDAT-MTB)+39
***********************************************************************
         DSECT
         CNLMMCA
         CNLMMIO
         CNLMMTB
         END TRANMTBA

Example 5

Translate a U.S. English multiline message into Japanese. Create the MIO.
TRANSMLA CSECT
TRANSMLA AMODE  31
TRANSMLA RMODE  ANY
         STM    14,12,12(13)
         BALR   12,0
         USING  *,12
         ST     13,SAVE+4
         LA     15,SAVE
         ST     15,8(13)
         LR     13,15
*                                                                     *
***********************************************************************
*        GETMAIN STORAGE AREA                                         *
***********************************************************************
*                                                                     *
         GETMAIN RU,LV=STORLEN,SP=SP230
         LR    R4,R1
         XC    0(MIOVDAT-MIO,R4),0(R4)       CLEAR MIO HEADER SECTION
         MVC   MIOACRN-MIO(L'MIOACRN,R4),=C'MIO ' SET ACRONYM
         MVI   MIOVRSN-MIO(R4),$MIO_VERSION       SET VERSION NUMBER
         MVC   MIOSIZE-MIO(4,R4),MLENGTH          SAVE MIO SIZE
         MVC   MIOLANG-MIO(L'MIOLANG,R4),=C'JPN'  SET LANGUAGE NAME
         L     R3,MLENGTH                         CALCULATE OUTAREA ADD
         AR    R3,R4                              GET MIO ADDRESS
         ST    R3,MIOBFPTR-MIO(,R4)               SET OUTAREA ADDRESS
         MVC   MIOBFSIZ-MIO(L'MIOBFSIZ,R4),OUTAREAL SET OUTAREA LENGTH
         LA    R3,1
         ST    R3,MIOXLATE-MIO(,R4)               SET TO FIRST MSG
         MVI   MIOMID-MIO(R4),C' '                INIT MSGID TO SPACE
         MVC   MIOMID-MIO+1(L'MIOMID,R4),MIOMID-MIO(R4) CLEAR MSGID
         LA    R3,MSGLEN                          GET LENGTH OF MIO
         ST    R3,MIOVDATL-MIO(,R4)          SAVE VARIABLE AREA LENGTH
         LA    R3,3
         ST    R3,MIOMSGNO-MIO(,R4)               SET NUMBER OF MSGS       C
                                                    TO TRANSLATE
         LA    R3,MIOVDAT-MIO                     GET OFFSET TO VAR. AREA
         ST    R3,MIOOFFST-MIO(,R4)               SAVE OFFSET TO 1ST MSG
         AR    R3,R4                         POINT TO MIO VARIABLE AREA
         LA    R15,MIOVDAT-MIO               GET LENGTH OF MIO HEADER
         AR    R15,R4                        GET ADDRESS OF MIO MSG ENTRY
         LA    R3,SDT1A                           GET MSG AREA LENGTH
         XC    0(MIOMSGL,R15),0(R15)              CLEAR MSG ENTRY AREA
         MVC   MIOINPTP-MIOMSG(4,R15),0(R3)       GET ADDRESS OF SDT
         MVI   MIOINFL-MIOMSG(R15),MIOXLATF       INDICATE TRANSLATE
         LA    R3,4(,R3)                     POINT TO NEXT MESSAGE ADDR.
         LA    R15,MIOMSGL(,R15)             POINT TO NEXT MESSAGE ENTRY
         L     0,TWO                              SET NUMBER OF MESSAGES
LOOP     DS    0H
         XC    0(MIOMSGL,R15),0(R15)              CLEAR MSG ENTRY AREA
         MVC   MIOINPTP-MIOMSG(4,R15),0(R3)       GET ADDRESS OF SDT
         OI    MIOINFL-MIOMSG(R15),MIOXLATF       INDICATE TRANSLATE
         OI    MIOINFL-MIOMSG(R15),MIOCONT        INDICATE CONTINUATION
         LA    R3,4(,R3)                     POINT TO NEXT MESSAGE ADDR.
         LA    R15,MIOMSGL(,R15)             POINT TO NEXT MESSAGE ENTRY
         BCT   0,LOOP                       LOOP UNTIL ALL MSGS PROCESSED
*                                                                     *
***********************************************************************
*        ISSUE TRANSLATE FOR MESSAGE                                  *
***********************************************************************
*                                                                     *
         TRANMSG MIO=(R4)
*                                                                     *
***********************************************************************
*        FREE STORAGE AREA                                            *
***********************************************************************
*                                                                     *
         FREEMAIN RU,LV=STORLEN,SP=SP230,A=(4)
*                                                                     *
***********************************************************************
         L     13,SAVE+4
         LM    14,12,12(13)
         BR    14
***********************************************************************
MLENGTH  DC    A(MLEN)
OUTAREAL DC    A(STORLEN-MLEN)
TWO      DC    F'2'
SDT1     DC    H'33'
         DC    CL33'MSGID1 ENGLISH MESSAGE - LINE ONE'
SDT2     DC    H'28'
         DC    CL28'ENGLISH MESSAGE - LINE TWO  '
SDT3     DC    H'30'
         DC    CL30'ENGLISH MESSAGE - LINE THREE  '
SDT1A    DC    A(SDT1)
SDT2A    DC    A(SDT2)
SDT3A    DC    A(SDT3)
LC       DC    CL3'JPN'
SAVE     DC    18F'0'
SP230    EQU   230
R1       EQU   1
R2       EQU   2
R3       EQU   3
R4       EQU   4
R15      EQU   15
MSGLEN   EQU   3*MIOMSGL
MLEN     EQU   (MIOVDAT-MIO)+MSGLEN
STORLEN  EQU   512
***********************************************************************
         DSECT
         CNLMMCA
         CNLMMIO
         END TRANSMLA