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

S000 u4038 abend - Flow of control beyond last line


IBM Mainframe Forums -> ABENDS & Debugging
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lakshmi_ta

New User


Joined: 23 Aug 2006
Posts: 13

PostPosted: Tue Jul 31, 2007 1:15 pm
Reply with quote

Hi, I got s000 u4038 abend with the description, The flow of control in program MYREPPGM proceeded beyond the last line of the program. what does it mean? iam sure, there is no logical error. It is a report program with simple file definitions and very simple logic.

awaiting your reply

Lakshmi
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Jul 31, 2007 4:26 pm
Reply with quote

What language is the program written in?
What does it mean? just what it says, your logic allowed program flow to drop out of the bottem of the program.
The logic error may be very minor, such as a missing period or doing a go to instead of a perform.....
Back to top
View user's profile Send private message
lakshmi_ta

New User


Joined: 23 Aug 2006
Posts: 13

PostPosted: Tue Jul 31, 2007 8:55 pm
Reply with quote

Iam writing a cobol report program.
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: Tue Jul 31, 2007 11:34 pm
Reply with quote

Hello and welcome to the forums,

Quote:
Iam writing a cobol report program


O.K.

Look at your code and determine how you might be "falling out the bottom" - that is a common way to get the error you are seeing.

If you post the last 20 lines of code in your program, we may be able to offer suggestions. When posting your code, it is good to use the "Code" tag near the top of the reply panel. Once you have created your reply, click Preview to ensure that your post looks like you want. Then click Submit.
Back to top
View user's profile Send private message
lakshmi_ta

New User


Joined: 23 Aug 2006
Posts: 13

PostPosted: Sun Aug 05, 2007 1:37 pm
Reply with quote

Hi Friend,


Iam giving you the code also, pls try it out.
Code:

   PROCEDURE DIVISION.                               
     PERFORM 1000-INITIALIZATION.                   
     PERFORM 2000-PROGRAM-LOGIC.                   
     PERFORM 9000-TERMINATION.                     
