1827809 Members
1939 Online
109969 Solutions
New Discussion

Re: F$DEVICE lexical

 
SOLVED
Go to solution
Art Wiens
Respected Contributor

F$DEVICE lexical

If one reads:

Lexicals
F$DEVICE
Arguments
search_devnam

Specifies the name of the device for which F$DEVICE is to search. The asterisk (*) and the percent sign (%) wildcard characters are allowed in the search_devnam argument.

Specify the search_devnam argument as a character string expression.

Why would you not be able to use:

$ disk = f$getdvi("$1$DK*","DISK")

It works if you specify f$getdvi("*","DISK"), but I only want info on the scsi disks with allocation class $1$.

* isn't _really_ a wildcard?

Cheers,
Art
23 REPLIES 23
Art Wiens
Respected Contributor

Re: F$DEVICE lexical

I'm having a bad day here...one more time.

The f$device lexical help reads that you can use an * wildcard...I made a slip in my post (f$getdvi), but in my command procedure I _am_ using f$device and it doesn't work.

Maybe one too many "Cheers" ;-)
Art
Lawrence Czlapinski
Trusted Contributor
Solution

Re: F$DEVICE lexical

Art,
1. You need to specify device type which is usually "GENERIC_DK".
2. Unfortunately the "*" has to be a prefix.
CNSRV1» device_name = f$device("*0:","DISK","GENERIC_DK")
CNSRV1» SH SYM DEVICE_NAME
DEVICE_NAME = "_$1$DKA400:"
CNSRV1» device_name = f$device
("*0:","DISK","GENERIC_DK")
CNSRV1» SH SYM DEVICE_NAME
DEVICE_NAME = "_$1$DKB100:"
CNSRV1» device_name = f$device("*00:","DISK","GENERIC_DK")
CNSRV1» SH SYM DEVICE_NAME
DEVICE_NAME = "_$1$DKA400:"
CNSRV1» device_name = f$device("*:","DISK","GENERIC_DK")
CNSRV1» SH SYM DEVICE_NAME
DEVICE_NAME = "_$1$DKA400:"
CNSRV1» device_name = f$device("*100:","DISK","GENERIC_DK")
CNSRV1» SH SYM DEVICE_NAME
DEVICE_NAME = "_
David B Sneddon
Honored Contributor

Re: F$DEVICE lexical

Art,

The following works for me...

$ say f$device("$255$DK*:","DISK")
! nothing found on this one

$ say f$device("*DK*:","DISK")
_$255$DKB0:

$ say f$device("_$255$DK*:","DISK")
_$255$DKB0:

Not quite sure how the matching is done, I will
have a look at the source listings.

Regards
Dave
Wim Van den Wyngaert
Honored Contributor

Re: F$DEVICE lexical

