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
 

 

Finding logical error using offset value.

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

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Tue Nov 27, 2007 3:13 pm    Post subject: Finding logical error using offset value.
Reply with quote

Can anybody suggest me how to find logical error using offset value displayed in spool area..
thanks in advance
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Tue Nov 27, 2007 3:59 pm    Post subject:
Reply with quote

Vinay,

Quote:
Can anybody suggest me how to find logical error using offset value displayed in spool area..


How do you define 'logical error'? From the system perspective, everything is proper (including garbage) as long as syntaxs are fine.
Back to top
View user's profile Send private message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Tue Nov 27, 2007 5:09 pm    Post subject:
Reply with quote

Murali,
I'm getting error at following specified offset... so how to find the location in program using that offset....
Code:
The flow of control in program SORT2 proceeded beyond the last line of the program. From compile unit SORT2 at entry point SORT2 at compile unit offset +00000890 at address 00006E00.



Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Nov 27, 2007 5:31 pm    Post subject:
Reply with quote

You will have to find the listing produced during compilation of the program, or use some debugging tool.

O.
Back to top
View user's profile Send private message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Tue Nov 27, 2007 6:17 pm    Post subject:
Reply with quote

Thanks for your valuable suggestions.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Nov 27, 2007 6:20 pm    Post subject:
Reply with quote

Do you use CHGMAN or Endevor; if you use CHGMAN, I can provide some suggestions. By the time check this link, might be useful.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Nov 27, 2007 7:37 pm    Post subject:
Reply with quote

This doesn't ans your ques, but may solve your problem.

The usual reason for that kind of problem is that you executed the last coded line of your program and didn't exit the pgm via goback or stop run.

Tracing through the code you'll find that you either "fell thru" to that point or "go to"ed to it.
Back to top
View user's profile Send private message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Wed Nov 28, 2007 2:27 pm    Post subject:
Reply with quote

Jack,
Here i'm posting my code, can you tell me where is the mistake.
Code:
PROCEDURE DIVISION USING LS-FIELD.                   
    ACCEPT LS-FIELD.                                 
    PERFORM A00-OPEN-FILES.                           
    PERFORM A11-SORT-PARA.                           
    PERFORM C00-CLOSE-FILES.                         
    STOP RUN.                                         
A11-SORT-PARA.                                       
    IF LS-FIELD = 'A'                                 
        DISPLAY 'ASCENDING ORDER SELECTED'           
        SORT SYS-FILE ON ASCENDING KEY S-TELNO       
             INPUT PROCEDURE IS A10-INPUT-PROCEDURE   
             OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE
    END-IF.                                           
    IF LS-FIELD = 'D'                                 
        DISPLAY 'DESCENDING ORDER SELECTED'           
        SORT SYS-FILE ON DESCENDING KEY S-TELNO       
             INPUT PROCEDURE IS A10-INPUT-PROCEDURE   
             OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE
    END-IF.                                           
A00-OPEN-FILES.                                 
    OPEN INPUT IN-FILE.                         
    OPEN OUTPUT OUT-FILE.                       
                                               
A10-INPUT-PROCEDURE.                           
    READ IN-FILE AT END MOVE 'Y' TO WS-FLAG     
         NOT AT END MOVE IN-REC TO SYS-REC     
    END-READ.                                   
    PERFORM UNTIL WS-FLAG = 'Y'                 
       RELEASE SYS-REC                         
       READ IN-FILE AT END MOVE 'Y' TO WS-FLAG 
           NOT AT END MOVE IN-REC TO SYS-REC   
       END-READ                                 
    END-PERFORM.                               
B10-OUTPUT-PROCEDURE.                           
    RETURN SYS-FILE                             
         AT END GO TO B10-EXIT.                 
    MOVE SYS-REC TO OUT-REC.                   
     WRITE OUT-REC.             
     GO TO B10-OUTPUT-PROCEDURE.
 B10-EXIT.                     
     EXIT.                     
 C00-CLOSE-FILES.               
     CLOSE IN-FILE, OUT-FILE.   
Back to top
View user's profile Send private message
pmn

New User


Joined: 29 Jan 2006
Posts: 1
Location: bangalore

PostPosted: Wed Nov 28, 2007 4:00 pm    Post subject:
Reply with quote

When you get abend ,,along with that you will get offset number as well,,,
then you do the following steps,,
1. find that offset no in your source listing pgm
2. when you find offset no in source pgm,,,just above that offset number you will get pgm statement number
3. take that statement number and find out what statment has come over there
4.then verify the field values of that particular statement

Thanks,
Praveen
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Nov 28, 2007 7:25 pm    Post subject:
Reply with quote

Hi Vinaykumar,

1st, I think you misunderstand the functioning of the SORT verb. Take a look at an example in your shop or the manual and compare it to what you're attempting.

2nd, if you're using EXITs you must use the "THRU" option in the SORT stmt.

3rd, use a pgraph name to start your code, e.g. 000-MAINLINE. I don't remember the specifics, but some hinky things can happen w/o it.

If you have any ques on what you found don't hesitate...
If you get it to work let us know what did it for you.

Good luck
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: Wed Nov 28, 2007 9:40 pm    Post subject:
Reply with quote

Hello,

Code:
RETURN SYS-FILE                             
         AT END GO TO B10-EXIT. 
When AT END is reached, the GO TO causes the program to "fall out the bottom".

As Jack mentioned, you could use "THRU". You could also also make the input and output procedures be SECTIONs.
Back to top
View user's profile Send private message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Thu Nov 29, 2007 10:40 am    Post subject:
Reply with quote

Can anybody send me example code... because my shop doesn't contain it..
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: Fri Nov 30, 2007 3:04 am    Post subject:
Reply with quote

Hello,

If you change this
Code:
OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE
to
Code:
OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE
               THRU B10-EXIT
your code should not fall out the bottom.

You need to do this both places in the code.
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 OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts Error during restore rename archanamuthukrishnan All Other Mainframe Topics 2 Fri Oct 14, 2016 3:30 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm


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