I'm at a site that has a MASSIVE library of copybooks and it occurs to me.... Are they all being used? I can do "where-used" queries, and "uses" queries... but how would you tackle finding "not-used" queries...?
Are the copybooks managed by Endevor?
We need never used, no such comment, etc. query. I will vote for that idea, I know I would be executing that if we had it.
What Emlyn said.
Hi John, We've written our own utility for this. Nothing complicated...1. List all copybooks2. ACMQ for all copybooks3. REXX to review the ACMQ output and build DELETE SCL if a copybook is not used
How do you know for sure there is no ACMQ data missing? If you are sure it's complete, I like Emlyn's process but would add Archive from Prod before Delete.
We certainly don't have all the ACMQ data but we have the vast majority of it. Any deletions from out production stage are automatically transferred to our archive environment. As archive is an Endevor environment it's easy for developers to recover any copybook if they find that it is needed.
What Emlyn said... I havent made it to copybooks yet, but I have done the above for inventory areas (sys/subs/types/procgrps). We currently ahve many applications cleaning up their stuff, so I dont know that I woudl take on the sole repsonsibility of deciding which copybooks are good and which arent. For now I'd be happy if they woudl just clean out the ancient stuff in the lower stages.
The process in How to create ACM information without generating comes pretty close to identifying unused copybooks. See https://communities.ca.com/thread/241737601 . That process does not depend on existing ACM information, but rather it scans source code to find copybook references. After making a list of existing copybook elements it matches the list with the names of copybooks found from the scan. With a little work on the provided REXX, it can identify the existing copybook elements that are not referenced by any program.
Before the COPYBOOKS are archived, copy them into a special copybook library. This copybook library can be added to the processor as the last copybook library in the concatination, make sure to monitor components. You can then look to see if the COPYBOOKs were pulled in from the special COPYBOOK library via component list information or ACMQ. This can help to determine what COPYBOOKs can possibly be archived. Before doing this, I would work to cleanup the appropriate COPYBOOKs in pre-production stages.
Turns out the answer is actually doing an ACMQ Batch query on where-used! It seems that if I wildcard everything (except TYPE... I want to control TYPE.... and STAGE as well...) and do a BATCH query, ACMQ actually appears to use the Element Catalog to fetch the name of every element that matches the criteria and then provides the report indicating # ELM USING the the ELEMENT ACTION SUMMARY REPORT. All you have to do is look for a value of "0" in that column.
Huh. Who knew?
So now it depends on the veracity of the data in your ACM!
Retrieving data ...