- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: DCL Scripting
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
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
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
тАО04-03-2008 07:03 AM
тАО04-03-2008 07:03 AM
DCL Scripting
What I would like to do is modify the command procedure to initially read in a static file that contains parameter information (12 records) and then use the values within the command procedure.
Example of existing command procedure:
$ username = P1
$ business_model_instance = P2
$ warehouse_model_instance = P3
$ bit_string = P4
$ environment = P5
$ ods_admin = P6
$ warehouse_admin = P7
! Production or Development?
$!
$ @wipdss_base_root:[config]wipdss_env.com 'environment
An example of how to accomplish would be great! Thanks, Brett
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 07:14 AM
тАО04-03-2008 07:14 AM
Re: DCL Scripting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 07:19 AM
тАО04-03-2008 07:19 AM
Re: DCL Scripting
@myproc "p1 p2 p3 ... pn"
This would result in a list of parameters only limited by the string variable length (typically 1024 characters).
Then, inside your routine, you would need to parse all the parameters out. The easiest way to do that would be to use the lexical f$element.
$ n = 0
$ loop:
$ parm'n' = f$element(n," ",p1)
$ if parm'n' .nes. ""
$ then
$ n = n + 1
$ goto loop
$ endif
:
: fall through...
This can be problematic, esp. if you want to pass blank parameters (" "), or strings with embedded spaces as single parameters.
But, this should give you the general idea as to what's involved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 07:31 AM
тАО04-03-2008 07:31 AM
Re: DCL Scripting
You can use any separator between your parameters (here I use /)
Basic example
$ define/group a "1/2/43/ZZ/aa/123/ghh/jkjk/opop"
$ wr sys$output f$elem(0,"/",f$trn("a","lnm$group"))
1
$ wr sys$output f$elem(7,"/",f$trn("a","lnm$group"))
jkjk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 07:51 AM
тАО04-03-2008 07:51 AM
Re: DCL Scripting
In similar situations, I have implemented something along the lines of "toy" version of TPARSE for DCL, for example:
$ @XYZ parm1=1/parm2=2/parm3=3
You can verify this for yourself with the toy command file:
$ write sys$output p1
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2008 07:55 AM
тАО04-03-2008 07:55 AM
Re: DCL Scripting
Logical names are not reentrant; what happens if two runs of FOO define the logical name BAR in parallel? Last DEFINE wins...
Further, the translation will be static; these logical names do not go way until directly deleted, or the system reboots.
The group table is also fairly far along in the sequence of logical name translations, as the process and job tables are checked first. It's easily feasible to end up with several translations, one in each of the tables. So you can look at the group table, and something else left a value in another table. Confusion ensues.
I don't recommend using global symbols or (particularly) logical names to pass contextual information or data around among procedures. If you follow this approach (and some do), you can easily end up with a forest of logical names and knobs akin to what has happened with DEC C (and its increasingly large forest of DECC$* logical names), and then things really get interesting as these values get tangled up, or conflict, or get defined somewhere visible to a process that is not expecting the definition.
This doesn't scale, and it's a monster to debug the transients and race conditions that can arise from such a simple construct.
I still have the scars from when I used logical names for this sort of thing.
(No, I don't like the DECC$* logical names.)
See the other thread for other discussions and suggestions.