ERROR: - OK

which error ??   pls. be specific with all details

hint for SQL Escaping

but test in SQL Shell shows no problem
 

USER>do $system-.SQL.Shell()
SQL Command Line Shell
----------------------------------------------------
 
The command prefix is currently set to: <<nothing>>.
Enter q to quit, ? for help.
USER>>select 'HbA1cTests.sort(''testDate'',false)[0].resultValue'
1.      select 'HbA1cTests.sort(''testDate'',false)[0].resultValue'
 
HostVar_1
HbA1cTests.sort('testDate',false)[0].resultValue
 
1 Rows(s) Affected
statement prepare time(s)/globals/lines/disk: 0.0002s/5/166/0ms
          execute time(s)/globals/lines/disk: 0.0002s/0/385/0ms
                          cached query class: %sqlcq.USER.cls117
---------------------------------------------------------------------------
USER>>

Simplified:
WIJ is the on-disk image of your modified buffers.
If buffers are changed they get updated on-disk by an asynchronous background process.
The modified date is typically the last modification at file close.
writing modification date at every file update as you expect will break every file system.

Transposing your expectation to a text editor would mean to update the file and date at every new line:
I suppose you would be disappointed by the related performance reduction.

Though, from personal experience, this seems to be the standard operating style of almost every government.😉

even deleting the lock from Terminal doesn't seems to work

Whatever you try to express doesn't make sense
Any kind of LOCK  is bound just to the job that executes it
there is just no "UNLOCK" from outside except job termination.

the locking job in your screenshot is 9908
but your terminal is job 10376  
expressed in a picture:
- you try to catch a fly in your room  that is flying somewhere outside the building

I didn't get the meaning of  Field(ge=0) immediately
I see 6 variants to achieve this in IRIS in order of my personal preference

  1. use SQL NULLIF function
  2. use SQL CASE..END block if more complex
  3. use a custom SQL Function = ClassMethod projected as SQLProcedure
  4. create a TRIGGER if this is not just a single case 
  5. use calculated properties with on Change clause
  6. create a customized  OdbcToLogical method 

There are eventually more options