XTIOT
-- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Assembler List <[email protected]> on behalf of Bernd Oppolzer <[email protected]> Sent: Wednesday, July 24, 2019 4:49 PM To: [email protected] Subject: Re: old code failing IMO, this interface should work and did never change. Too much software out there depending on this. The coding should look like this (from a macro, which looks for a specific DD - see parm &DD): L R1,X'21C' ADDRESS OF OWN TCB L R1,12(R1) ADDRESS OF TIOT AHI R1,24 ADDRESS OF FIRST DD ENTRY LA RF,0 RETURN CODE SR R0,R0 LOOP WHILE,(0(R1),NE,0) BREAK (4(8,R1),=,=CL8'&DD') IC R0,0(R1) LENGTH OF DD ENTRY AR R1,R0 POINT R1 TO NEXT DD ENTRY OUT NOTFOUND LA RF,4 ELOOP If you don't have SP macros (LOOP ... WHILE, BREAK, OUT, ELOOP) like the ones used above, rewriting this without using them should be no big deal. BTW: no ASSEMBLER needed; it's possible to write this in C or PL/1. Here is my C solution (the addressing of the own TCB is done differently, but the TIOT handling is the same; sorry for the comments in German): static char *adressiere_tcb (void) /************************************************/ /* */ /* Ueber die TIOT (Task-IO-Table) */ /* werden die DDNamen und die */ /* zugeordneten DSNamen gesucht */ /* */ /************************************************/ { char ***cvt_pointer; char **tcb_tabelle; cvt_pointer = *((char ****) 16); tcb_tabelle = *cvt_pointer; return *(tcb_tabelle + 1); } static char *check_ddname (char *ddname) /************************************************/ /* */ /* Vorgegebener DDName wird gesucht */ /* */ /************************************************/ { char *adresse_tcb; char *adresse_tiot; char *laenge_tiot; char *ddname_tiot; adresse_tcb = adressiere_tcb (); adresse_tiot = *(((char **) adresse_tcb) + 3); for (laenge_tiot = adresse_tiot + 24; *laenge_tiot != 0; laenge_tiot += *laenge_tiot) { ddname_tiot = laenge_tiot + 4; if (memcmp (ddname_tiot, ddname, 8) == 0) { return ddname_tiot; } } return NULL; } HTH, kind regards Bernd Am 24.07.2019 um 19:23 schrieb Richard Kuebbing: > Routine only uses the TIOT entry to see if DD is present. It does that to > avoid OPEN message of missing DD. > >
