- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: %DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting...
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
тАО08-18-2009 12:42 AM
тАО08-18-2009 12:42 AM
%DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting structure or data inconsistency
====
$ para1 = f$edit(p1,"upcase,trim")
$ IF ("''para1'" .eqs. "ONLINE") .OR. ("''para1'" .eqs. "1") THEN goto LOOP_DISK
====
I am getting the below error message but it is going to LOOP_DISK label. Any idea how i can correct this error message?
%DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting structure or data inconsistency
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2009 12:56 AM
тАО08-18-2009 12:56 AM
Re: %DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting structure or data inconsistency
I copied the two lines of code into a commandfile and executed it without any error message. The two lines are correct (only a label loop_disk is missing).
Is this the whole script? Can you supply the rest of the script
Regards
Geni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2009 01:46 AM
тАО08-18-2009 01:46 AM
Re: %DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting structure or data inconsistency
$ para1 = f$edit(p1,"upcase,trim")
$ IF ("ONLINE" .eqs. "ONLINE") .OR. ("ONLINE" .eqs. "1") THEN goto LOOP_DISK
%DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting structure or data inconsistency
$ LOOP_DISK:
...
...
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2009 01:55 AM
тАО08-18-2009 01:55 AM
Re: %DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting structure or data inconsistency
$ @T
$ IF 1 then goto a
%DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting structure or data inconsistency
$ a: exit
$ type t.com
$ IF 1 then goto a
$ endif ! Pointless endif
$ a: exit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2009 02:01 AM
тАО08-18-2009 02:01 AM
Re: %DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting structure or data inconsistency
Is it possible that by taking the branch (goto LOOP_DISK) you're jumping out of or into an IF-THEN-ELSE-ENDIF construction?
I've copied your snippet of DCL-code, added 4 lines:
$ ENDIF
$ EXIT
$LOOP_DISK:
$ write sys$output "Reached LOOP_DISK"
and then by executing this procedure, I get the "invalid IF-THEN-ELSE".
If I remove the "$ ENDIF" line, all is well.
So, I suggest you check the line between the "goto LOOP_DISK" and the LOOP_DISK label for ill-constructed IF-THEN-ELSE-ENDIFs.
Regards,
Kris (aka Qkcl)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2009 03:11 AM
тАО08-18-2009 03:11 AM
Re: %DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting structure or data inconsistency
Quite likely this is caused by a coding error.
OpenVMS Developer & System Manager
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2009 07:23 AM
тАО08-18-2009 07:23 AM
Re: %DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting structure or data inconsistency
I have not (yet) seen enough of the script to have a definite answer, but my guess would be infamiliarity with DCL history.
Once there was only the following construct:
$ IF condition THEN command
Most often "command" was something more then a single statement, and the only ways to achieve that were GOTO label, or @
When IF .. THEN
The "trick" they used was to add pseudo-commands:
$ THEN
which allowes for, but does not require
$ ELSE
and had to be ended by
$ ENDIF
So, now there are TWO different IF constructs:
$ IF condition THEN command
( notice: NO !!! ENDIF )
and
$ IF condition
$ THEN
< commands >
[ $ ELSE
< other commands > ]
$ ENDIF
In the second construct only
My guess is that you used the first construct, but still used $ ENDIF
hth
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2009 08:00 AM
тАО08-18-2009 08:00 AM
Re: %DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting structure or data inconsistency
OpenVMS stinks at this sort of DCL-level tracing; it's often somewhat tedious to find these errors in non-trivial DCL procedure code. There's unfortunately no visible "nested" count for IF-THEN-ELSE stuff. Not until you blow out with the INVIFNEST error, that is.
The other approach is the brute-force approach, and involves refactoring and restructuring the code of the DCL procedure. Of cleaning up the GOSUB and GOTO and CALL and the flow control.
ps: this:
$ IF ("''para1'" .eqs. "ONLINE") .OR. ("''para1'" .eqs. "1") THEN goto LOOP_DISK
can be replaced with this:
$ IF (para1 .eqs. "ONLINE") .OR. (para1 .eqs. "1") THEN goto LOOP_DISK
And I don't know what this DCL code is doing here, but this code really smells like a parser of some sort. Possibly parsing DCL command output? And there are better ways to do that than DCL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2009 01:24 PM
тАО08-18-2009 01:24 PM
Re: %DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting structure or data inconsistency
However, when the para1 symbol value contains double quotes the "''para1'" construct does work in the general case. The := assignment and & substitution have different effects as well.
$ para1 = """this has double quotes"""
$ para2 = "''para1'"
%DCL-W-UNDSYM, undefined symbol - check validity and spelling
\HAS\
$ para3 = para1
$ para4 := "''para1'"
$ para5 = ¶1
$ sho sym para*
PARA1 = ""this has double quotes""
PARA3 = ""this has double quotes""
PARA4 = "THIS HAS DOUBLE QUOTES"
PARA5 = "this has double quotes"
$
Getting symbol substitution to work when double quotes are involved is a real pain.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2009 01:24 PM
тАО08-18-2009 01:24 PM
Re: %DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting structure or data inconsistency
http://www.digiater.nl/openvms/freeware/v80/dcl_check/
It's a useful tool to have around and will probably find the problem with your command procedure.