- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: F$TRNLNM not returning expected strings
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-10-2009 05:48 AM
тАО07-10-2009 05:48 AM
F$TRNLNM not returning expected strings
Need some help here. I have a logical name that is defined with multiple strings. When I do a translation of this, it only returns the first string.
Here is the sequence being used:
PROTON::NC6926> DEF/SYSTEM BACK$UDT_EXCLUDE_USERS E38589, 10697, 47646
PROTON::NC6926> Show Logical BACK$UDT_EXCLUDE_USERS
BACK$UDT_EXCLUDE_USERS" [super] = "E10697"
= "E38589"
= "E47646"
PROTON::NC6926> tt = F$EDIT(F$TRNLNM("BACK$UDT_EXCLUDE_USERS"),"UPCASE")
PROTON::NC6926> show sym tt
TT = "E38589"
This is in a script that WAS working at one time. Now it does not.
I have tried deassigning the name, assigning it using /exec and /system, have specified specific logical name tables and anything else I can think of.
I am running a V7.3-2 cluster.
Any thoughts as to why this happens?
Thanks
Mike Carlton
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-10-2009 06:00 AM
тАО07-10-2009 06:00 AM
Re: F$TRNLNM not returning expected strings
Try putting the users inside a string and then
$ write sys$output
F$TRNLNM("BACK$UDT_EXCLUDE_USERS")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-10-2009 06:04 AM
тАО07-10-2009 06:04 AM
Re: F$TRNLNM not returning expected strings
You need to specify an INDEX.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-10-2009 06:31 AM
тАО07-10-2009 06:31 AM
Re: F$TRNLNM not returning expected strings
Grahem gave you the formally correct answer.
That may be enough.
But if the desired result would be
show sym tt
TT = "E38589, 10697, 47646"
Then you should do
DEFINE/SYSTEM BACK$UDT_EXCLUDE_USERS "E38589, 10697, 47646"
Notice that the total value string is enclosed by ONE pair of double quotes.
(a side result will be case preservation in the translation result; but you cured that already with the F$EDIT)
A side remark: if this is in a script, do yourself (and especiallly your collegues!) a big favor and do NOT abbreviate commands, and more so, NEVER shorten to less than 4 characters.
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-10-2009 06:33 AM
тАО07-10-2009 06:33 AM
Re: F$TRNLNM not returning expected strings
Same omission twice a day :-(
I should have begun with:
WELCOME to the VMS forum.
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-10-2009 07:01 AM
тАО07-10-2009 07:01 AM
Re: F$TRNLNM not returning expected strings
No these are not inside a string (at least as far as I can tell).
This is part of a larger set of scripts that manage a Unidata backup. These were written some time ago, probably under V5 and have not been modified since.
For some reason, the users are just now complaining about this. What it is supposed to do is take a list of users and use that list to create a script that logs users off the system.
As this cluster environment here is new to me, I can't really say what else is going on. Still trying to get a handle on the multitude of scripts that they have running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-10-2009 07:30 AM
тАО07-10-2009 07:30 AM
Re: F$TRNLNM not returning expected strings
Thanks for the welcome. It has been several years since I've done VMS system mgmt so I may be a bit rusty in some things.
The original define command does not use the double quotes in defining this logical.
DEF BACK$UDT_EXCLUDE_USERS E38587, E10697, E47646
I will take your advice and change the DEF to the full DEFINE in this procedure. As mentioned, these were all written many years ago for a VAX/VMS V5.3 environment. (circa 1999). There have been some updates to account for the fact that they are now running on an ALPHA V7.3-2 system. I suppose I should look at the script that uses the logical to see how they originally expected to see the list.
My original post showed how the system displayed the logicals so I would suspect they wanted the user list as a list.
This most likely has not worked correctly since the upgrade but has gone unnoticed until now.
I will let you know my results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-10-2009 07:36 AM
тАО07-10-2009 07:36 AM
Re: F$TRNLNM not returning expected strings
I will wholeheartedly agree with Jan. The programming to process the strings will be significantly different depending on whether it is outside quotes (creating a search list, which must be processed using the index parameter) or a quoted string (which would be processed in a number of other ways, including using F$ELEMENT).
I strongly recommend searching for all uses of the BACK$UDT_EXCLUDE_USERS logical name and checking how it is used. For that matter, also check that it is used consistently.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-12-2009 02:28 PM
тАО07-12-2009 02:28 PM
Re: F$TRNLNM not returning expected strings
At the risk of stating the obvious. Although solutions have been suggested, no one has clearly stated the issue, so here goes:
On OpenVMS logical names can have multiple translations, known as a "search list". When the translations are device and/or directory specifications, a logical name translation in a file specification will "walk" the search list until a match is found. For example, assume the logical name is defined as:
$ DEFINE MYLOG DISK1:[DIR1],DISK2:[DIR2],DISK3:[DIR3]
The command:
$ TYPE MYLOG:AFILE.TXT
will look for a file called AFILE.TXT in DISK1:[DIR1], if found that file will be displayed. If not found, DISK2:[DIR2] is searched, and so on. It's a way to make multiple devices and or directories appear to be a single entity.
HOWEVER, the command:
$ CREATE MYLOG:NEWFILE.TXT
will only ever create the file in the first entry in the search list, DISK1:[DIR1]. Also any request to translate the logical name without specifying which entry in the list will return only the first entry (index 0).
If you want to translate the whole list, you'll need to traverse the list. Here's an example:
$ name="BACK$UDT_EXCLUDE_USERS"
$ tt=F$EDIT(F$TRNLNM(name),"UPCASE")
$ IF tt.EQS."" THEN GOTO Finished
$ i=1
$ Loop:
$ te=F$EDIT(F$TRNLNM(name,,i),"UPCASE")
$ IF te.NES.""
$ THEN
$ tt=tt+","+te
$ i=i+1
$ GOTO Loop
$ ENDIF
$ Finished:
$ SHOW SYM tt
Note that this doesn't deal with the issue of an entry containing an embedded comma.
(Logical name search list manipulation is a rather weak area in DCL. This makes writing modular code which does things like add a translation to LNM$FILE_DEV or LNM$LIBRARY rather convoluted. Many years ago I proposed the addition of qualifiers for DEFINE to allow appending and prepending a list, inserting and deleting entries. Unfortunately Guy didn't get that far down the stack before he left...)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-12-2009 05:03 PM
тАО07-12-2009 05:03 PM
Re: F$TRNLNM not returning expected strings
"This is in a script that WAS working at one time. Now it does not. "
Would you be able to post the script or just an extract ?