Oppolzer - Informatik / Blog

Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie

IBM-MAIN - Ermitteln eines DS-Namens zu gegebenem DD-Namen




Bernd Oppolzer <bernd.oppolzer@T-ONLINE.DE>


IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU>


2015.03.20 14:03:01

Am 20.03.2015 um 13:54 schrieb J.M.:
> On Fri, Mar 20, 2015 at 7:17 AM, Bernd Oppolzer
> <bernd.oppolzer@t-online.de> wrote:
>> Yes, my present solution only delivers the first DSN,
>> which was sufficient given the needs of the project in the past
>> (it was clear there, that there was always only one dataset allocated
>> to the interesting DDNAME).
>> I get the JFCB address from the SWA token in the TIOT (after locating
>> the entry with the specified DDNAME) using SWAREQ, and if I read my
>> coding correctly, this JFCB address points directly to the (first) DSNAME.
>> Maybe someone could point out, how
>> - I could decide, if it is really a DSN that is allocated to this DDNAME
>> (and not,
>> for example, DD * or SYSOUT)
>> - and: how I could proceed to the other DSNAMEs probably present in the
>> concatenation
>> No need of source code; some kind of description would be sufficient.
>> I believe, that it should be possible to do the rest in C again, no
>> ASSEMBLER needed.
>> Thank you, kind regards
>> Bernd
> As nasty as it would be, I'd be inclined to chain chase and find
> things in the TIOT. Hum, except I don't know if it is even possible to
> chain chase to get to XTIOT entries. It will be nice to be able to
> embed ASM code in non-Metal C in z/OS 2.2.

don't know much about XTIOT at the moment, but here is the C coding to search
the TIOT for a given DDNAME (no ASSEMBLER needed):

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);

This function returns the address of your own TCB.
There are easier ways to do this, but it works this way.

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;

This function searches the TIOT for the given DDNAME and it returns a pointer to
the DDNAME entry in the TIOT, if the DDNAME could be found, and NULL, if not.

Sorry for the German variable names and comments.

Kind regards


For IBM-MAIN subscribe / signoff / archive access instructions,
send email to listserv@listserv.ua.edu with the message: INFO IBM-MAIN

Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie