Operating System - OpenVMS
1752679 Members
5363 Online
108789 Solutions
New Discussion юеВ

help me with my script in OpenVms

 
CIDJULIO
Occasional Contributor

help me with my script in OpenVms

You are very friendly Bob Gezelter.

This is my first script in OpenVMS, I have looked at your recomendation, but I don't know what write after "$pml/input=sys$input/..."

I have writed a file, but this solution it's middle bad because just I need monitoring some process in PML, but from other linux server, in other words. For me it's not neccesary create temporal files in OpenVMS, I wanna just see the information.

Thanks a lot for all and beautiful day!!

10 REPLIES 10
Robert Gezelter
Honored Contributor

Re: help me with my script in OpenVms

CIDJULIO,

I do not have PML installed on my systems, but the following should work. Note that since the input file does not contain any variable data, it can just be read from SYS$INPUT (which simply is inline in a command file).

$ SEND_PML:
$ pml := $smsc$root:[bin]pml
$ define/user sys$output nla0:
$ pml/input_file=sys$input/queue=send_pml_command/response_time=60
CONNECT
ENABLE OUTPUT /FILE=za.txt
time
show class smh /sm_rec/sm_trans /notif_tran
show class smh /msg_buff
DISCONNECT
EXIT
$ EOD

It may be a good idea to review the information in the documentation kit about writing command files and the use of process permanent files in particular.

- Bob Gezelter, http://www.rlgsc.com
John Gillings
Honored Contributor

Re: help me with my script in OpenVms

Just to be a pedant (or perhaps just unimaginative?)...
It never occurred to me that you could use "$ EOD" without starting with "$ DECK".

$ SEND_PML:
$ pml := $smsc$root:[bin]pml
$ define/user sys$output nla0:
$ pml/input_file=sys$input/queue=send_pml_command/response_time=60
$ DECK
CONNECT
ENABLE OUTPUT /FILE=za.txt
time
show class smh /sm_rec/sm_trans /notif_tran
show class smh /msg_buff
DISCONNECT
EXIT
$ EOD
A crucible of informative mistakes
Robert Gezelter
Honored Contributor

Re: help me with my script in OpenVms

John,

Admittedly, I dropped the $ DECK, but a quick test case (as follows) confirms that it is not needed (unless of course you want a more specific delimiter for end of stream, or if the stream contains "$" in column 1):

$ TYPE SYS$INPUT
This is a first test line
This is a second test line
$ EOD

- Bob Gezelter, http://www.rlgsc.com
Steven Schweda
Honored Contributor

Re: help me with my script in OpenVms

> It never occurred to me that you could use
> "$ EOD" without starting with "$ DECK".

Apparently it's (helpfully) ignored, except
that "$ EOD" does start with "$", and that's
good enough to do the intended job.

Not classy style, though, I'd say.
Robert Gezelter
Honored Contributor

Re: help me with my script in OpenVms

Steven,

Well, while the $ EOD is effectively a NO-OP in this case, it is at least an actual termination of the input stream.

Since the poster states that they are a DCL neophyte, I wanted the simplest example possible. Using "$ (some other command)" could have been mis-interpreted.

In effect, $ EOD has similar properties to the "//* and "/*" cards used on HASP and ASP on System/360 and descendants.

- Bob Gezelter, http://www.rlgsc.com
Steven Schweda
Honored Contributor

Re: help me with my script in OpenVms

> Using "$ (some other command)" could have
> been mis-interpreted.

What couldn't be?

$ !!! End of input.

A plain end-of-file would work, too. As
usual, many things are possible (and some, I
claim, would be less confusing than a loose
"EOD".)

Interestingly, around here, "HELP EOD"
doesn't actually mention "DECK" except in the
example, so perhaps the Style Police are
getting too fussy, after all. Everything's
complicated.
Willem Grooters
Honored Contributor

Re: help me with my script in OpenVms

Given the code snipplet:
...
$ (run a program or procedure, reading from SYS$INPUT until 'end of data')
data1
data2
data3

$ EOD
...

All lines until, EXCLUDING, the first line starting with "$", will be passed to the program.

What happens to blank lines depends on the program reading the lines. It _may_ interpret a line as "End of data", but could also use is as-is. Without knowing the program, you cannot tell what happens. But no matter what, input ends in the first line starting with "$".

It's good practice, IMHO, to either use
$DECK - $EOD

or specify a specific string where data ends. Something like "ENDOFDATA" (or, as I've seen once: "^Z" (exactly as shown!))

WG
Willem Grooters
OpenVMS Developer & System Manager
Hoff
Honored Contributor

Re: help me with my script in OpenVms

I use DECK (possibly with /DOLLAR) and EOD around any SYS$INPUT data that can include OpenVMS device names, or that can contain OpenVMS filenames. Devices (and thus filenames) can begin with a $ character.

Trivia: EOJ is analogous to LOGOUT.

David Jones_21
Trusted Contributor

Re: help me with my script in OpenVms

"Trivia: EOJ is analogous to LOGOUT."

And unlike LOGOUT, is rarely redefined by the site to invoke a cleanup procedure prior to logging you out. Therefore, EOJ is my standard method of logging out.
I'm looking for marbles all day long.