Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Micro Focus Errors 1

Status
Not open for further replies.

n8jbrown

Technical User
Feb 25, 2003
14
US
I am using Micro Focus on a Win2k PC. For the life of me, I cannot figure out why these errors are coming up. Any help would be great!

1. This is in the procedure division:

Code:
SET X1 TO 1
SEARCH TABLE-ENTRIES
    WHEN DEPT-NUM-T (X1) = DEPT-NUM-IN
        MOVE DEPT-NAME-T TO W30-DEPT-NAME-DTL-1
END-SEARCH

The first error I get on this is "Operand should be numeric" with the cursor blinking on (X1).
What should I look for to find out why this is happening?
The second is "WHEN phrase missing from SEARCH statement". Am I missing something in the Search statement?
 
Hi,

You didn't provide any WS defs of the table or index, so it's difficult to say with any certainty. I did notice though, that DEPT-NAME-T isn't qualified with the index and you didn't include an "at end" clause.

Regards, Jack.
 
Here is the WS def of the table.

Code:
01 W10-DEPT-TABLE.
     05 TABLE-ENTRIES OCCURS 15 TIMES INDEXED BY X1.
         10 WS-DEPT-NUM                  PIC 999.
         10                              PIC X.
         10 WS-DEPT-NAME                 PIC X(10).

This is the FD of the table record.
Code:
01 DEPT-TBL-REC.
    05 DEPT-NUM-T                       PIC 999.
    05                                  PIC X.
    05 DEPT-NAME-T                      PIC X(10).
    05                                  PIC X(116).
I originally had an At End clause, but that made no difference. I intend to add that back in.
I hope this is enough info.
 
Your code should be:
[tt]
SEARCH TABLE-ENTRIES
WHEN WS-DEPT-NUM(X1) = DEPT-NUM-IN
MOVE WS-DEPT-NAME to W30-DEPT-NAME-DTL-1
END-SEARCH
[/tt]
 
[tt]
SET X1 TO 1
SEARCH TABLE-ENTRIES
WHEN DEPT-NUM-T(X1) = DEPT-NUM-IN
MOVE DEPT-NAME-T(X1) TO W30-DEPT-NAME-DTL-1
END-SEARCH
[/tt]
 
It's too early in the morning
[/tt]
SET X1 TO 1
SEARCH TABLE-ENTRIES
WHEN WS-DEPT(X1) = DEPT-NUM-IN
MOVE WS-DEPT-NAME(X1) TO W30-DEPT-NAME-DTL-1
END-SEARCH
[/tt]
 
Thanks to you guys who replied, sometimes I look at this stuff a million times, and never see it until someone points it out. Again, Thanks alot.
 
That's why it is sometimes nice to work in a group. There is someone to look at your code from a fresh viewpoint.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top