$PAGE "MPE TABLE ACCESS:  INPUT/OUTPUT DEVICE DIRECTORY (XDD)"          00001000
COMMENT --                                                              00002000
<<**********************************************************>>          00003000
<<*                                                        *>>          00004000
<<*                 INCLXDD - Module C2                    *>>          00005000
<<*                     MPE4 version                       *>>          00006000
<<*                                                        *>>          00007000
<<**********************************************************>>          00008000
                                                                        00009000
$IF X8 = OFF                                                            00010000
$CONTROL NOLIST                                                         00011000
$IF                                                                     00012000
                                                                        00013000
INPUT DEVICE DIRECTORY/OUTPUT DEVICE DIRECTORY                          00014000
----------------------------------------------                          00015000
                                                                        00016000
IDD/ODD (Common attributes referred to as XDD)                          00017000
                                                                        00018000
        IDD:  DST = 45 (= %55)         ODD:  DST = 46 (= %56)           00019000
              SIR =  3                       SIR =  4                   00020000
                                                                        00021000
               Overview of table structure                              00022000
               ---------------------------                              00023000
                                                                        00024000
         +-------------------------------------+                        00025000
         |   Entry 0 (8 words)                 |                        00026000
         | . . . . . . . . . . . . . . . . . . |                        00027000
       2 |   Subentry area pointer             | ---                    00028000
         | . . . . . . . . . . . . . . . . . . |   |                    00029000
         |                                     |   |                    00030000
         +-------------------------------------+   |                    00031000
         |   Head entries (4 words each)       |   |                    00032000
         +-------------------------------------+   |                    00033000
         |   Subentries (%36 words each)       | <--                    00034000
         +-------------------------------------+                        00035000
                                                                        00036000
                                                                        00037000
          Entry 0 (overall table definitions)                           00038000
          -----------------------------------                           00039000
                                                                        00040000
    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                      00041000
  +--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--+                     00042000
 0|      Maximum size     |      Current size     |0 (sectors)          00043000
  +-----------------------+-----------------------+                     00044000
 1|  Head entry size = 4  |  Subentry size = %36  |1 ( words )          00045000
  +-----------------------+-----------------------+                     00046000
 2|   Subentry area pointer (segment relative)    |2                    00047000
  +--+--------------------------------------------+                     00048000
 3|DD|      Next avail device file ID (DFID)      |3                    00049000
  +--+--------------------------------+-----------+                     00050000
 4|///////////////////////////////////|   Fence   |4                    00051000
  +-----------------------------------+-----------+                     00052000
 5|///////////////////////////////////////////////|5                    00053000
  +-----------------------------------------------+                     00054000
 6|///////////////////////////////////////////////|6                    00055000
  +-----------------------------------------------+                     00056000
 7|///////////////////////////////////////////////|7                    00057000
  +-----------------------------------------------+                     00058000
                                                                        00059000
DD:     0 ==> This is the IDD,                                          00060000
        1 ==> This is the ODD.                                          00061000
                                                                        00062000
Fence:  For spooled output devices (ODD), the system-wide out-          00063000
        fence.  For spooled input devices (IDD), the jobfence.          00064000
                                                                        00065000
                                                                        00066000
         Typical head entry (4 words)                                   00067000
         ----------------------------                                   00068000
                                                                        00069000
    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                      00070000
  +--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--+                     00071000
  |    Device outfence    |     Logical device    |                     00072000
  +-----------------------+-----------------------+                     00073000
  |                 Head pointer                  |                     00074000
  +-----------------------------------------------+                     00075000
  |                 Tail pointer                  |                     00076000
  +-----------------------------------------------+                     00077000
  |///////////////////////////////////////////////|                     00078000
  +-----------------------------------------------+                     00079000
                                                                        00080000
  There are two types of head entry, a class entry and a logi-          00081000
cal device entry. There is only one class entry, and it is the          00082000
first head entry in the XDD.  All  spoofles  opened  by  class          00083000
(e.g.,  LP,  SLOWLP, EPOC, PP, etc.) are linked to this entry.          00084000
There is one logical device entry for each real (physical,  as          00085000
opposed  to virtual) device on the system.  Output devices ap-          00086000
pear in the ODD, input devices in the IDD.  AC/DC devices such          00087000
as terminals appear in both directories.                                00088000
  Each head entry is linked to 0 or more subentries (a typical          00089000
subentry is shown in the next table).  There is  one  subentry          00090000
for  each  file (including spoofles) which exists for a device          00091000
or device class.  A null chain (0 subentries) consists of head          00092000
pointer = 0 and tail pointer = segment-relative address of the          00093000
head pointer.  If one or more subentries exists, the  pointers          00094000
are  segment-relative addresses of the first word of the first          00095000
and last subentries of the chain.  Any intermediate subentries          00096000
are forward-linked through the subentries.  The tail  subentry          00097000
always contains a 0-link.                                               00098000
  Subentries are linked first by descending priority, then  by          00099000
