Question
· Jul 10

Using $ZF(-100) on Caché

Until now i used $ZF(-1), in older Caché versión, now I try to use $ZF(-100),  i do:  

REST>w $ZV
Cache for Windows (x86-64) 2018.1.4 (Build 505_1) Thu May 28 2020 10:12:49 EDT
REST>s a=$zf(-100,"/SHELL","dir")
 
S a=$ZF(-100,"/SHELL","dir")
^
<NOTOPEN>

What is wrong?

 

Thanks in advance

Product version: Caché 2018.1
Discussion (3)3
Log in or sign up to continue

The issue you're encountering with $ZF(-100) and the <NOTOPEN> error likely stems from the use of the "/SHELL" flag. For $ZF(-100) to execute commands with this flag, it may encounter file access issues or problems with setup for standard input/output redirection. Specifically, the <NOTOPEN> error can occur if:

  1. A file specified for input/output redirection cannot be created or opened.
  2. The command cannot be started as requested.

Ensure the following:
- Verify that there are no issues with permissions or availability for any file or resource specified with /STDIN, /STDOUT, or /STDERR flags. These flags control input/output redirection [1].
- When invoking the shell with /SHELL, ensure that the OS command's path is accessible, and there are no syntax errors in the options [1][2].
- Avoid mixing syntax such as redirection operators >> with /STDOUT flags as they might create conflicts [3].

You can resolve this error by ensuring:
1. Necessary permissions are granted to create or open files for redirection.
2. The command and its arguments are validated properly without conflicting flags or operators.
3. Avoid redundant configurations like using /STDOUT flags along with output redirection operators in the command.

For example, to execute a common Windows directory listing command with redirection, use:

set status = $ZF(-100, "/SHELL", "dir", "")
w !,"Status: ", status

Ensure you do not accidentally specify both /STDOUT redirection and shell redirection (>> inside the command). Adjust based on the exact use case and configuration [1][3].

Sources: