IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Reg the column 7 continuation character ( - )


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Sat Sep 01, 2007 6:25 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Sep 01, 2007 9:52 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Mon Sep 03, 2007 4:41 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Sep 03, 2007 4:54 pm
Reply with quote

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
View user's profile Send private message
abin

Active User


Joined: 14 Aug 2006
Posts: 198

PostPosted: Mon Sep 03, 2007 6:11 pm
Reply with quote

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

Code:
SUCCES   
0A       
0J         


Here the '-' is taken as negative sign.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Mon Sep 03, 2007 6:41 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Mon Sep 03, 2007 6:44 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts first column truncated in search result IBM Tools 13
No new posts Panvalet - 9 Character name - Issue c... CA Products 6
Search our Forums:

Back to Top