class  (only if in the class chain), and finally by rank (time          00100000
stamp in the subentry).  As priorities and/or  devices  change          00101000
(:ALTSPOOLFILE or SPOOK), subentries must be relinked to main-          00102000
tain the above order.                                                   00103000
  The Device Outfence and LDEV# fields are meaningless for the          00104000
class entry.  For logical device entries (non-0 Logical Device          00105000
field), a non-0 Device Outfence means that this outfence over-          00106000
rides the system-wide outfence in word 4 of entry 0, but  only          00107000
for this device.                                                        00108000
$PAGE                                                                   00109000
         Typical subentry (%36 words)                                   00110000
         ----------------------------                                   00111000
                                                                        00112000
    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15                      00113000
  +--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--+                     00114000
 0|VF|State|  Outpri   |CL|         Device        |0                    00115000
  +--+--+--+-----------+--+-----------------------+                     00116000
 1| Type|                Job number               |1                    00117000
  +-----+-----------------------------------------+                     00118000
 2|                                               |2                    00119000
 3|                   User name                   |3                    00120000
 4|                                               |4                    00121000
 5|                                               |5                    00122000
  +-----------------------------------------------+                     00123000
 6|                                               |6                    00124000
 7|                 Account name                  |7                    00125000
10|                                               |8                    00126000
11|                                               |9                    00127000
  +-----------------------------------------------+                     00128000
12|                                               |10                   00129000
13|                    Job name                   |11                   00130000
14|                                               |12                   00131000
15|                                               |13                   00132000
  +-----------------------------------------------+                     00133000
16|                                               |14                   00134000
17|                   File name                   |15                   00135000
20|                                               |16                   00136000
21|                                               |17                   00137000
  +--+--------------------------------------------+                     00138000
22|IO|              Device file ID                |18                   00139000
  +--+--+-----------------+-----------------------+                     00140000
23|FS|DA|/////////////////| Head index (see expl) |19                   00141000
  +--+--+-----------------+-----------------------+                     00142000
24|    Logical device     |   Sector address...   |20                   00143000
  +-----------------------+                       |                     00144000
25|                           of spoofle label.   |21                   00145000
  +-----------------------------------------------+                     00146000
26|   Number of extents   |      Virtual LDEV     |22                   00147000
  +-----------------------+-----------------------+                     00148000
27|           Last extent size (sectors)          |23                   00149000
  +--+--+--+--+--+--+--+--------------------------+                     00150000
30|SQ|//|RS|FD|SO|AB|//|     Number of copies     |24                   00151000
  +--+--+--+--+--+--+--+--------------------------+                     00152000
31|    Segment-relative link to next subentry,    |25                   00153000
  |    this device or class. 0 ==> last subentry. |                     00154000
  +-----------------------------------------------+                     00155000
32|   Number of records in spoofle (doubleword)   |26                   00156000
33|                                               |27                   00157000
  +-----------------------+-----------------------+                     00158000
34|     Year MOD 100      | Julian Day of Year/2  |28                   00159000
  +--+--------------+-----------------+-----------+                     00160000
35|DY| Hour (24 hr) |     Minute      |///////////|29                   00161000
  +--+--------------+-----------------+-----------+                     00162000
$PAGE                                                                   00163000
Note:  Words 0-%24 are used in all subentries.  Words %25-%37,          00164000
       although present in all subentries, are zero unless the          00165000
       subentry is for a spooled file (spoofle).                        00166000
                                                                        00167000
Word   0:  VF    -- An "entry visited" flag for SHOWFILES.              00168000
           State -- State of subentry:                                  00169000
                      0 ==> Active                                      00170000
                      1 ==> Ready                                       00171000
                      2 ==> Open                                        00172000
                      3 ==> Locked                                      00173000
           CL    -- 1 ==> DEVICE field is a class  index  into          00174000
                      the Device Class Table.                           00175000
                    0 ==> DEVICE field is an LDEV number.               00176000
Word   1:  Type  -- Describes which  environment  created  the          00177000
                    subentry:                                           00178000
                      0 ==> Session' (SPOOK)                            00179000
                      1 ==> Session                                     00180000
                      2 ==> Job                                         00181000
                      3 ==> Job'     (SPOOK)                            00182000
