View previous topic :: View next topic
|
Author |
Message |
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Requirementt is to search a table and check for the equality of four fields. while checking, I had wrongly coded the continuation character (-) in column 15 instead of 7. I did not notice this and to my surprise the compilation job ran fine.
why wasn't there a compilation error? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Why was there a continuation character?
If you post the code (5 lines before, the line in question, and 5 lines after), we can see what you are asking aobut. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Actually there was no need for a continuation character but used it by mistake and that too in the 15th column.
gn below is the piece of code
Code: |
SEARCH CARR-ABCD-KEY
AT END
CONTINUE
WHEN ERR-XYZ =
- ERR-RCD-CLS-ABCD(CIC-INDX)
MOVE 1 TO VLD-DDER
END-SEARCH.
|
"-" is not in 7th column. I ran the compile job again and it ran fine. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Is ERR-XYZ numeric?
While it compiles ok, does it run ok?
The manual does say "Any arithmetic expression can be preceded by a unary operator"... |
|
Back to top |
|
|
abin
Active User
Joined: 14 Aug 2006 Posts: 198
|
|
|
|
Hi Aaru,
I tried a simmillar piece of code not search but evaluate.
Code: |
01 WS-TEST-VAR-A PIC S9(002) VALUE 1.
01 WS-TEST-VAR-B PIC S9(002) VALUE -1.
PROCEDURE DIVISION.
00000-MAIN-PARA.
EVALUATE TRUE
WHEN WS-TEST-VAR-A =
- WS-TEST-VAR-B
DISPLAY 'SUCCES'
DISPLAY WS-TEST-VAR-A
DISPLAY WS-TEST-VAR-B
WHEN OTHER
DISPLAY 'BOMBED'
DISPLAY WS-TEST-VAR-A
END-EVALUATE
GOBACK. |
The result I got is
Here the '-' is taken as negative sign. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Hi Cics Guy,
Even though the compile job ran fine, i dint get the expected results and the run failed.
Hence it should have considered "-" as a unary operator. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Thanks abin for the code and the explanation. I guess it has considered
"-" as a minus sign and that is the reason my check failed everytime. |
|
Back to top |
|
|
|