Hi mikmng,
Since wholock is not a subprogram like C$OSLockInfo, I don't believe you'll be able to call it directly as a subroutine. However, you can use the Micro Focus function CALL "SYSTEM" to invoke wholock, with something like:
move spaces to who-command
move "testfile.dat" to file-to-check
string
"wholock " delimited by size
file-to-check delimited by space
" >wholock_results.txt"
x"00"
into who-command
end-string
call "SYSTEM" USING who-command
Then, your program could read the contents of wholock_results.txt to determine the offending process(es). (Please bear in mind that this is a simple example, and is not meant to be used in a real application without some further coding.)