*                                                   
 1000-INITIALIZATION.                               
         INITIALIZE WS-REC.                         
         OPEN INPUT IN-FILE.                       
         IF INFILE-STATUS NOT = '00'               
             DISPLAY 'ERROR IN OPENING INPUT FILE' 
             PERFORM 9000-TERMINATION               
         END-IF.                                   
         OPEN OUTPUT OUT-FILE.                     
         IF OUTFILE-STATUS NOT = '00'               
             DISPLAY 'ERROR IN OPENING OUTPUT FILE'
             PERFORM 9000-TERMINATION               
         END-IF.                                   
                                                   
        ACCEPT WS-DATE             FROM DATE.           
                                                       
  2000-PROGRAM-LOGIC.                                   
        PERFORM 2500-WRITE-HEADINGS.                   
        PERFORM 8000-READ-IN-FILE UNTIL EOF-IN.         
                                                       
  2500-WRITE-HEADINGS.                                 
       STRING WC-REPORT-DATE-LIT WS-DATE FARMERS-HEAD   
        DELIMITED BY SIZE                               
         INTO OUT-REC.                                 
       PERFORM 8500-WRITE-REC.                         
       MOVE WS-DASH TO OUT-REC.                         
       PERFORM 8500-WRITE-REC.                         
       MOVE WC-HEADING-LINE-02 TO OUT-REC.             
       PERFORM 8500-WRITE-REC.                         
       MOVE WS-DASH TO OUT-REC.                         
       PERFORM 8500-WRITE-REC.                         
       MOVE WC-HEADING-LINE-03 TO OUT-REC.             
       PERFORM 8500-WRITE-REC.                         
       MOVE 5 TO WS-REC-CNT.                           
                 
  8000-READ-IN-FILE.                       
     READ IN-FILE RECORD INTO WS-INPUT-REC
       AT END MOVE 'Y' TO WS-IN-EOF-FLAG   
     END-READ.                             
     IF INFILE-STATUS NOT = '00' AND '23' 
        DISPLAY ' END OF FILE EMP  FILE ' 
     END-IF.                               
     MOVE WS1-F-NAME TO WS-F-NAME.         
     MOVE WS1-L-NAME TO WS-L-NAME.         
     MOVE WS1-AGE    TO WS-AGE.           
     MOVE WS1-SEX    TO WS-SEX.           
     MOVE WS1-SALARY TO WS-SALARY.         
     MOVE WS-REC TO OUT-REC.               
     PERFORM 8500-WRITE-REC.               
     ADD SALARY TO WS-TOTAL-SALARY         
     END-ADD.                             
     IF SEX = 'M'                         
         ADD 1 TO WS-MALE-CNT             
         END-ADD                           
     ELSE                                 
                                 
      ADD 1 TO WS-FEMALE-CNT     
      END-ADD                   
  END-IF.                       
  ADD 1 TO WS-IN-REC-CNT         
  END-ADD.                       
  ADD 1 TO WS-REC-CNT           
  END-ADD.                       
  IF WS-REC-CNT = 50 OR EOF-IN   
      PERFORM 8700-PRINT-FOOTING
  END-IF.                       
                                                                                       
                                             
  8700-PRINT-FOOTING.                       
      MOVE ZERO TO WS-REC-CNT.               
      ADD 1 TO WS-PAGE-CNT                   
      END-ADD.                               
      MOVE WS-TOTAL-SALARY TO WS-TOT-SALARY.
      STRING WS-FOOTING-01 WS-TOT-SALARY     
             DELIMITED BY SIZE               
             INTO OUT-REC.                   
   PERFORM 8500-WRITE-REC.           
   STRING WS-FOOTING-02 WS-FEMALE-CNT
          DELIMITED BY SIZE           
          INTO OUT-REC.               
   PERFORM 8500-WRITE-REC.           
   STRING WS-FOOTING-03 WS-MALE-CNT   
           DELIMITED BY SIZE         
           INTO OUT-REC.             
   PERFORM 8500-WRITE-REC.           
   STRING WS-FOOTING-04 WS-IN-REC-CNT
           DELIMITED BY SIZE         
           INTO OUT-REC.             
   PERFORM 8500-WRITE-REC.           
   STRING WS-FOOTING-05 WS-PAGE-CNT   
          DELIMITED BY SIZE           
          INTO OUT-REC.               
   PERFORM 8500-WRITE-REC.           
   IF NOT EOF-IN                     
        PERFORM 2500-WRITE-HEADINGS   
   END-IF.                           
                                                 
 8500-WRITE-REC.                                 
      WRITE OUTPUT-REC.                           
      IF OUTFILE-STATUS NOT = '00'               
            DISPLAY ' ERROR IN WRITING RECORD '   
            PERFORM 9000-TERMINATION             
      END-IF.                                     
 9000-TERMINATION.                               
        CLOSE IN-FILE                             
              OUT-FILE.                           
 STOP-RUN.                                       
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sun Aug 05, 2007 2:36 pm
Reply with quote

You might check, it looks like the STOP-RUN is a paragraph name when it should be a COBOL verb.....
And genjerally, GOBACK it the verb of choice....
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: Sun Aug 05, 2007 8:47 pm
Reply with quote

Hello,

You have misspelled STOP RUN. It has no hyphen ''-'.

You also placed it in the "A" margin making it a paragraph name and your program "fell out the bottom".

As mentioned by Bill, it is better practice to use GOBACK.
Back to top
View user's profile Send private message
lakshmi_ta

New User


Joined: 23 Aug 2006
Posts: 13

PostPosted: Tue Aug 07, 2007 1:04 pm
Reply with quote

Hi Thank you.
I run the program successfully.

Regards,
lakshmi
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: Tue Aug 07, 2007 6:28 pm
Reply with quote

You're welcome - thanks for letting us know icon_smile.gif
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 -> ABENDS & Debugging

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts ISAM and abend S03B JCL & VSAM 9
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts rewrite same SAY line CLIST & REXX 8
Search our Forums:

Back to Top