I also found that DISK is not a correct device class (http://www.sysworks.com.au/disk$vaxdocmar963/decw$book/dy4yaaa6.p130.decw$book#2390).
It should be DC$_DISK.

And the device type should be one of the list http://www.sysworks.com.au/disk$vaxdocmar963/decw$book/dy4yaaa6.p131.decw$book#2392

Confusing.

Wim
Wim
Karl Rohwedder
Honored Contributor

Re: F$DEVICE lexical

F$DEVICE("*$1$DK*","DISK") works perfectly on our system.
Wim Van den Wyngaert
Honored Contributor

Re: F$DEVICE lexical

Karl,

I agree because I use disk too. But it's not the option that is documented.

Wim
Wim
David B Sneddon
Honored Contributor

Re: F$DEVICE lexical

From Karl's example and mine above it would
appear to have something to do with the leading
underscore character. "_$1$DK*" works and
"*$1$DK*" works but "$1$DK*" doesn't.
Haven't had a chance to check the source listings
yet.

Dave
Willem Grooters
Honored Contributor

Re: F$DEVICE lexical

Working on a not-clustered VMS7.3-1 system, I found that this works:

f=f$device("*$DK*", "DISK")

Each call will yield the next device (in arbitrary order as the HELP tells me).

So if you just want the $1$-devices, put a * in front and after:

f=f$device("*$1$DK*", "DISK")

may give the required result.

But it isn't very logically you seem to need the both....

HTH

Willem

Willem Grooters
OpenVMS Developer & System Manager
Dale A. Marcy
Trusted Contributor

Re: F$DEVICE lexical

It appears that it is doing the comparison to the physical device name which always contains a leading underscore. If you include the underscore or wildcard it, it will match. If you notice all of the values returned, if a match is found, contain the leading the underscore, so I think this is what it is matching the wildcarded value against.
Lawrence Czlapinski
Trusted Contributor

Re: F$DEVICE lexical

Wim, DC$_ is the prefix for device class. The device class names are the part after the DC$.
Art,
ASDEV1» device_name=f$device("*$4$*:","DISK")
ASDEV1» sh sym device_name

In a DCL procedure you can do something like:
$ class = 1
$ START:
$ DEVICE_NAME = -
F$DEVICE("*$''class'$:","DISK","RA60")
$ IF DEVICE_NAME .EQS. "" THEN EXIT
$ SHOW SYMBOL DEVICE_NAME
$ GOTO START

Lawr
Wim Van den Wyngaert
Honored Contributor

Re: F$DEVICE lexical

I would say the doc need a review.

In 7.3 : f$dev points to doc of f$getdvi. There it points to examples that don't exist. So no list of allowed values.

If DC$ is a prefix, it should be documented.
If _ is required, idem.

Since the beginning (87) I have the impression that each VMS OS programmer was free to implement devices his own way (: or not, _, prefixes etc).

Wim
Wim
John Yu_1
Valued Contributor

Re: F$DEVICE lexical


Seems to me that
f$device("*$1$dk*:","DISK")
should work fine.
Artificial intelligence is rarely a match for natural stupidity.
Hein van den Heuvel
Honored Contributor

Re: F$DEVICE lexical

The search name is used with STR$MATCH_WILD.

If any help needs to be improved it is HELP RTL STR$ STR$MATCH because it does not even mention the % and * characters.

Device names do contain a leading underscore which stops logical name translation. That's just how it is. Documented and readily visible with the "*" example

It would seem clear to me that "_xxx" does not match "xxx" but "_xxx", "*xxx" and "%xxx" do match that.

fwiw,
Hein.
Art Wiens
Respected Contributor

Re: F$DEVICE lexical

Ten points for everyone because it's Christmas! ;-).

Thanks all, I understand now.

Sorry for the delay on points assignment, it's been a "scary" time...a remote VAX (production critical!) working away for the past 10 years had a system disk failure. No problem ... we'll just get another disk and restore the most recent backup tape. What's that, you stopped doing backups "a long time ago"?!?!?!?!? :-O

I sent them two disks with v6.2 on them, they mixed up which were mine, which was their old disk! :-O

They've managed to find some 8mm's from "a long time ago". I'm giving them DCL backup commands over the phone, they're making typo's and typing in things I didn't tell them to!

First tape gave parity errors right off the bat. Second one's running right now. Hard to say how it will end...

No cheers right now, but thanks,
Art
Jan van den Ende
Honored Contributor

Re: F$DEVICE lexical

Art,

let me wish you strength!

And then, if you have wrestled though this, then rhere will be some teaching, I hope?
And some VERY plain, VERY stupid, VERY short, but VERY consise instructions!

and remember: "may you live in interesting times" is more a curse than a good wish.


Cheers.

Have one on me (and if you get things going again, that IS a deserved one)

Jan

Don't rust yours pelled jacker to fine doll missed aches.
Uwe Zessin
Honored Contributor

Re: F$DEVICE lexical

Prefixing a device name with '_' to stop any further translation is very old and even predates the TERMINAL logical name attribute, which, if I recall correctly, was introduced with VAX/VMS V4.0 when the logical name system was overhauled.
.
Jan van den Ende
Honored Contributor

Re: F$DEVICE lexical

Uwe,

I don't remember the introduction of /TERMINAL, but I _DO_ know it became much less relevant, to the extend that I consider it obsolete, at V5.1 (maybe 5.0, never had that on my hands, nor 6.0 nor 7.0, for that matter)
Under V4.x (and I -think- V3, but unsure)
Concealed Logical Names had to be /TERMINAL, and so they had to reference the physical device directly.
But since V5, if you simply omit /terminal, everything works fine, and you can point a concealed device to a directory structure on the concealed logical name for a disk, that does not need to be terminal, and may even translate to another conc. lnm for the disk.

Makes things more simple, which (to me) is always welcome.

hth

Cheers.

Have one on me.

Jan
Don't rust yours pelled jacker to fine doll missed aches.
Uwe Zessin
Honored Contributor

Re: F$DEVICE lexical

I was talking about:

$ define /TRANSLATION_ATTRIBUTES=TERMINAL

The CONCEALED attribute is a different matter - it is for display purposes, but, yes, the combination of both attributes has always been 'interesting'.

VAX/VMS V3 had 3 fixed logical name tables (process?, group and system). One could not see any other tables.
.
Jan van den Ende
Honored Contributor

Re: F$DEVICE lexical

Uwe,


VAX/VMS V3 had 3 fixed logical name tables (process?, group and system).

make that four:
Process, Job, Group, and System; only those, and searched in that fixed order.


The CONCEALED attribute is a different matter - it is for display purposes, but, yes, the combination of both attributes has always been 'interesting'.


well... "display" purposes... not untrue, but it mostly serves to let directories be presented as devices, allowing for many "logical", and dynamic, devices mapped upon one physical.
Your interpunction of 'interesting' suggest things like puzzling, confusing, troublesome, or the likes of that.
Especially after the obligation for /TERMINAL has been lifted from /TRANS=CONCEAL, I hardly found any issue, and I grew really fond of the concept, even up to the degree that I count it as one of the things that makes VMS so great and so flexible.
(only one wish still standing: recursiveness, ie, allowing a directory within a concealed device to be the root of another one)


Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Steve Nimr
Advisor

Re: F$DEVICE lexical

Be aware some 4100's get a second round of the same disks when using f$device("*","disk")
Ian Miller.
Honored Contributor

Re: F$DEVICE lexical

Steve, you may see the same disk names more than once from f$device if the alpha is connected to the disk and the disk is also served by another alpha which is also connected to the disk.
____________________
Purely Personal Opinion
Jan van den Ende
Honored Contributor

Re: F$DEVICE lexical

Steve, Ian,

I have never noticed that myself, but I definitely would consider it a BUG.
If there are multiple paths to the same disk, then VMS should certainly be aware of that same-ness!!
I KNOW in our system there USED to be multiple paths from 2100's to HSZ40 connected disks, and THEY were seen only once.
Now (ES'es, DS) with HSG80 connected disks, each disk shows 5 (FIVE) paths to it (2 paths to both switches, plus an MSCP path), but each DISK is seen only once!

Proost.

Have one on me.

Seasonal greetings to all!

Jan
Don't rust yours pelled jacker to fine doll missed aches.
Uwe Zessin
Honored Contributor

Re: F$DEVICE lexical

It's an old problem since VAX/VMS version 4 that has to do with timing.
.