MainframeSupports
tip week 23/2006:

Sometimes I need to enlarge the concatenation of a DD name with an extra dataset. The task is to find out what the original concatenation looks like and then reallocate the DD name with the old concatenation plus an extra dataset. Normally the extra dataset will be placed in front of the old concatenation. This is an easy task to perform manually. But if I want to perform the enlargement at runtime, the following REXX may help:

/* REXX: ENLARGE */
ARG FILENAME DSNAME
FILENAME = '  'FILENAME
DSNAME = ''''DSNAME''''
CALL OUTTRAP('LISTA.')
ADDRESS TSO "LISTALC STATUS"
CALL OUTTRAP('OFF')
DSLIST = ''
OLDLINE = ''
DDNAMEHIT = 0
DO LINENO = 1 TO LISTA.0
  LINE = LISTA.LINENO
  IF SUBSTR(LINE, 1, 10) = '' & DDNAMEHIT
  THEN
    DSLIST = DSLIST','''OLDLINE''''
  ELSE
    IF SUBSTR(LINE, 1, 10) = FILENAME
    THEN DO
      DSLIST = DSLIST'('DSNAME','''OLDLINE''''
      DDNAMEHIT = 1
    END
    ELSE
      IF SUBSTR(LINE, 1, 2) = ''
      THEN
        DDNAMEHIT = 0
  OLDLINE = LINE
END
DSLIST = DSLIST')'
ADDRESS TSO
"ALLOC FI("FILENAME") DA"DSLIST" SHR REUSE"
EXIT

This REXX uses the TSO command LISTALC STATUS to determine the current concatenation of the DD name supplied in parameter FILENAME. The second parameter is the dataset name you wish to use in front of the current concatenation of the DD name in parameter FILENAME. The DSNAME parameter must be a fully qualified dataset name. Imagine now that you always want your ISPF session to look in dataset MY.PANELS before ISPF considers other datasets allocated to ISPPLIB. The command TSO ENLARGE ISPPLIB MY.PANELS should do the trick.

Unfortunately you will discover that ENLARGE fails in the ALLOC command. This is due to the fact that all ISP*LIB DD name are opened by ISPF at startup time and remains open until ISPF terminates. You have to terminate ISPF in order to reach the TSO READY prompt. Here you can perform the command ENLARGE ISPPLIB MY.PANELS and then start ISPF again. Now ISPF will load panels from MY.PANELS before looking in the rest of the concatenation.

Previous tip in english        Sidste danske tip        Tip list