- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- how to DCL custom exit?
Operating System - OpenVMS
1752479
Members
5562
Online
108788
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО02-05-2008 11:09 PM
тАО02-05-2008 11:09 PM
Re: how to DCL custom exit?
Claus,
As a demonstration of how one aspect of this can be accomplished (e.g., being able to do something along the lines of:
$ EXITSTATUS "SS$_NOSUCHFILE"
I made available a simple command procedure that compiles a logical name table from the contents of the list of system error codes ($SSDEF in SYS$LIBRARY:STARLET.MLB) and a symbol definition for EXITSTATUS that uses this logical name table to convert from the symbolic name to the actual numeric value.
While I have not yet done so, it is straightforward to extend this to extend this with new codes and facility codes (to allow the use of the message facility).
This procedure is designed to be usable either by individual users within their processes, or it can be set up on a more global basis by system managers.
The ZIP archive of this example can be found at: http://www.rlgsc.com/demonstrations/exitstatus.html
- Bob Gezelter, http://www.rlgsc.com
As a demonstration of how one aspect of this can be accomplished (e.g., being able to do something along the lines of:
$ EXITSTATUS "SS$_NOSUCHFILE"
I made available a simple command procedure that compiles a logical name table from the contents of the list of system error codes ($SSDEF in SYS$LIBRARY:STARLET.MLB) and a symbol definition for EXITSTATUS that uses this logical name table to convert from the symbolic name to the actual numeric value.
While I have not yet done so, it is straightforward to extend this to extend this with new codes and facility codes (to allow the use of the message facility).
This procedure is designed to be usable either by individual users within their processes, or it can be set up on a more global basis by system managers.
The ZIP archive of this example can be found at: http://www.rlgsc.com/demonstrations/exitstatus.html
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-08-2008 10:15 AM
тАО02-08-2008 10:15 AM
Re: how to DCL custom exit?
Just to take this in a different direction, I create a .MAR file that includes things like $SSDEF and $QIODEF and any other thing for which I need definitions. Assemble it with /LIST option.
When I want the condition codes, I run a little simple-minded parser that reads the listing with the right prefix (SS$_ for example) and picks out the values for me, then reformats it to something useful.
Like, for DCL it creates strings of
$ SS$_xxxx = %X{whatever I got from the file}
whereas for BASIC it does something else and for ADA it does still a third thing, in each case usable as an INCLUDE or syntax equivalent that is compatible with my language-du-jour.
Then the hardest issue becomes finding a message that tells me what I wanted to say from the list of messages available this way.
When I want the condition codes, I run a little simple-minded parser that reads the listing with the right prefix (SS$_ for example) and picks out the values for me, then reformats it to something useful.
Like, for DCL it creates strings of
$ SS$_xxxx = %X{whatever I got from the file}
whereas for BASIC it does something else and for ADA it does still a third thing, in each case usable as an INCLUDE or syntax equivalent that is compatible with my language-du-jour.
Then the hardest issue becomes finding a message that tells me what I wanted to say from the list of messages available this way.
Sr. Systems Janitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-08-2008 10:42 AM
тАО02-08-2008 10:42 AM
Re: how to DCL custom exit?
Richard,
Why go through a list file and parse all that!
With a little less work, Macro can do it all:
For yucks run the commandfile below as:
$ @status_to_symbol.com $ssdef *priv*
---- status_to_symbol.com ------
$IF p2.EQS."" THEN EXIT 16
$CREATE tmp.mar
$DECK
$ copy sys$input nl:
.MACRO $DEFINI dummy arg more_dummy
.ENDM
.MACRO $DEFEND dummy arg more_dummy
$ show symb arg
.ENDM
.MACRO $EQU nam num
$ nam = num
.ENDM
$EOD
$OPEN/APPEND tmp tmp.mar
$WRITE tmp "''p1' ''p2'"
$CLOSE tmp
$
$MACRO/ALPH/PREP=tmp.com tmp.mar
$@TMP
$!DELE tmp.mar.,tmp.com.
A minor change will drop the 'search-for' argument and create global symbols.
And below here is a version which plunks the defintions into a logical name table
It also has some comments to the above to make it less cryptic. [ a few weeks ago I thought the few commands I write above simple enough, but coming back to them, they had me puzzled! ]
------------------- STATUS_TO_TABLE -----
$! STATUS_TO_TABLE.COM, hein van den Heuvel, Feb 2008
$! Define macro module symbols as logical names, using macro pre-processor
$!
$IF p1.EQS."" THEN EXIT 16 ! Need Macro module name to explode
$temp_macro_source = "TMP.MAR"
$temp_dcl_source = "TMP.COM"
$CREATE 'temp_macro_source ! Has replacements for $DEFINI and $DEFEND.
$DECK
$ copy sys$input nl: ! Eat bonus lines from macro compiler
.MACRO $DEFINI dummy arg more_dummy
.ENDM
.MACRO $DEFEND dummy arg more_dummy
$! show log/table=lnm_exit_status arg ! optional for inline show and forget
$ delete 'f$environment("procedure")',arg
$ copy sys$input nl: ! Eat blank bonus lines, avoiding %DCL-W-SKPDAT
.ENDM
.MACRO $EQU nam num
$define/tabl=lnm_exit_status nam num
.ENDM
$EOD
$
$temp_macro_source_full_spec = f$search(temp_macro_source)
$! Macro will strip ";". Replace by "."
$!temp_macro_source_full_spec = f$elem(0,";"tmp) + "." + f$elem(1,";"tmp)
$temp_macro_source_full_spec[F$LOC(";",temp_macro_source_full_spec),1] := "."
$
$!Append actual macro activation line to temporary macro source file.
$OPEN/APPEND tmp 'temp_macro_source
$WRITE tmp "''p1' ''temp_macro_source_full_spec'"
$CLOSE tmp
$
$MACRO/ALPH/PREP='temp_dcl_source 'temp_macro_source_full_spec
$@'temp_dcl_source
Enjoy!
Hein.
- « Previous
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP