Restructure Output-Events (EXIRME)

Restriction: This exit is only available in File mode and in C language.

Characteristics

Description

This exit can be used immediately prior to writing Output-Events to:

  • Format the Output-Events and enrich the data
  • Delete Output-Events
  • Add Output-Events

Example of Output-Event restructuring:

  • From N Output-Events read, you can produce between 0 and M Output-Events
  • N Output-Events can be produced from the data in a single Output-Event
  • Inversely, one Output-Event can be built from multiple Output-Events

Operating principle

The exit is called for each Output-Event to be written during the session.

The Output-Events are read immediately after aggregation and passed to the restructuring exit. The Output-Events can be restructured and copied back in output.

Specific features

If an anomaly occurs in this exit, the session is closed.

Exchanged data

Four entry points are available in this exit:

  • Init
  • Read
  • Write
  • Close

EXI_nINIT entry point

Called at the start of the session it initializes the module.

EXI_nLECTURE entry point

Called just before writing Output-Events into the corresponding exchange area; it can be used to store, enrich and restructure the Output-Events read.

Alphanumeric fields may have different descriptions depending on the programing language and the Latin or UTF-16 format used. For more information, refer to Exits and external calls.

INPUT data

Name in C Characteristics / Length Use

szCodeDestinataire

Alphanumeric  / 25

Output code associated with the current Output-Event

nEntryCode

int / 1

Entry point code 5: EXI_nLECTURE, call in read mode

nNbOSegToWrite

 

 

sMe

Alphanumeric / 4000 max

Content of the Output-Event read

nLgnMe

int / 4

Length of the Output-Event read (maximum value = 4000)

OUTPUT data

Name in C Characteristics / Length Use

szCodeDestinataire

Alphanumeric / 25

Output code associated with the current Output-Event

nNbOsegtToWrite

int

Number of Output-Events to be written:

  • 0: Request to read the next Output-Event
  • 1: Request to read the restructured Output-Event
  • M: Request to write M Output-Events

sMe

Alphanumeric/ 4000 max

Content of the first restructured Output-Event to be written

nLgnMe

int / 4

Length of the first restructured Output-Event (maximum value = 4000)

szErrorLabel

Alphanumeric/ 200

Error message if an error is detected

Return value

 

  • 0 (EXI_nNOERREUR)
  • 9 (EXI_nERREURSYSTEME), if a system error is detected, the session is closed

EXI_nECRITURE entry point

Called when writing Output-Events to the exchange zone associated with the Processing-Context-Out, it can be used to enrich the Output-Events after restructuring.

Alphanumeric fields may have different descriptions depending on the programing language and the Latin or UTF-16 format used. For more information, refer to Exits and external calls.

INPUT data

Name in C Characteristics / Length Use

szCodeDestinataire

Alphanumeric/ 25

Output code associated with the current Output-Event

nEntryCode

int / 1

Entry point code 6: EXI_nECRITURE, call in write mode

nNbOsegtToWrite

int

Directory of the restructured Output-Event to be written

OUTPUT data

Name in C Characteristics / Length Use

szCodeDestinataire

Alphanumeric / 25

Output code associated with the current Output-Event

sMe

Alphanumeric / 4000 max.

Content of the restructured Output-Event to be written

nLgnMe

int / 4

Length of the restructured Output-Event (maximum value = 4000)

szErrorLabel

Alphanumeric/ 200

Error message if an error is detected

Return value

 

  • 0: (EXI_nNOERREUR)
  • 9: (EXI_nERREURSYSTEME), if a system error is detected, the session is closed

Entry point  EXI_nFERM

Closes the module and is called at the end of the session.

Implementation

Processing phases for calls submitted during a session

The Output-Events are read physically until there are no more Output-Events generated.

EXI_nLECTURE call

This entry point is called each time an Output-Event is read.

If you do not change the value of nNbOsegtToWrite in output, the current Output-Event (sMe) is written directly into the exchange area associated with the output.

If you perform a further Output-Event read, you must store the restructured Output-Events in memory in the exit.

Note   Note: You can therefore execute N reads and one write, or inversely, one read and M writes.

EXI_nECRITURE call

This entry point is called when writing each Output-Event restructured by EXI_nLECTURE.

The value of nNbOsegtToWrite indicates the directory of the restructured Output-Event to be written. If necessary, you can change the content of the Output-Event, before returning it to the write module.

Parameter settings

This exit can be executed during step S.

sys.dat file

Keyword Description/ Value to be Defined
>ScriptConfiguration< Section

 

O_Exit_Restructuring_OSegt

  • Yes_C: Execute EXIRME in C
  • No: Do not execute the exit

Module names

Implementation

Platform Directory Name C Program COBOL Program

Windows

%RDJ_EXEC%\exit

EXIRMEC.c

exidllh.h header file

Does not exist

UNIX

$RDJ_EXEC/exit

EXIRMEC.c

exidllh.h header file

Does not exist

MVS

&RDJEXEC..SRCLIB

EXIRMEC

exidllh.h header file

Does not exist

 

Processing Type Entry point

Open

EXI_nINIT

Close

EXI_nFERM

Read Output-Event

EXI_nLECTURE

Write restructured Output-Event

EXI_nECRITURE

Related Links