The OPEN command has a very complicated syntax which is difficult to get right.
It is preferable to use classes from the %IO package instead which are much easier to use and provide the same functionality.
For instance, for opening a file, instead of using:
OPEN "myfile"
prefer using:
#dim f as %IO.FileStream
#dim status as %Status
set f = ##class(%IO.FileStream).%New()
do f.open("myfile",,,,.status)
// check $$$ISOK(status)