- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Error while executing the script
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
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-01-2012 01:26 AM
10-01-2012 01:26 AM
Error while executing the script
Hi,
My purpose is to display the content of test.txt on screen when test1.com executes. I tried to write the procedure but it stuck on "say" during execution.
Please see the below script and let me know where I am worng.
$ SET noon
$ inquire env1 "Enter Env1 "
$ inquire env2 "Enter Base "
$ sea sys$login:housekeep.com 'env1'_'env2'/out=test.txt
$ open/read headlist test.txt
$ open/write repfile1 test1.com
$ read/end_of_file=done headlist inline
$ write repfile1 "$ say :== "write sys$output" "
$ write repfile1 "$ say "Modify ''env'_'''env2'_config.dat and Execute the Below Command "
$ write repfile1 "$ say ''inline'"
$close repfile1
$ close headlist
$ exit
test.txt contains the below line
$@sys$startup:pwc_startup A F 310 T L
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2012 05:11 AM
10-01-2012 05:11 AM
Re: Error while executing the script
>> but it stuck on "say" during execution.
Did you mean "But it generates the following error during execution of a line with "say" on it:"
%DCL-W-UNDSYM, undefined symbol - check validity and spelling
\SYS$OUTPUT \
So you are writting a script which writes a script?
Those are a little tricky, because any quote that needs to appear in the target script needs to be a double quote in the source script. That get's worse if you need to do the substitutions in the target,which it appears you do not need.
Why the second script? Why not just do the deed? (those write sys$outputs)?
I guess this is just a miminal snippet from a larger solution where the second script is unavoidable?
Anyway here is the corrected script. Works for me, even rhough it does not seem too useful.
$ SET noon $ inquire env1 "Enter Env1 " $ inquire env2 "Enter Base " $ sea sys$login:housekeep.com 'env1'_'env2'/out=test.txt $ close/nolog headlist $ open/read headlist test.txt $ open/write repfile1 test1.com $ read/end_of_file=done headlist inline $ write repfile1 "$ say :== ""write sys$output""" $ write repfile1 "$ say ""Modify ''env1'_''env2'_config.dat and Execute the Below Command """ $ write repfile1 "$ say ""''inline'""" $done: $ close/nolog repfile1 $ close/nolog headlist $ exit
Enjoy,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2012 04:33 PM
10-01-2012 04:33 PM
Re: Error while executing the script
Why create a second command procedure? Would the code below do what you want?
$ SET noon
$ inquire env1 "Enter Env1 "
$ inquire env2 "Enter Base "
$ write sys$output "For any lines listed below, modify ''env1'_''env2'_config.dat and Execute the Command"$ search sys$login:housekeep.com 'env1'_'env2'
$ if $severity.nes."1" then write sys$output " (no lines to correct)"
$ exit
This will display it all on the screen, just like creating an running a new command procedure will do. If it's important to get the entire output into a file then execute the procedure with /OUTPUT=<filename>.
By the way, I recommend against using abbreviations in command procedures. Typing them in full (which you'll only do once) makes it much easier to read the code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2012 01:13 AM
10-02-2012 01:13 AM
Re: Error while executing the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2012 09:23 AM
10-02-2012 09:23 AM
Re: Error while executing the script
As already pointed out, there is some trouble with double double and double (or was it triple?) single quotes. You can avoid much of the doubling, you just need it once and have to pay for it with an extra blank:
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2012 07:20 PM
10-02-2012 07:20 PM
Re: Error while executing the script
Thanks a lot..jist one more thing to ask.
I want to display the below on inline on second file
"$ @sys$startup:prd_startup sys dev 717 F "" PRD abc_STARTUP "
$show sym inline
it is showing the correct valuse
but while redirecting to another file
$ write repfile1 " say ""''inline'""
it is showing as :
"$ @sys$startup:prd_startup sys dev 717 F " PRD abc_STARTUP "
double quote is replaced by single quote.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2012 02:57 AM
10-03-2012 02:57 AM
Re: Error while executing the script
You are using symbol substitution within a string, that is, in
$ write repfile1 " say ""''inline'""
(there is a missing, closing double quote for the string, but DCL for convenience adds one, here)
inline is replaced, which results in
$ write repfile1 " say ""$ @sys$startup:prd_startup sys dev 717 F "" PRD abc_STARTUP """
After DCL replaced all double double quotes within the string, WRITE gets this string (which I here delimit by <> to make it more obvious)
< say "$ @sys$startup:prd_startup sys dev 717 F " PRD abc_STARTUP ">
which WRITE writes into your file.
Try
$ write repfile1 " say """, inline
That is, let WRITE write a string and a symbol.
You can use that for all your WRITEs to the repfile1:
...
(I did some cut&paste and formatting here - which is not easy with the supplied tools in this forum - and hope I didn't drop anything especially any quote.)