- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Process-permanent SYS$OUTPUT, WRITE SYS$OUTPUT and...
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
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
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-25-2019 02:09 AM
10-25-2019 02:09 AM
Process-permanent SYS$OUTPUT, WRITE SYS$OUTPUT and DEFINE /USER vs DEFINE /PROCESS
A colleague had recently made some changes to a command procedure that is invoked from the DCL command line, and it invokes another command procedure.
In the calling procedure, he changed it to do DEFINE /USER SYS$OUTPUT temporary_file before invoking the called procedure, and when the calling procedure was invoked, WRITE SYS$OUTPUT calls in the called procedure failed with the warning message "%DCL-W-UNDFIL, file has not been opened by DCL - check logical name".
Changing the code to wrap the invocation of the called procedure inside a DEFINE (/PROCESS) and DEASSIGN (/PROCESS) of SYS$OUTPUT works.
I was intrigued enough to try and find an explanation as to why this is the case, but I've been unable to (looked in DCL Dictionary, Programming Concepts, IDSM, User Manual).
I get that SYS$OUTPUT is a process-permanent file, and has special handling and does not need to be OPENed in order to WRITE to it.
I can't fathom why WRITE fails to write to SYS$OUTPUT if it has been redefined with DEFINE /USER, but does write to it if it has been redefined with DEFINE /PROCESS (the DEFINE /PROCESS doesn't create the file, and WRITE does not of itself open a channel to a new file).
My only thoughts are "magic jiggery-pokery" being undertaken by the CLI - can anyone provide a more detailed reason?
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2019 02:21 PM - last edited on 10-30-2019 07:26 AM by Parvez_Admin
10-25-2019 02:21 PM - last edited on 10-30-2019 07:26 AM by Parvez_Admin
Re: Process-permanent SYS$OUTPUT, WRITE SYS$OUTPUT and DEFINE /USER vs DEFINE /PROCESS
> A colleague [...]
> [...] had recently made some changes to a command procedure that is
> invoked from the DCL command line, and it invokes another command
> procedure. [...]
An actual test case might be more helpful than any such (vague)
description.
> [...] In the calling procedure, he changed it to do DEFINE /USER
> SYS$OUTPUT temporary_file before invoking the called procedure, [...]
Did anyone actually open that file? The default SYS$OUTPUT may not
need it, but some plain-old file might. For example:
ITS $ define /user_mode sys$output fred.out
ITS $ write sys$output "ABC"
%DCL-W-UNDFIL, file has not been opened by DCL - check logical name
There's no need for nested DCL scripts to get that effect.
> [...] but does write to it if it has been redefined with DEFINE
> /PROCESS [...]
I know nothing, but I might guess that invoking ("@") the sub-script
causes DCL to do things with whatever SYS$OUTPUT is at that time.
So, your actual complaint is that invoking the sub-script makes it
all work better (or more easily) than it would if everything were at the
same level?
I might stick some "show logical /full sys$output" statements in
various places if I were desperate for clues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2019 05:23 PM
10-27-2019 05:23 PM
Re: Process-permanent SYS$OUTPUT, WRITE SYS$OUTPUT and DEFINE /USER vs DEFINE /PROCESS
What you are missing is the reason/definition of the "/user" qualifier. This qualifier means that the logical name assignment will last for one program execution. Since many DCL commands are actually "programs" this means that the assignment will last for perhaps one or two commands at most.. This qualifier is used for truly temporary assignments.
For example, if you wanted to place the output of a program into file X.X, you could simply use the following:
$ ASSIGN/USER X.X SYS$OUTPUT
$ RUN PROGRAM_XYZ
With the above sequence there is no need for any DEASSIGN command as the logical assignment will be removed during the program rundown process.
In order to use the logical name assignment across a command procedure, you will need to ASSIGN and DEASSIGN the logical prior to entry and after exit respectively.
Hope this helps,
Dan