Mark:

I have a REXX procedure I wrote many years ago that does the job. I can say that it works on z/OS 2.1, but don't have access to a 2.2 system, although I can see no reason why it won't run there.

I don't believe that we can attach files on this listserv, so here it is in source form:

/* rexx */
 /* ----------------------------------------------------------------
    Syntax:
         %ralok dsname filename <top | bottom | replace>

    This REXX procedure can be used to alter the existing allocation
    for the file identified in the second operand. The data set
    whose name is supplied as the first operand will be inserted
    into the existing allocation (or replace it), depending on the
    value of the third operand (as follows):

         top       - inserts the data set named as the first data
                     set in the concatenation for the file

         bottom    - inserts the data set named as the last data
                     set in the concatenation for the file

         replace   - inserts the data set named as the only data set
                     allocated to the file

    arguments:
         dsname    - the name of the data set to be used in altering
                     the concatenation for the file.

         filename  - the ddname of the file whose concatenation is
                     to be altered.

         <top | bottom | replace> - explained above - determines
                     where in the concatenation order the data set
                     is placed. The default is top.
---------------------------------------------------------------- */
 /* ----------------------------------------------------------------
    Obtain the parameters.
---------------------------------------------------------------- */
    parse upper arg dsname filename option .
    if length(dsname) = 0 then , /* Dsname and file are required.    */
      if length(filename) = 0 then do
        say 'You must provide a data set name and a file name.'
        say 'Syntax: ralok dsname filename <TOP|BOTTOM|REPLACE>'
      exit 20
    end
 /* ----------------------------------------------------------------
    Initialize variables.
---------------------------------------------------------------- */
    dsnames = ''                /* List of allocated data sets       */
    found = 0                   /* Set file found indicator off      */
    if length(option) = 0 then option = 'TOP'
 /* ----------------------------------------------------------------
    Act on the option specified.
---------------------------------------------------------------- */
    select
      when option = 'REPLACE' then do  /* Replace entire allocation. */
        address TSO 'ALLOC F('filename') DA('dsname') SHR REUSE'
        say 'Data set: 'dsname' replaces allocation for file:' filename
        exit rc
      end
      when (option = 'TOP' | option = 'BOTTOM') then do
 /* ----------------------------------------------------------------
    Enable SYSOUT trapping. Results go in the array named lista.
---------------------------------------------------------------- */
        x = outtrap(lista.)     /* Trap output from LISTA command.   */
        address TSO 'LISTALC ST'
        x = outtrap(off)        /* Disable output trapping.          */
        if lista.0 = 0 then exit /* No output from LISTALC, quit.    */
     /* ----------------------------------------------------------------
        Find the desired file in the LISTA output.
---------------------------------------------------------------- */
        do line = 2 to lista.0  /* skip command and header lines     */
       /* --------------------------------------------------------------
          Process terminal file entry or null file entry.
-------------------------------------------------------------- */
          if (substr(lista.line,1,8) \= 'TERMFILE') & ,
             (substr(lista.line,1,8) \= 'NULLFILE') then do
            parse var lista.line ddname .
            ddname = strip(ddname)                /* Remove blanks   */
            if filename = ddname then do  /* Matches input filename  */
              line = line - 1             /* Back up one line.       */
              parse var lista.line name . /* Isolate the dsname      */
              dsnames = "'"strip(name)"'" /* Assign it to the list   */
              found = 0                   /* Found = 1 when the next
                                             file (ddname) is found. */
              line = line + 1             /* Back to current line.   */
              do until found            /* Continue to next file.    */
                line = line + 2         /* Check for next file       */
                if line <= lista.0 then , /* Don't go past end of
                                             LISTA output listing.   */
                  if substr(lista.line,1,8) \= '        ' then ,
                    found = 1           /* Next file name found      */
                  else do               /* Add another data set name */
                    line = line - 1     /* Back up one line          */
                    parse var lista.line name . /* Get dataset name  */
                    dsnames = dsnames "'"strip(name)"'" /* Add it.   */
                    line = line + 1     /* Go next line.             */
                  end
                else found = 1          /* end of lista output.      */
              end
            end
          end
        end
     /* --------------------------------------------------------------
        Add the data set name to the top or bottom of the data set
        names already allocated to the file and redo the allocation.
-------------------------------------------------------------- */
        if option = 'TOP' then dsnames = dsname dsnames
        else dsnames = dsnames dsname   /* Add dsname to name list.  */
        address tso 'ALLOC F('filename') DA('dsnames') SHR REUSE'
        if rc = 0 then say 'Data set 'dsname' allocated at the 'option ,
          'of the concatenation order for file: 'filename
      end
      otherwise say 'Invalid option: 'option' only TOP, BOTTOM or ',
        'REPLACE allowed.'
    end
 /* ----------------------------------------------------------------
    End of processing, set up to execute REXX procedures and leave.
---------------------------------------------------------------- */
    address TSO 'EXECUTIL SEARCHDD(YES)'

Mike Myers
Mentor Services Corporation

On 11/30/2016 11:19 AM, Steely.Mark wrote:
Would anyone be able to provide a way to concatenate a library to the SYSPROC 
allocation.

I have tried the concat program from the CBT tape file 134 that abend with a 
S0c4.
I have tried a rexx exec called ALLOCREX. This sort of works ( it adds my ds to 
SYSPROC) but does not keep the same setup of SYSPROC before the addition.
I have tried clist SPROC from IBM but for some reason it is not working.



Does anyone have something they can share for z/os V2.2.

Thanks

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to