Word %22:  IO    -- 1 ==> Output DFID                                   00183000
                    0 ==> Input  DFID                                   00184000
Word %23:  FS    -- There are one or more  forms  message  re-          00185000
                    quests in the spoofle.                              00186000
           DA    -- The spoofle was created via a :DATA record          00187000
                    (input spooling only).                              00188000
Word %24:  LDEV  -- The logical device in  class  SPOOL  where          00189000
                    the file label (first extent) of the spoo-          00190000
                    fle lives.                                          00191000
Word %26:  VDEV  -- LPDT index of virtual device  LDEV.  Simu-          00192000
                    lates the properties of a real LDEV to the          00193000
                    process which  FOPENs  a  new  (previously          00194000
                    non-existing)  file  (State field (XDD(0).          00195000
                    (1:2)) = 2 (Open)).                                 00196000
Word %30:  SQ    -- 1 ==> Squeeze (purge) spoofle  extents  as          00197000
                          the final copy is printed.                    00198000
                    0 ==> Purge only when final copy printed.           00199000
           RS    -- 1 ==> Restart job when warmstarting (input          00200000
                          spooling only).                               00201000
           FD    -- 1 ==> There are non-standard forms on  the          00202000
                          device.                                       00203000
           SO    -- Spaced Out bit.  File System could not ac-          00204000
                    quire a new extent when creating spoofle.           00205000
           AB    -- This is the $STDLIST of an aborted job.             00206000
Words %34-35:    -- Time stamp when spoofle was made READY, or          00207000
                    0D if not closed properly.  Julian day  is          00208000
                    9 bits starting with Word %34, bit 8.               00209000
                                                                        00210000
Head index:  The (segment-relative address)/4 of the head  en-          00211000
             try  with  which  this subentry is linked.  Since          00212000
             head entries are four words  long,  this  can  be          00213000
             thought  of  as an index into the head entry por-          00214000
             tion of the XDD -- if you disallow  values  of  0          00215000
             and 1.  Cute, huh?                                         00216000
$PAGE                                                                   00217000
$IF X8 = OFF                                                            00218000
$CONTROL LIST                                                           00219000
$IF                                                                     00220000
             *-*-*-*-*-*-*-*-*-*-*-*-*-*-*                              00221000
             |  Declarations start here  |                              00222000
             *-*-*-*-*-*-*-*-*-*-*-*-*-*-*                              00223000
Conventions used in the declarations:                                   00224000
1.  We presume the existence of the following  logical  arrays          00225000
    or pointers:                                                        00226000
  a)  XDD           -- when referencing the master entry or  a          00227000
                       data segment relative address.                   00228000
  b)  XDD'HEAD      -- when referencing a head entry.                   00229000
  c)  XDD'SUBENTRY  -- when referencing a subentry.                     00230000
  d)  XDD'BSUBENTRY -- byte array equivalent of XDD'SUBENTRY.           00231000
  e)  XDD'DSUBENTRY -- double array equivalent of XDD'SUBENTRY          00232000
    Use the array size EQUATEs below (2x for XDD'BSUBENTRY and          00233000
    x/2 for XDD'DSUBENTRY). The 0-element of all arrays is as-          00234000
    sumed to be the first word of the current entry, -NOT- the          00235000
    first word of that area of the XDD.  The arrays can be di-          00236000
    rect, indirect, DB-relative or Q-relative. If DB-relative,          00237000
    make sure you know where DB is before you  use  them.  The          00238000
    only  time  you  have to explicitly reference them is when          00239000
    you declare them and when you set their starting  address.          00240000
    (Note the EQUATE to get you the class head entry).  There-          00241000
    after the DEFINEs below will  implicitly  reference  them.          00242000
    You must use the DEFINEs though.                                    00243000
2.  Prefixes in the DEFINEs are:                                        00244000
  a)  XDD0  -- when referencing something in the master entry.          00245000
  b)  XDDH  -- when referencing something in a head entry.              00246000
  c)  XDDS  -- when referencing something relevant to both  an          00247000
               IDD subentry and an ODD subentry.                        00248000
  d)  XDDSB -- when using a byte reference in an XDD subentry.          00249000
  e)  XDDSD -- when using a double reference in  an  XDD  sub-          00250000
               entry.                                                   00251000
  f)  ODDS  -- when referencing something relevant only to  an          00252000
               ODD subentry.                                            00253000
  g)  IDDS  -- when referencing something relevant only to  an          00254000
               IDD subentry.                                            00255000
