On: Mon, Oct 04, 2010 at 12:10:52PM -0400,George Henke/NYLIC Wrote:

} Minidisks with the END option specified are not included in a DISKMAP when 
} the command, DISKMAP USER is entered.
} 
} What is the reason for this?

DISKMAP EXEC has no knowledge of how bit the MDISK is and so can't
determine overlaps.

} Does this pose a danger when updating the directory directly, no pun 
} intended?  :-)

It can it you are not careful.

To get around this, I wrote an exec that front-ended DISKMAP which among
other things changed all "to END" mdisks to have the actual number of
cylinders.

I am not going to post the entire exec as its large and uses some things
you may not have, but here is the subroutine (and a rexx pipe filter it
uses) that change the END to an actual cylinder number.
NB: It needs CP privclass D (I think).

***** FIXMDEND EXEC *****

/*
  FIXMDEND
  FIX MiniDisk statements using END as the number of cyls.
*/

false = (1=0)
true  = (1=1)
Address COMMAND
Trace O

/*
  Get the directory name.
*/
parse upper arg fn .

'STATE' fn 'DIRECT *'                 /* Exists?                       */
if rc = 0
   then say 'Fixing minidisk END records in' fn 'DIRECT.'
   else exit rc

'PIPE (end ?)',
   '  State' fn 'DIRECT *',           /* Locate file.                  */
   '| Specs w1-3 1',                  /* Just fid.                     */
   '| Getfiles',                      /* File into pipeline.           */
   '| Specs recno 1 1-72 nw',         /* Add recno & drop ser.         */
   '| a: Locate w2 /USER/',           /* Locate user cards.            */
   '| Specs w3 1.9',                  /* Userid.                       */
   '| j: Juxtapose',                  /* Tack userid in front.         */
   '| Rexx FIXMDEND',                 /* Rexx Stage to fix.            */
   '| Pad 90',                        /* Fill out to lrecl.            */
   '| Fileupdate' fn 'DIRECT *',      /* Update the file.              */
   '| Count Lines',                   /* Count the updates.            */
   '| Specs w1 1 /MDISKs with "END" were fixed./ nw',
   '| Console',
   '?',
   'a:',
   '| Locate w2 /MDISK/',             /* Find mdisks...                */
   '| Locate w6 /END/',               /* ... with end.                 */
   '| j:'                             /* Back to juxtapose.            */


***** FIXMDEND REXX *****

/*
  FIXMDEND
  FIX MiniDisk statements using END at the number of cyls.

  This filter is entered with an MDISK statement preceeded
  by 2 words,  the userid and the record number.

  It outputs the changed record preceeded by the record number.
*/

false = (1=0)
true  = (1=1)
Trace O

do forever
   'PEEKTO INPUT'
   if rc ^= 0
      then exit rc * (rc ^= 12)
   parse var input user recno mdisk cuu devtyp s_cyl e_cyl vsn mode rest
   if e_cyl ^= 'END'
      then exit 20
   parse value diagrc(8,'QUERY MDISK USERID' user cuu 'LOCATION
DIRECTORY', 256) with cp_rc . '15'x . . . . . . . . n_cyl '15'x
   if cp_rc = 0
      then do
           n_cyl = right(strip(n_cyl, 'B'),5,'0')
           cuu   = right(cuu,4,'0')
           s_cyl = right(s_cyl,5,'0')

           'OUTPUT' right(recno,10,'0') mdisk cuu devtyp s_cyl n_cyl vsn
mode rest
           end
   'READTO'
end

***** ******

NOTE: Its been a looooooooong time since I last looked at this code, and
just glanceing at it there MAY be some code missing at the bottom as I
normally had specific EXIT or RETURN statements and did not use the
convention of running off the end of the exec to exit.
Note: 2 lines in the filter have been folded.  Locate the lines starting
"DIRECTORY'" and "mode" and tack them onto the previous line.

-- 
Rich Greenberg  Sarasota, FL, USA richgr atsign panix.com  + 1 941 378 2097
Eastern time.  N6LRT  I speak for myself & my dogs only.    VM'er since CP-67
Canines: Val, Red, Shasta, Zero & Casey (At the bridge)        Owner:Chinook-L
Canines: Red & Cinnar (Siberians)  Retired at the beach  Asst Owner:Sibernet-L

Reply via email to