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
 
related to S0C7 and comp-3....

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
View previous topic :: :: View next topic  
Author Message
shyansh_hercules
Warnings : 2

New User


Joined: 12 Oct 2008
Posts: 4
Location: Pune

PostPosted: Tue Oct 21, 2008 12:48 pm    Post subject: related to S0C7 and comp-3....
Reply with quote

Please look at the example below.....

Code:
IDENTIFICATION DIVISION.             
 PROGRAM-ID. PGMSOC.                   
 DATA DIVISION.                       
 WORKING-STORAGE SECTION.             
 01 A.                                 
      02 BA PIC 9(18) COMP-3 VALUE 20.
 01 B PIC 9(2).                       
 PROCEDURE DIVISION.                   
     MOVE 12 TO A.                   
     DISPLAY "A:" A.                   
     DISPLAY "BA:"BA.                 
     MOVE A TO B.                     
     DISPLAY 'B:' B.                   
*    ADD BA TO B.                     
     DISPLAY 'B= ',B.                 
     STOP RUN.                         

I am getting a 0C7 abend because of the add operation.....and also found the reason because the variable BA contains garbage value after MOVE 12 TO A operation.

A:12
BA:1 2404040404040404 // why BA contains garbage.
B:12
B= 12

If I do MOVE 12 TO BA...then it is absolutely fine and also in case of BA being USAGE IS DISPLAY ....no problem....

My question is....
1.after MOVE 12 TO A .... A contains 12 but BA contains garbage why??

2.Please somebody tell me the memory layout when we declare a 01 level variable with its sublevels......as i know whenever we give a name to any variable compiler gives memory to it...if we see
Code:
  01 A.                                                               BLW=00000+000         0CL10
      02 BA PIC 9(18) COMP-3 VALUE 20.    BLW=00000+000,0000000 10P 
What does the above sentence mean...which one of them acquire the actual
bytes ....or A is just given the base address of all its following sublevels.....

TIA.
Rahul.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8154
Location: East Dubuque, Illinois, USA

PostPosted: Tue Oct 21, 2008 4:44 pm    Post subject:
Reply with quote

Quote:
My question is....
1.after MOVE 12 TO A .... A contains 12 but BA contains garbage why??

2.Please somebody tell me the memory layout when we declare a 01 level variable with its sublevels......as i know whenever we give a name to any variable compiler gives memory to it...if we see
01 A. BLW=00000+000 0CL10
02 BA PIC 9(18) COMP-3 VALUE 20. BLW=00000+000,0000000 10P
What does the above sentence mean...which one of them acquire the actual
bytes ....or A is just given the base address of all its following sublevels.....
My question is ... Have you ever had any exposure to the internal representation of COBOL values? If so, you should know the answers already; if not, go to the manuals link at the top of the page, click on it, find the COBOL Language Reference, and read section 5.3 on the various formats of COBOL variables. Once you've done that, if you still have questions then post them.
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: Tue Oct 21, 2008 9:35 pm    Post subject:
Reply with quote

Hello,

In addition to reading the appropriate material in the cobol documentation, there is something you have just discovered that you should pay special attention to. . .

Just because the compiler processes some statements with no error, that is no guarantee that the compiled code will run successfully - the results may not be the desired results or the process may abend (as is the case with your 0c7).
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Oct 21, 2008 10:57 pm    Post subject:
Reply with quote

Pay particular attention to the definition of "Group Moves".
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 -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Need help to populate date in COMP-3 ... chetanambi DFSORT/ICETOOL 3 Tue Jun 21, 2016 12:25 pm
No new posts comparing comp-3 and unpacked numbers juares castro COBOL Programming 3 Mon May 30, 2016 6:46 pm

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