1753665 Members
5501 Online
108798 Solutions
New Discussion юеВ

String to Symbol on DCL

 
SOLVED
Go to solution
albanese
Occasional Advisor

String to Symbol on DCL

Hello everyone.

I need to write a DCl script which takes the output of SHOW DEV D and saves it in a file. this is easy show dev d /output=show.

Now my problem is how to extract value from the output of the command.

Device Device Error Volume Free Trans Mnt
Name Status Count Label Blocks Count Cnt
DSA1: Mounted 0 SMSC_DATA1 68411499 208 1

i am interested in extracting the value of free memory which in this case is 68411499, assign it to a symbol and compare it with a particular value.

i know how to do it in unix using awk but i am not really familiar with OpenVMS.

i would be grateful if anyone could give any suggestion about this matter.

Thanks in advance. All the best..
9 REPLIES 9
Heinz W Genhart
Honored Contributor
Solution

Re: String to Symbol on DCL

Hi albanese

You could just use the lexical function f$getdvi

freeblocks = f$getdvi("dsa1","Freeblocks")

I think that should solve your problem

Regards

Heinz
Heinz W Genhart
Honored Contributor

Re: String to Symbol on DCL

Hi albanese

I just recognized, that you are new in this forum and would like to welcome you

Regards

Heinz
Robert Gezelter
Honored Contributor

Re: String to Symbol on DCL

Albanese,

Welcome to the OpenVMS forum on ITRC.

Actually, while you can parse the output of the SHOW DEVICE command, there is a far better way to do things in OpenVMS DCL.

DCL has a series of callable functions, known as lexical functions, that give full access to essentially all of the information available using the SHO DEVICE command. In 1995, I presented a session at the US Fall DECUS symposium entitled
"DCL Lexical Functions: OpenVMS Jujitsu" (copies of slides available via http://www.rlgsc.com/decus/usf95/index.html ) on just such usage.

As a matter of preference, getting information using lexical functions (and system service calls within executable programs) is far preferable to parsing output of commands, which may be enhanced in the future.

I hope that the above is helpful, and once again, welcome to the OpenVMS world and the OpenVMS Forum on ITRC.

- Bob Gezelter, http://www.rlgsc.com
albanese
Occasional Advisor

Re: String to Symbol on DCL

Thanks a lot Guys for the quick reply.

I will read about the lexical functions.

Cheers..
Jan van den Ende
Honored Contributor

Re: String to Symbol on DCL

Albanese,

since you are obiously new to VMS (Welcome!) there is ONE command that you really should know, and use a lot:

HELP

It is self-explaining.

I hardly qualify as new (20+ years of VMS), but it still is probably my most-used command.

Maybe just play a little with it, and see what at will tell you. More than worth your time!

Proost. (you wrote Cheers, What is the Albanese for it?)

Have one on me.

jpe

Don't rust yours pelled jacker to fine doll missed aches.
T. Simpson
Occasional Advisor

Re: String to Symbol on DCL

If you want a disk space utility and/or examples of how to use the lexical functions to get disk related info, check dcl.openvms.org. There are several scripts posted there that should interest you.

There is no need to extract the info from a text display.

Regards,
Tom
albanese
Occasional Advisor

Re: String to Symbol on DCL

Thanks to everyone.

I did it.

Thanks Jan.

The albanian word for Proost is G├Г┬лzuar .

Have two on me..

Take care. All the best.
albanese
Occasional Advisor

Re: String to Symbol on DCL

G├Г┬лzuar
albanese
Occasional Advisor

Re: String to Symbol on DCL

Waww its Gezuar the e is with two dots on top. Anyways thanks again.