- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- DCL F$PARSE Bug?
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
Forums
Discussions
Discussions
Discussions
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
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
03-06-2006 09:51 PM
03-06-2006 09:51 PM
DCL F$PARSE Bug?
In this example, for DEVICE and DIRECTORY, it keeps returning the environment default which I'm sure is wrong.
For filename, it correctly returns blank!
ALPHA_ROB$$ @ROB.TMP
$ SH DEF
SY:[LIVE.DAT]
$ WS F$PARSE("SY2:[LIVE.XXX]",,,"DIRECTORY")
[LIVE.XXX]
$ WS F$PARSE("SY2:",,,"DIRECTORY")
[LIVE.DAT]
$ WS F$PARSE("SY2:[LIVE.XXX]",,,"NAME")
ALPHA_ROB$$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2006 10:03 PM
03-06-2006 10:03 PM
Re: DCL F$PARSE Bug?
For that matter, a similar comment applies to the DEVICE option. Both DEVICE and DIRECTORY operate as you describe, with and without the SYNTAX_ONLY option.
Operationally, you can describe the operation as a "silent" third default string, that of the current default device string.
In any event, it is not a recent change. I checked it on 6.2.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2006 10:10 PM
03-06-2006 10:10 PM
Re: DCL F$PARSE Bug?
I can't think why you'd have 2 different outputs for the same method of call though!
Rob.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2006 10:26 PM
03-06-2006 10:26 PM
Re: DCL F$PARSE Bug?
Supply a bogus DECnet node for the second argument and it will suppress using the process default directory, e.g. f$parse("SYS2:","XXX::",,"DIRECTORY)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2006 10:39 PM
03-06-2006 10:39 PM
Re: DCL F$PARSE Bug?
The behaviour changes dependent on the return field, which I found very worrying.
However, this is documented in the DCL Dictionary :-
"If you omit the device and directory names in the filespec argument, the F$PARSE function supplies defaults, first from the default-spec argument and second from the related-spec argument. If names are not provided by these arguments, the F$PARSE function uses your current default disk and directory. "
But, I don't agree with this.
F$PARSE by it's very name should return a parsed string of the information yuo give it. By this example, there is no way to explicitly return the DEVICE or DIRECTORY as blank.
In fact you have to do something like this, which is pants! :-
$ IF F$PARSE("ABC.COM","[XXXX]",,"DIRECTORY") .EQS. "[XXXX]" THEN ......
Robert.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2006 12:14 AM
03-07-2006 12:14 AM
Re: DCL F$PARSE Bug?
is wrong, too.
alp $ show default
ALP$DKA0:[SMS]
alp $ dire ALP$DKA100:
%DIRECT-W-NOFILES, no files found
(There exists an empty "ALP$DKA100:[SMS]".)
alp $ dire ALP$DKB300:
%DIRECT-E-OPENIN, error opening ALP$DKB300:[SMS]*.*;* as input
-RMS-E-DNF, directory not found
-SYSTEM-W-NOSUCHFILE, no such file
This is the way it works. I'd bet against it
ever being changed.
What should be used for the directory if you
specify only the device? Or for the device
if you specify only the directory? Perhaps
some sort of "default" device and directory?
Sometimes life is hard.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2006 12:24 AM
03-07-2006 12:24 AM
Re: DCL F$PARSE Bug?
If you want to start using defaults, then you should have to explicitly supply them, i.e. :-
$ WS "FILE = " + F$PARSE("","CHANGED.TMP",,"NAME")
FILE = CHANGED
$ WS "FILE = " + F$PARSE("",,,"NAME")
FILE =
If I want dynamic defaulting, I just need to do F$PARSE("FILE.COM",F$ENV("DEFAULT"),,"NAME")
I restate....there is no way to return "" for F$PARSE("",,,"DIRECTORY").
Rob.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2006 12:34 AM
03-07-2006 12:34 AM
Re: DCL F$PARSE Bug?
f$file_scan function.
Writing your own was easier before ODS5
extended file names, too. Looking for "["
and "]" is not what it once was.
Everything's complicated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2006 12:45 AM
03-07-2006 12:45 AM
Re: DCL F$PARSE Bug?
First: This is the way it is, and even if it might be wrong it can not be changed for the default case or it would break too much. I suppose one could design an alternative to "SYNTAX_ONLY", perhaps "FILESCAN", but that does not seem worth it to me. Still, Guy might like it and it would simply map onto the existing system service SYS$FILESCAN.
Second: Ido not think it to be wrong, albeit maybe lsightly confusion to some.
Think of it this way: F$PARSE does what 'the system would do' and gives you string handles to play with.
If you were to tell the system to $CREATE TMP
That is: no extention and it will not add an extention and thus parse does not return one.
Now issue $CREATE .TMP
There is no file name, only an extention, and the system will not add a filename and consistently F$PARSE does not return one.
In both cases however the file is created in the default directory and consistently F$PARSE returns that string.
For a slightly more elegant workaround I would recommend a brute-force string subtraction. It avoids the conditional:
$ test_dir = f$parse ("test:","
$ show symb test_dir
TEST_DIR = "
$ test_dir = test_dir - "
$ show symb test_dir
TEST_DIR = ""
(I threw in the case difference for fun :-).
Hope this helps some,
Regards,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2006 12:53 AM
03-07-2006 12:53 AM
Re: DCL F$PARSE Bug?
And I was not even really done. The warmign on the lower case was only half of it. There is also a warning on the pointy brackets vs square brackets:
$test_dir = f$parse ("test:[abc]","
$ show symb test_dir
TEST_DIR = "
>> No....$PARSE should be $PARSE, not $SEARCH.
That is exactly what "SYNTAX_ONLY" accomplishes: no search.
It stops the actual search (which is the only way to return a dynamic file version string, but parse still tells you where it would have looked
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2006 12:59 AM
03-07-2006 12:59 AM
Re: DCL F$PARSE Bug?
Interesting to read peoples points of view on this - wobbly bottom lip to know I'm in the minority on this one :(
I've logged an issue on the HP Advocacy site to see if they can add a "PARSE_ONLY" qualifier, which should make me and everyone else happy again :)
Rob.
P.S. Still disagree about the functionality of something that 'parses', so please feel free to leave you comments on how wrong I am ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2006 09:48 PM
03-07-2006 09:48 PM
Re: DCL F$PARSE Bug?
Purely Personal Opinion