Operating System - OpenVMS
1748136 Members
3683 Online
108758 Solutions
New Discussion юеВ

Re: Get opened file when logical is available in DCL

 
Piet Timmers_1
Frequent Advisor

Get opened file when logical is available in DCL

Hello everybody,

I perform the following command:

$ open/write test test.dat
$ sh log test
"TEST" = "_$1$DGA13" (LNM$PROCESS_TABLE)

Is there a way to get the filename using the logical given when opening this file.

Thanks.

Piet Timmers
6 REPLIES 6
Joseph Huber_1
Honored Contributor

Re: Get opened file when logical is available in DCL

Well this is a hen and egg problem:
until the file is opened by DCL, there is no logical name :-)

I assume You are asking:
If a file is open by DCL under a logical name, how can I find the file-specification ?

There was a macro program once posted by J.Briggs:
http://wwwvms.mppmu.mpg.de/vmssig/src/mar/ppf.mar

And an example how to use it:
http://wwwvms.mppmu.mpg.de/vmssig/src/mar/testppf.com

http://www.mpp.mpg.de/~huber
Jon Pinkley
Honored Contributor

Re: Get opened file when logical is available in DCL

It your are using windows as your browser, the links provided by Joseph Huber aren't going to work well.

If you are interested in the PPF program, see my comment dated Jun 22, 2007 21:00:12 GMT in the following thread

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1138609

It has the PPF.MAR file attached as a text document, so it will display correctly on windows without jumping through hoops.

It is the same, but doesn't have some extra comments at the top that were evidently part of John Briggs posting. If you want to download from the links Joseph Huber provided to a VMS system, I would suggext using wget on the VMS system, followed by a global replace of the trailing on each line.

Here's the part my post doesn't have at the top.

;PPF.MAR PPF translate specified PPF logical name to file specification
;$! test.com
;$ ppf = "$sys$login:ppf.exe"
;$ ppf sys$input
;$ show sym phy_file_name
;$ show sym org_file_name
;$ show sym fid_file_name
;
;$ @test
; PHY_FILE_NAME = "EISNER$DRA3:[DECUSERVE_USER.BRIGGS]TEST.COM;5"
; ORG_FILE_NAME = "EISNER$DRA3:[DECUSERVE_USER.BRIGGS]TEST.COM;5"
; FID_FILE_NAME = "DISK$USER3:[DECUSERVE_USER.BRIGGS]TEST.COM;5"
;
;It's non-privileged code and doesn't involve digging into any
;DCL data structures. The only tricky bit is:
;
; bisw2 #fab$m_ppf_ind,fab+fab$w_ifi
;
;which sets the bit to allow the $DISPLAY service to reach out and
;see the underlying file name rather than stopping at the PPF logical
;name. The code works on Alpha and on VAX without modification.
;
; John Briggs



The following thread on ITRC is also related.

http://forums12.itrc.hp.com/service/forums/questionanswer.do?threadId=1139459
it depends
Joseph Huber_1
Honored Contributor

Re: Get opened file when logical is available in DCL

>>
If you want to download from the links Joseph Huber provided to a VMS system, I would suggext using wget on the VMS system, followed by a global replace of the trailing on each line.
>>
Well I don't think there is anything special. My (OSU-) web server is sending the macro file as (web-)standard text (i.e. terminated.
A "save as ... text" from the browser should produce a valid text file on the local system.
Don't know why wget on VMS is always producing a STMLF file, but anyway there is no need to remove the s, just change the record format to what it really is:
SET FILE/ATTR=RFM:STM ppf.mar

BTW the macro compiler doesn't care of s,

http://www.mpp.mpg.de/~huber
Martin Vorlaender
Honored Contributor

Re: Get opened file when logical is available in DCL

Jon & Josef,

I had no problems to look at the attached .MAR file, using Opera under Win2k. I'd suspect it's MSIE (again) that tries funky things with a .MAR file, as the default link for that file type is a "Microsoft Office Access Report".

cu,
Martin
Jan van den Ende
Honored Contributor

Re: Get opened file when logical is available in DCL

Re Martin:

>>>
a .MAR file, as the default link for that file type is a "Microsoft Office Access Report".
<<<

Yeah, THAT must be the explanation.

I (painfully) recognise the phenomenon.

As you surely have noted by now, my initials are "jpe". From way back when, that is why for every kind of temporary/test/whatever private version of any file, I always use ".JPE" as extension. But M$ insists that those have "Invalid graphical (JPEG) format".

I -HATE- it when Redmond thinks they now me better than I know myself! :-(

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Joseph Huber_1
Honored Contributor

Re: Get opened file when logical is available in DCL

Ah Yes , it's MSIE, Mozilla is behaving o.k. even on Windows.
So the rule for my wwwvms.mppmu.mpg.de server:
don't open files in MSIE browser, use
"save target as ..."
I tested, and it stores the file (after changing the extension from .MAR to .TXT) correctly.
http://www.mpp.mpg.de/~huber