NewETAPE projectEmuframe Tape Server (ETAPE) project
z/OS
This page was auto-translated from Spanish

Experiment: compressing a library that LLA has in FREEZE

In LLA and LNKLST: Releasing a Library So You Can Delete It we saw that, with a library in FREEZE, LLA uses its own copy of the directory: if you change a program, the old one keeps running until you refresh LLA. And I left one sentence open: in a PDS the old module stays on disk until the library is compressed.

In this article I do exactly that: compress the library while LLA has it in FREEZE, to see what happens. And then, the right way to do it, according to IBM.

This is a lab idea: a way to try out, in isolation, something that occurred to me. There are probably better or more complete ways to do it. The idea is to see that it works and for everyone to adapt it to what they need, always keeping in mind what IBM licenses allow.

Everything is done with a test library that is only used in STEPLIB, never with a LNKLST library or a production library. IBM warns that using obsolete directory entries can cause abends, integrity problems and system failures.

What IBM says

In the z/OS initialization and tuning guide there is a topic called precisely Compressing LLA-managed libraries:

  • If you compress a library that LLA manages, LLA keeps giving the old directory entries.
  • If the module is in VLF (LLA has kept it in storage), everything still works.
  • If it is not, the system reads it from disk at the old position (the old TTR), where after the compress there may be something else.
  • The right procedure: remove the library from LLA (REMOVE), compress it and add it again (LIBRARIES).

And there is another detail in LLA ENQ consideration: LLA has its libraries allocated with DISP=SHR, so a job that asks for the library with DISP=OLD waits until LLA releases it. And the IBM example to compress with IEBCOPY uses DISP=OLD.

The test library

I create the same library as in the other article, IBMUSER.TEST.LOADLIB, but this time with two programs: HELLOV and, after it, OTHERV. Both do the same thing, write a message with their name, and they have the same size. I set DSNTYPE=PDS to make sure it is a PDS: in a PDSE there is nothing to compress.

//LLASETUP JOB (ACCT),'LLA FREEZE SETUP',CLASS=A,MSGCLASS=X
//* 1. Allocate the test load library (PDS, not PDSE)
//ALLOC    EXEC PGM=IEFBR14
//LOADLIB  DD DSN=IBMUSER.TEST.LOADLIB,DISP=(NEW,CATLG),
//            UNIT=SYSDA,SPACE=(CYL,(1,1,10)),DSNTYPE=PDS,
//            DSORG=PO,RECFM=U,LRECL=0,BLKSIZE=32760
//* 2. HELLOV, version 1 (first member in the library)
//HELLOV   EXEC ASMACL
//C.SYSIN  DD *
HELLOV   CSECT
         STM   14,12,12(13)
         BALR  12,0
         USING *,12
         WTO   'HELLOV VERSION 1'
         LM    14,12,12(13)
         SR    15,15
         BR    14
         END
