- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- dcl / lexical functions / python
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
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
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
тАО10-24-2007 06:06 AM
тАО10-24-2007 06:06 AM
dcl / lexical functions / python
sh log sys$output
I get:
"SYS$OUTPUT" = "_RIPPLE$FTA40:" (LNM$PROCESS_TABLE)
Likewise if I execute:
output = f$trnlmn("sys$output")
write sys$output "''output'"
I get:
_RIPPLE$FTA40:
I would like to create a Python interface to f$trnlmn.
If I do:
pipe = os.popen('f$trnlmn("sys$output")')
output = pipe.read()
err = pipe.close
sys.stdout.write(output)
I get (as expected):
%DCL-W-IVERB, unrecognized command verb - check validity and spelling
\F$TRNLMN\
If I do:
pipe = os.popen('output = f$trnlmn("sys$output)')
It runs, but I don't know how to get the contents of 'output' back into the Python process?
Suggestions?
Thanks,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2007 06:19 AM
тАО10-24-2007 06:19 AM
Re: dcl / lexical functions / python
the os.popen()?
> %DCL-W-IVERB [...]
F$TRNLNM is not a command. WRITE is.
Note that it _is_ F$TRNLNM, not F$TRNLMN.
(TRaNslate Logical MiNnesota?)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2007 06:52 AM
тАО10-24-2007 06:52 AM
Re: dcl / lexical functions / python
That's why the error was "expected".
Sorry about the typo, everything else still holds.
Still need to be able to get the contents of 'output' back into the Python process.
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2007 06:56 AM
тАО10-24-2007 06:56 AM
Re: dcl / lexical functions / python
> the os.popen()?
Did you try this instead?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2007 06:58 AM
тАО10-24-2007 06:58 AM
Re: dcl / lexical functions / python
Seems to me you are entirely on the wrong track here!
I thought you wanted to get away from DCL?
[ http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1159356 ]
The F$stuff is strictly and only DCL and requires a process running DCL for you. Yuck!
The F$Stuff is 99% directly built on real system services like SYS$TRNLNM.
Just judging by the examples in the Jean-Francois' OpenVMS article those system services as nicely, directly, available in Python... so cut out the middle man (DCL).
See: http://h71000.www7.hp.com/openvms/journal/v6/python-openvms-jfp.html
But what is worse... if you open a process, you'll talk to it via a pipe and the sys$output logical name for that process will not be same as the one you are trying to look up. It will point to a pipe (mailbox), not a terminal.
You may want to check out 'get_logical' in the Python Reference manual:
http://vmspython.dyndns.org/docs/python_vms/installation_manual.html
dig dig dig dig
Cheers,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2007 07:02 AM
тАО10-24-2007 07:02 AM
Re: dcl / lexical functions / python
Your suggestion worked. Pretty straightforward, just didn't think of it.
Thanks,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2007 07:05 AM
тАО10-24-2007 07:05 AM
Re: dcl / lexical functions / python
Never fear, in the end the DCL will be gone, but it will be a while. Just taking baby steps right now. Trying to understand things, etc. I have no prior knowledge of the DCL code.
Thanks for your suggestions,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2007 07:11 AM
тАО10-24-2007 07:11 AM
Re: dcl / lexical functions / python
Thanks,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2007 07:35 PM
тАО10-25-2007 07:35 PM
Re: dcl / lexical functions / python
import vms.rtl.lib
vms.rtl.lib.get_logical('SYS$OUTPUT')
or
import os
os.getenv('SYS$OUTPUT')
will do the job,
lib$get_logical puts something in the first 4 characters and then puts the logical translation, it's not a Python bug...
getenv has not the problem.
JF