Kirk - here is a routine from PDSEGEN that will do some of what you want

Do_Model: Expose pdsedsn zdsngen null zcmd 
   'dsinfo dataset('pdsedsn')'
   if words(zcmd) = 2 then mdsn = word(zcmd,2)
                      else mdsn   = pdsedsn
   newgen = zdsngen
   munit  = left(zdsspc,1)
   dsnt   = left(zdsdsnt,1)
   'Control Display Save'
   'Addpop'
   do forever
      zcmd   = null
      'Display Panel(pdsegmdl)'
      xrc = rc
      if xrc > 0 then leave
      if sysdsn(mdsn) /= 'OK' then leave
      zerrsm = 'Error...'
      zerrlm = mdsn 'already exists - try a different dsn.'
      'setmsg msg(isrz002)'
      end
   'RemPop'
   'Control Display Restore'
   if xrc > 0 then do
     zerrsm = 'Cancelled'
     zerrlm = 'Model request has been cancelled.'
     'setmsg msg(isrz002)'
     return
     end
  zdsrf = strip(left(zdsrf,1)' 'substr(zdsrf,2,1)' 'substr(zdsrf,3,1))
  library = null
  if dsnt = 'P' then
    library = 'Dsntype(PDS) dsorg(po) dir('zdsdira')'
  if (dsnt = 'L' & newgen = 0) then
    library = 'Dsntype(Library,2) dsorg(po) dir(1)'
  if (dsnt = 'L' & newgen > 0) then
    library = 'Dsntype(Library,2) dsorg(po) dir(1) maxgens('newgen')'
  if zdsvol = null then vol = null
                   else vol = 'Vol('zdsvol')'
  space = null
  if munit = 'B' then space = 'Block('zdsblk')'
  if munit = 'T' then space = 'Tracks'
  if munit = 'C' then space = 'Cylinders'
  Address TSO ,
  'Alloc ds('mdsn') new spa('zds1ex','zds2ex')' vol ,
  'Recfm('zdsrf') Lrecl('zdslrec') Blksize('zdsblk')' ,
  library space
    if rc = 0 then do
       zerrsm = 'Allocated'
       zerrlm = mdsn 'allocated with Space('zds1ex','zds2ex')' ,
                'Recfm('zdsrf') Lrecl('zdslrec') Blksize('zdsblk')' ,
                vol library space
        topdse = mdsn
        end
    else do
         zerrsm = 'Error'
         zerrlm = 'Allocation failure for' mdsn
         end
    'setmsg msg(isrz002)'
    return

--------------------------------------------------------------------------
Lionel B. Dyck (Contractor)  <sdg><
Mainframe Systems Programmer – RavenTek Solution Partners

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