/*
//L.SYSLMOD DD DSN=IBMUSER.TEST.LOADLIB(HELLOV),DISP=SHR
//* 3. OTHERV, a second program written after HELLOV
//OTHERV   EXEC ASMACL
//C.SYSIN  DD *
OTHERV   CSECT
         STM   14,12,12(13)
         BALR  12,0
         USING *,12
         WTO   'OTHERV VERSION 1'
         LM    14,12,12(13)
         SR    15,15
         BR    14
         END
/*
//L.SYSLMOD DD DSN=IBMUSER.TEST.LOADLIB(OTHERV),DISP=SHR

Experiment: compressing a library that LLA has in FREEZE – screenshot 1

Experiment: compressing a library that LLA has in FREEZE – screenshot 2

And this job runs both programs from the library, with STEPLIB. I will use it several times. COND=EVEN makes the second step run even if the first one ends with an abend:

//LLARUN   JOB (ACCT),'RUN FROM LLA',CLASS=A,MSGCLASS=X
//* Run both programs from the test library (STEPLIB)
//HELLOV   EXEC PGM=HELLOV
//STEPLIB  DD DSN=IBMUSER.TEST.LOADLIB,DISP=SHR
//OTHERV   EXEC PGM=OTHERV,COND=EVEN
//STEPLIB  DD DSN=IBMUSER.TEST.LOADLIB,DISP=SHR

Experiment: compressing a library that LLA has in FREEZE – screenshot 3

Experiment: compressing a library that LLA has in FREEZE – screenshot 4

Add it to LLA with FREEZE

I use the same PARMLIB members as in the other article. CSVLLA01 adds the library to LLA in FREEZE:

LIBRARIES(IBMUSER.TEST.LOADLIB)
FREEZE(IBMUSER.TEST.LOADLIB)

Experiment: compressing a library that LLA has in FREEZE – screenshot 5

And CSVLLA03 removes it:

REMOVE(IBMUSER.TEST.LOADLIB)

Experiment: compressing a library that LLA has in FREEZE – screenshot 6

They have to be two different members: IBM does not allow adding and removing the same library in the same operation.

I add the library to LLA and check that it has the F column (FREEZE):

F LLA,UPDATE=01
D LLA

Experiment: compressing a library that LLA has in FREEZE – screenshot 7

Experiment: compressing a library that LLA has in FREEZE – screenshot 8

Change HELLOV

Now I assemble HELLOV again, with VERSION 2. In a PDS the new member is written at the end and version 1 stays on disk, as unused space, until the library is compressed:

//LLAV2    JOB (ACCT),'HELLOV VERSION 2',CLASS=A,MSGCLASS=X
//* Replace HELLOV with version 2 (version 1 stays as dead space)
//HELLOV   EXEC ASMACL
//C.SYSIN  DD *
HELLOV   CSECT
         STM   14,12,12(13)
         BALR  12,0
         USING *,12
         WTO   'HELLOV VERSION 2'
         LM    14,12,12(13)
         SR    15,15
         BR    14
         END
/*
//L.SYSLMOD DD DSN=IBMUSER.TEST.LOADLIB(HELLOV),DISP=SHR

Experiment: compressing a library that LLA has in FREEZE – screenshot 9

Experiment: compressing a library that LLA has in FREEZE – screenshot 10

The library is now like this: version 1 of HELLOV (which is no longer in the PDS directory), OTHERV and version 2 of HELLOV. As it is in FREEZE, LLARUN still runs version 1, just like in the other article:

Experiment: compressing a library that LLA has in FREEZE – screenshot 11

Compress as in the IBM example: DISP=OLD

This is the job to compress the library, with DISP=OLD, as in the IBM example. With a real library, IBM recommends having a copy before compressing, because if the compress is interrupted the library can become unusable.

//LLACOMP  JOB (ACCT),'COMPRESS LOADLIB',CLASS=A,MSGCLASS=X
//* Compress the test library in place (DISP=OLD, as in IBM's example)
//COMPRESS EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//LIB      DD DSN=IBMUSER.TEST.LOADLIB,DISP=OLD
//SYSIN    DD *
  COPY OUTDD=LIB,INDD=LIB
/*

The job does not get to run: it waits for the library, because LLA has it.

Experiment: compressing a library that LLA has in FREEZE – screenshot 12

Experiment: compressing a library that LLA has in FREEZE – screenshot 13

This command shows who has it:

D GRS,RES=(SYSDSN,IBMUSER.TEST.LOADLIB)

Experiment: compressing a library that LLA has in FREEZE – screenshot 14

So, without meaning to, LLA protects the library: with DISP=OLD it cannot be compressed while LLA manages it. I cancel the job:

C LLACOMP

Compress with DISP=SHR: what you should not do

With DISP=SHR the job does not wait, because LLA also has it shared. This is exactly what IBM says you should not do: compress a PDS that someone else is using. I only do it here, with the test library, to see what happens:

//LLACOMPS JOB (ACCT),'COMPRESS WITH SHR',CLASS=A,MSGCLASS=X
//* Compress with DISP=SHR while LLA has the library in FREEZE.
//* Only for this test: never do this with a real library.
//COMPRESS EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//LIB      DD DSN=IBMUSER.TEST.LOADLIB,DISP=SHR
//SYSIN    DD *
  COPY OUTDD=LIB,INDD=LIB
/*

Experiment: compressing a library that LLA has in FREEZE – screenshot 15

Experiment: compressing a library that LLA has in FREEZE – screenshot 16

Experiment: compressing a library that LLA has in FREEZE – screenshot 17

When it compresses, IEBCOPY moves the members together at the beginning: OTHERV moves to where version 1 of HELLOV was, and version 2 of HELLOV goes after it. But LLA still has the old entry for HELLOV, which points to that position.

I run LLARUN again:

Experiment: compressing a library that LLA has in FREEZE – screenshot 18

Both steps end with RC 0, but each one runs the other program: the HELLOV step writes OTHERV VERSION 1 and the OTHERV step writes HELLOV VERSION 2. There is no error in the job log: the job ends fine and has run the wrong programs.

The explanation is in the old entries that LLA has. The one for HELLOV points to where version 1 was, where OTHERV is now. The one for OTHERV points to its old place, where version 2 of HELLOV is now. There is no abend here, but IBM warns that there can be abends too.

The right way

The IBM procedure has three steps: remove the library from LLA, compress it and add it again.

To fix the problem above, you do not need to compress again. The library is already compressed and it is fine on disk: IEBCOPY updated the PDS directory. The problem is only in the old copy that LLA has: what fixes it is that LLA reads the directory again, when you remove the library and add it again. Even so, I do the three steps to show the complete procedure, the one to follow in a real case.

F LLA,UPDATE=03
D LLA

Experiment: compressing a library that LLA has in FREEZE – screenshot 19

The library is no longer in LLA: now there are 62 libraries instead of 63.

Now LLACOMP, with DISP=OLD, does not wait any more:

Experiment: compressing a library that LLA has in FREEZE – screenshot 20

The IEBCOPY output shows that this time it did not move anything:

Experiment: compressing a library that LLA has in FREEZE – screenshot 21

Both members show WAS ALREADY IN PLACE AND NOT MOVED: this compress did not change anything on disk. So, when LLARUN works correctly again, it will not be because of this compress, but because LLA reads the PDS directory again.

And I add it again with CSVLLA01, which has FREEZE. You have to set it again: if not, a library added with LIBRARIES is in NOFREEZE.

F LLA,UPDATE=01
D LLA

Experiment: compressing a library that LLA has in FREEZE – screenshot 22

Experiment: compressing a library that LLA has in FREEZE – screenshot 23

With the library in FREEZE again, LLARUN now runs each program in its own step:

Experiment: compressing a library that LLA has in FREEZE – screenshot 24

Clean up

To finish, I remove the library from LLA and delete it:

F LLA,UPDATE=03
D GRS,RES=(SYSDSN,IBMUSER.TEST.LOADLIB)

When D GRS no longer shows anyone, the library can be deleted.

Experiment: compressing a library that LLA has in FREEZE – screenshot 25

Summary

  • With FREEZE, LLA uses its own copy of the directory. If the library is compressed, that copy points to places where there is now something else.
  • In the test, after compressing with DISP=SHR, each step of LLARUN ran the other program, with RC 0 and no error at all.
  • To fix it you do not need to compress again: it is enough that LLA reads the directory again, by removing the library and adding it again.
  • With DISP=OLD, the compress waits while LLA has the library. With DISP=SHR it does not wait, and that is the danger.
  • The right way: REMOVE in CSVLLAxx and F LLA,UPDATE=xx, compress, and add it again with LIBRARIES and FREEZE.
  • For LNKLST libraries the procedure is different: you have to take them out of the LNKLST first, as in the other article.

References (z/OS 3.1)

© 2026 Emuframe·🍪 This site only uses functional cookies. No tracking or personal data collection.

On this page