Don't know, if this helps, but this is a function that reads the TIOT,
looking for a certain DDNAME, and returning success (pointer to the TIOT entry)
or fail (NULL).

This is ANSI C. No DSECTs or structure definitions needed.

Cheers,
Bernd


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


Oh, I forgot the function to retrieve the address of the TCB:


static char *adressiere_tcb (void)

/************************************************/
/*                                              */
/*   Über 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);
}

Comments in German language, sorry for that.




Am 30.08.2024 um 17:13 schrieb Denis:
  Have you tried to use peekOSMemory, its a bit strange to do control Block 
hopping in Java and using this method, there is No dsect conversion or so, Just 
Pointer Arithmetik, but it should be possible to do similar Things as in 
Assembler.
https://github.com/zsystems/java-samples/blob/master/PeekOSMemory.java

You could combine it with the jzos record Generator, that allows to create Byte 
identical Java records with getter and Setter methods based on cobol copybooks 
or Assembler dsects.
But the Code Looks strange to a Java Developer.
Denis.
     On Friday, August 30, 2024 at 04:57:29 PM GMT+2, Steve Thompson 
<ste...@wkyr.net> wrote:
I'm working on a project to "modernize" ALC to Java.

And I have code that is reading the TIOT to find DDs that the
process is interested in.

The subject is the question. I'm documenting routines (biz logic)
and the program I'm working on is a bit challenging.

I know Java, kinda, when I see it. But I haven't found any method
for this.

Anyone have to deal with this before (in Java)?

Regards,
Steve Thompson

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

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

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

Reply via email to