Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Reg the column 7 continuation character ( - )

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Aaru

Senior Member


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

PostPosted: Sat Sep 01, 2007 6:25 pm    Post subject: Reg the column 7 continuation character ( - )
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

Site Director


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

PostPosted: Sat Sep 01, 2007 9:52 pm    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Mon Sep 03, 2007 4:41 pm    Post subject: Reply to: Reg the column 7 continuation character ( - )
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: 2150
Location: At my coffee table

PostPosted: Mon Sep 03, 2007 4:54 pm    Post subject:
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Mon Sep 03, 2007 6:41 pm    Post subject: Reply to: Reg the column 7 continuation character ( - )
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: 1288
Location: Chennai, India

PostPosted: Mon Sep 03, 2007 6:44 pm    Post subject: Reply to: Reg the column 7 continuation character ( - )
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us