dfhaid routine

Top  Previous  Next

If declared, XCICS/TS invokes the dfhaid routine after terminal input is received, and before to (re)start a transaction. This routine may instruct XCICS/TS to start a specific transaction code, instead of the one eventually scheduled by the last RETURN TRANSID.

The routine receives the address of the TCTTETC area, which contains the identifier of the next transaction (TRANSID) to start and the AID entered by the user.

A return code not equal zero will communicate to XCICS/TS that the routine altered the TCTTETC.

Prototype

int function_name(unsigned char *tcttetc, unsigned char key);

Passed parameters

name

type

description

tcttetc

unsigned char *

address of the TCTTETC area

key

char

AID received

Return codes

0        XCICS will handle the AID and transaction code
!=0      the routine altered the next transaction code

Example declaration

define exit_program type=dfhaid, name=my_dfhaid_handler, library=libmysnt.so;

Example code

#include "cics.h"
#include "dfhaid.h"
 
int my_dfhaid_handler(unsigned char *tcttetc, unsigned char key) {
  if (memcmp(tcttetc, "MENU", 4)==0) {
    return 0;
  }
  switch (key) {
  case DFHPA1:
    memcpy(tcttetc, "HLP1", 4);
    return 1;
  case DFHPA2:
    memcpy(tcttetc, "HLP2", 4);
    return 1;        
  case DFHPF9:
    memcpy(tcttetc, "PRTX", 4);
    return 1;        
  }
  return 0;
}