3.  Within each set of prefixes, DEFINEs of fields  are  given          00256000
    alphabetically  for easier lookup without using XREF.  DE-          00257000
    FINEs of states of fields are listed sequentially  follow-          00258000
    ing the field DEFINE.                                               00259000
;                                                                       00260000
EQUATE                                                                  00261000
   IDD'DST               = 45                       ,                   00262000
   IDD'SIR               =  3                       ,                   00263000
                                                                        00264000
   ODD'DST               = 46                       ,                   00265000
   ODD'SIR               =  4                       ,                   00266000
$PAGE                                                                   00267000
<< The following three EQUATE's must be changed if XDD  en- >>          00268000
<< try lengths change.                                      >>          00269000
                                                                        00270000
   SIZE'OF'XDD0          =  8                       ,                   00271000
   SIZE'OF'XDD'HEAD      =  4                       ,                   00272000
   SIZE'OF'XDD'SUBENTRY  = 30                       ,                   00273000
                                                                        00274000
   XDD'MPE'VERSION       =  4                       ,                   00275000
   XDD'CLASS'INDEX       =  2                       ,                   00276000
   XDD'CLASS'ENTRY       = XDD'CLASS'INDEX *                            00277000
                             SIZE'OF'XDD'HEAD       ;                   00278000
                                                                        00279000
<< XDD zero'th entry fields                                 >>          00280000
                                                                        00281000
DEFINE                                                                  00282000
   XDD0'CURRENT'SECTORS  = XDD(0).(8:8)            #,                   00283000
   XDD0'HEAD'LENGTH      = XDD(1).(0:8)            #,                   00284000
   XDD0'MAX'SECTORS      = XDD(0).(0:8)            #,                   00285000
   XDD0'NEXT'DFID        = XDD(3).(1:15)           #,                   00286000
   XDD0'SUBENTRY'AREA    = XDD(2)                  #,                   00287000
   XDD0'SUBENTRY'LENGTH  = XDD(1).(8:8)            #,                   00288000
   XDD0'SYSTEM'OUTFENCE  = XDD(4).(12:4)           #,                   00289000
   XDD0'IDD'OR'ODD       = XDD(3).(0:1)            #,                   00290000
        XDD0'IDD         = 0                       #,                   00291000
        XDD0'ODD         = 1                       #;                   00292000
                                                                        00293000
<< XDD head entry fields                                    >>          00294000
                                                                        00295000
DEFINE                                                                  00296000
   XDDH'DEV'OUTFENCE     = XDD'HEAD(0).(0:8)       #,                   00297000
   XDDH'FIRST'SUBENTRY   = XDD'HEAD(1)             #,                   00298000
   XDDH'LAST'SUBENTRY    = XDD'HEAD(2)             #,                   00299000
   XDDH'LDEV             = XDD'HEAD(0).(8:8)       #;                   00300000
                                                                        00301000
<< XDD subentry fields (except IDD/ODD specific fields).    >>          00302000
                                                                        00303000
