Thanks for all the replies guys!
So a clarification first as I went back through my code to remind myself just what exactly I clubbered together!!!
Well, turns out my initial aim was rather high-enough, meaning:
1) first I check whether I need to use a particular API (that's the rxu_api_required variable)
- this is pre-defined at the start of the REXX script, it's a generic framework I use in all my scripts, so different REXX DLLs may be loaded by different scripts
2) if I need to use a particular REXX DLL API, I then check to see if it's already been loaded into memory (that's the rxu_api variable)
3) at the very end of my code I call the DLL unload procedure where I:
- check to see if all the flagged DLLs have been previously loaded into memory (by examining the rxu_api variable)
- only if one was not previously loaded do I actually un-load it
Sooo...weird, but this was rock-solid, never any problems...then all of a sudden...BAM!!!
I booted to my MAINT partition and did a CHKDSK on my boot drive, found it to be DIRTY, so I ran with a /F parameter. That claimed to correct some things, no messages about lost dirs or files though.
I booted up, re-tested, but still the same failure.
I thought I would re-install the RXU RPM package, but strangely I'm seeing this in ANPM:
----------[ 29 Sep 2022 20:03:25 ]----------
Executing: @python2.7 G:\UTIL\ANPM\scripts\yum_reinstall.py rxu
Enabling temporary repository arcanoae-sub
Enabling temporary repository arcanoae-exp
Enabling temporary repository arcanoae-stage
Running Transaction Check
Non-fatal POSTIN scriptlet failure in rpm package rxu-1.a.0-3.oc00.pentium4
ERROR: wpi4rpm: Please, close WarpIN and reinstall "rxu" again.
ERROR: wpi4rpm: Please, close WarpIN and reinstall "rxu" again.
warning: %post(rxu-1.a.0-3.oc00.pentium4) scriptlet failed, exit status 253
Return code: 0
----------[ 29 Sep 2022 20:03:40 ]----------
Not sure if the mirror is down or something like that (as I do get a warning from ANPM itself), but I'll re-try later.
For now I have taken the advice to NOT un-load the DLL, so that's been commented out and things appear to work.