If you have an equivalent version of Cache installed with the manager source code available then take a look at briefsub^%GSIZE. 

You can copy this code and amend as you require, remember to include the sub routines it calls and you will have to set a few things up first.  I've done similar things in the past on older systems, the code can look daunting at first but isn't hard to understand enough to use.

On newer systems you would use the %Library.GlobalEdit class.

Another clarification, ppg's are not limited only by disk space, just like all other databases the maximum size of cachetemp can be set to stop infinite growth, this means the ppg's have the same limit.

Also remember, the more you use them the more cachetemp fills.

One last point is that other parts of cache such as odbc queries also use cachetemp for storage and so the whole of cachetemp is not always available.

As ever you have to plan usage appropriately based on the application and the database configuration.