DEFINE                                                                  00304000
   XDDS'ACCOUNT'NAME     = XDD'SUBENTRY(6)         #,                   00305000
   XDDS'CLASS            = XDD'SUBENTRY(0).(7:1)   #,                   00306000
   XDDS'DAY'OF'YEAR      = XDD'SUBENTRY(28).(8:8) & LSL(1)              00307000
                               LOR XDD'SUBENTRY(29).(0:1) #,            00308000
   XDDS'DEVICE           = XDD'SUBENTRY(0).(8:8)   #,                   00309000
   XDDS'DFID'IN'OR'OUT   = XDD'SUBENTRY(18).(0:1)  #,                   00310000
        XDDS'DFID'IN     = 0                       #,                   00311000
        XDDS'DFID'OUT    = 1                       #,                   00312000
   XDDS'DFID'NUMBER      = XDD'SUBENTRY(18).(1:15) #,                   00313000
   XDDS'FILE'NAME        = XDD'SUBENTRY(14)        #,                   00314000
   XDDS'HEAD'INDEX       = XDD'SUBENTRY(19).(8:8)  #,                   00315000
   XDDS'HOUR             = XDD'SUBENTRY(29).(1:5)  #,                   00316000
   XDDS'JOB'NAME         = XDD'SUBENTRY(10)        #,                   00317000
   XDDS'JOB'NUMBER       = XDD'SUBENTRY(1).(2:14)  #,                   00318000
   XDDS'JOB'TYPE         = XDD'SUBENTRY(1).(0:2)   #,                   00319000
        XDDS'SESSION'    = 0                       #,                   00320000
        XDDS'SESSION     = 1                       #,                   00321000
        XDDS'JOB         = 2                       #,                   00322000
        XDDS'JOB'        = 3                       #,                   00323000
   XDDS'LAST'EXTENT'SIZE = XDD'SUBENTRY(23)        #,                   00324000
   XDDS'LSW'LABEL        = XDD'SUBENTRY(21)        #,                   00325000
   XDDS'LSW'RECORD'COUNT = XDD'SUBENTRY(27)        #,                   00326000
   XDDS'MINUTE           = XDD'SUBENTRY(29).(6:6)  #,                   00327000
   XDDS'MSW'LABEL        = XDD'SUBENTRY(20).(8:8)  #,                   00328000
   XDDS'MSW'RECORD'COUNT = XDD'SUBENTRY(26)        #,                   00329000
   XDDS'NEXT'SUBENTRY    = XDD'SUBENTRY(25)        #,                   00330000
      XDDS'END'OF'CHAIN  = 0                       #,                   00331000
   XDDS'NUMBER'EXTENTS   = XDD'SUBENTRY(22).(0:8)  #,                   00332000
   XDDS'OUTPUT'PRIORITY  = XDD'SUBENTRY(0).(3:4)   #,                   00333000
   XDDS'SPACED'OUT       = XDD'SUBENTRY(24).(4:1)  #,                   00334000
   XDDS'SPOOFLE'LDEV     = XDD'SUBENTRY(20).(0:8)  #,                   00335000
   XDDS'SPOOL'STATE      = XDD'SUBENTRY(0).(1:2)   #,                   00336000
        XDDS'ACTIVE      = 0                       #,                   00337000
        XDDS'READY       = 1                       #,                   00338000
        XDDS'OPEN        = 2                       #,                   00339000
        XDDS'LOCKED      = 3                       #,                   00340000
   XDDS'SUBENTRY'VISITED = XDD'SUBENTRY(0).(0:1)   #,                   00341000
   XDDS'UNUSED'SUBENTRY  = 0                       #,                   00341100
   XDDS'USER'NAME        = XDD'SUBENTRY(2)         #,                   00342000
   XDDS'VIRTUAL'LDEV     = XDD'SUBENTRY(22).(8:8)  #,                   00343000
   XDDS'YEAR             = XDD'SUBENTRY(28).(0:8)  #,                   00344000
   XDDSB'ACCOUNT'NAME    = XDD'BSUBENTRY(12)       #,                   00345000
   XDDSB'FILE'NAME       = XDD'BSUBENTRY(28)       #,                   00346000
   XDDSB'JOB'NAME        = XDD'BSUBENTRY(20)       #,                   00347000
   XDDSB'USER'NAME       = XDD'BSUBENTRY(4)        #,                   00348000
   XDDSD'DISC'LABEL      = XDD'DSUBENTRY(10)       #,                   00349000
   XDDSD'READY'TIME      = XDD'DSUBENTRY(14)       #,                   00350000
   XDDSD'RECORD'COUNT    = XDD'DSUBENTRY(13)       #;                   00351000
                                                                        00352000
<< IDD-only subentry fields.                                >>          00353000
                                                                        00354000
DEFINE                                                                  00355000
   IDDS'DATA             = XDD'SUBENTRY(19).(1:1)  #,                   00356000
   IDDS'RESTART          = XDD'SUBENTRY(24).(2:1)  #;                   00357000
                                                                        00358000
<< ODD-only subentry fields.                                >>          00359000
                                                                        00360000
DEFINE                                                                  00361000
   ODDS'ABORTED'JOB      = XDD'SUBENTRY(24).(5:1)  #,                   00362000
   ODDS'FORMS'IN'FILE    = XDD'SUBENTRY(19).(0:1)  #,                   00363000
   ODDS'FORMS'ON'DEVICE  = XDD'SUBENTRY(24).(3:1)  #,                   00364000
   ODDS'NUMBER'COPIES    = XDD'SUBENTRY(24).(8:8)  #,                   00365000
   ODDS'PURGE'EXTENTS    = XDD'SUBENTRY(24).(0:1)  #;                   00366000
                                                                        00367000
COMMENT --                                                              00368000
<<**********************************************************>>          00369000
<<*                                                        *>>          00370000
<<*                     END INCLXDD                        *>>          00371000
<<*                                                        *>>          00372000
<<**********************************************************>>          00373000
;                                                                       00374000
