2

My DCL as below (TEST.EXE just print the input )

$ DEFINE DCL$PATH SYS$DISK:[],SYS$LOGIN:,SYS$SYSTEM:
$ PIPE TEST.EXE abc | DEFINE/JOB RET_VALUE @SYS$PIPE
$ x = f$logical("RET_VALUE")
$ WRITE SYS$OUTPUT x

I want to let this DCL show the result is "abc". But this DCL result will show "ABC".

I try add "SET PROCESS/CASE_LOOKUP=SENSITIVE" in DCL, but not workable.

Does anyone have any suggestion or tips? Thanks a lot.

Y.C.
  • 77
  • 6
  • IMHO `$ DEFINE DCL$PATH SYS$DISK:[],SYS$LOGIN:,SYS$SYSTEM:` is a bad idea, suppose a typo like `*sh lo abc` that will lead to launch in sys$system, the file opccrash.exe, so you will reboot very quickly... – user2915097 Apr 20 '16 at 08:58
  • Depends on your privileges and the definition of the logical `OPC$REBOOT` :-) But yes, you can shoot yourself in the foot - as you can do on Unix/bash if you provide a pathname with wildcards. I don't want to argue, the basic idea with this definition is to avoid the `MCR` command or to define foreign commands for all the utilities in `SYS$SYSTEM`. That can be useful. – user2116290 Apr 23 '16 at 10:55

1 Answers1

3

Did you check whether the accepted answer in How to store a result to a variable in HP OpenVMS DCL? helps with this question?

Your DEFINE command in the pipe is DEFINE/JOB RET_VALUE abc, which by DCL is changed to DEFINE/JOB RET_VALUE ABC. DCL doesn't change to UPPERCASE, when the equivalence-name is quoted, which would be a DEFINE/JOB RET_VALUE "abc". However, when you write "@SYS$PIPE", you have the string @SYS$PIPE as equivalence-name. In other words, within a string the redirector @ no longer works. So you have to get the string from SYS$PIPE as is, for example with a READ, as illustrated in the linked answer.

PS: ... and you probably want the remove the .exe from test.exe in your pipe command.

Community
  • 1
  • 1
user2116290
  • 1,062
  • 5
  • 6