Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 the use of 'B3'x character in a panel Pedro TSO/ISPF 1 Thu Feb 16, 2017 3:09 am
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 6 Sun Nov 06, 2016 8:11 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us