ABENDED S000 U4038

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
User avatar
Gurugars
Active Member
Posts: 107
Joined: Sat Oct 23, 2010 2:17 pm
Location: Chennai,India.

ABENDED S000 U4038

Post by Gurugars » Fri Dec 03, 2010 5:50 pm

Hi dear friends,

i'm running a simple cobol program and i'm getting the abend

ABENDED S000 U4038..

but still getting the output correctly... can any one please tell me the reason..


my coding is


IDENTIFICATION DIVISION.
PROGRAM-ID. GURUARR.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-MAR.
05 WS-MARK PIC 99 OCCURS 5.
77 WS-SUM PIC 999 VALUE ZEROS.
77 WS-SUB PIC 9 VALUE ZERO.
PROCEDURE DIVISION.
0000-MAIN-PARA.
PERFORM VARYING WS-SUB FROM 1 BY 1 UNTIL WS-SUB > 5
ACCEPT WS-MARK(WS-SUB)
END-PERFORM.
PERFORM VARYING WS-SUB FROM 1 BY 1
UNTIL WS-SUB > 5
DISPLAY WS-MARK(WS-SUB)
COMPUTE WS-SUM = WS-SUM +(WS-MARK(WS-SUB)) END-PERFORM.
IF (WS-SUM / 5) > 35
DISPLAY 'PASS'
ELSE
DISPLAY 'FAIL'
GOBACK.


i'm having error due to that highlighted line i guess.. please help me to know the thing..


the output for the inputs(64,88,23,43,92)



********************************* TOP OF DATA **********************************
64
88
23
43
92
PASS
IGZ0037S The flow of control in program GURUARR proceeded beyond the last line o
From compile unit GURUARR at entry point GURUARR at compile unit offset
at address 17A78196.
Guru:-)

You're never fully dressed without a smile :)

User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

Post by Krishna » Fri Dec 03, 2010 6:15 pm

Do you have STOP RUN after IF condition in your program?

User avatar
Gurugars
Active Member
Posts: 107
Joined: Sat Oct 23, 2010 2:17 pm
Location: Chennai,India.

Post by Gurugars » Fri Dec 03, 2010 6:29 pm

just now saw that and corrcted the thing yaar.. thanks for the reply krishna..
Guru:-)

You're never fully dressed without a smile :)

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Mon Dec 06, 2010 2:46 pm

Well, this is 21st century - how would STOP RUN make a difference compared to GOBACK, from the prespective of this thread, I wonder!

You are missing a "end-scope terminator" in your IF construct - you've the following choices:

1. Use specifically END-IF or
2. A period (.) after the word "FAIL" in your code.

Pick up one of the choices above, use GOBACK and tell us what happens?
Regards,
Anuj

User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

Post by Krishna » Mon Dec 06, 2010 6:19 pm

He has GO BACK in the ELSE part. It won't work for first IF condition part. ( Pass )

without modifing the original code.. just add STOP RUN (or) GO BACK will make the code work.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Dec 07, 2010 1:00 pm

This code

Code: Select all

 IDENTIFICATION DIVISION.                                         
 PROGRAM-ID. GURUARR.                                             
 DATA DIVISION.                                                   
*                                                                 
 WORKING-STORAGE SECTION.                                         
   01 WS-MAR.                                                     
   05 WS-MARK PIC 99 OCCURS 5.                                    
   77 WS-SUM PIC 999 VALUE ZEROS.                                 
   77 WS-SUB PIC 9 VALUE ZERO.                                    
*                                                                 
 PROCEDURE DIVISION.                                              
   0000-MAIN-PARA.                                                
       PERFORM VARYING WS-SUB FROM 1 BY 1 UNTIL WS-SUB > 5       
       ACCEPT WS-MARK(WS-SUB)                                     
       END-PERFORM.                                               
       PERFORM VARYING WS-SUB FROM 1 BY 1                         
                              UNTIL WS-SUB > 5                    
          DISPLAY WS-MARK(WS-SUB)                                 
          COMPUTE WS-SUM = WS-SUM +(WS-MARK(WS-SUB)) END-PERFORM.  
        IF (WS-SUM / 5) > 35   
           DISPLAY 'PASS'      
        ELSE                   
           DISPLAY 'FAIL'      
        END-IF                 
        GOBACK.                
*       STOP RUN.
and this JCL:

Code: Select all

//STEP001 EXEC PGM=TEMP      
//SYSIN    DD *              
64                           
88                           
23                           
43                           
92                           
//*                          
//SYSOUT DD SYSOUT=*         
//*                          
gives this:

Code: Select all

   Display  Filter  View  Print  Options  Help                                  
 -------------------------------------------------------------------------------
 SDSF OUTPUT DISPLAY ZTEMPCMN JOB18909  DSID   102 LINE 0       COLUMNS 02- 81  
 COMMAND INPUT ===>                                            SCROLL ===> CSR  
********************************* TOP OF DATA **********************************
64                                                                              
88                                                                              
23                                                                              
43                                                                              
92                                                                              
PASS                                                                            
******************************** BOTTOM OF DATA ********************************
Please note - STOP RUN is commented out in the code posted above.
Last edited by Anuj Dhawan on Tue Dec 07, 2010 2:57 pm, edited 1 time in total.
Regards,
Anuj

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Dec 07, 2010 2:54 pm

On ther other hand if you change the IF construct of the code as:

Code: Select all

         DISPLAY'WS-SUM: 'WS-SUM 
        IF (WS-SUM / 5) > 35     
           DISPLAY 'PASS'        
        ELSE                     
           DISPLAY 'FAIL'        
*       END-IF                   
*       GOBACK.                  
        STOP RUN.
note, END-IF and GOBACK are commented out, then with the JCL:

Code: Select all

//STEP001 EXEC PGM=TEMP   
//SYSIN    DD *           
64                        
88                        
23                        
43                        
92                        
//*                       
//SYSOUT DD SYSOUT=*      
//*                       
You get:

Code: Select all

   Display  Filter  View  Print  Options  Help                                  
 -------------------------------------------------------------------------------
 SDSF OUTPUT DISPLAY ZTEMPCMN JOB26364  DSID   102 LINE 0       COLUMNS 02- 81  
 COMMAND INPUT ===>                                            SCROLL ===> CSR  
********************************* TOP OF DATA **********************************
64                                                                              
88                                                                              
23                                                                              
43                                                                              
92                                                                              
WS-SUM: 310                                                                     
PASS                                                                            
IGZ0037S The flow of control in program GURUARR proceeded beyond the last line o
         From compile unit GURUARR at entry point GURUARR at compile unit offset
         at address 43F01150.                                                   
<> LEAID ENTERED &#40;LEVEL 04/01/2008 AT 12.32&#41;                                    
<> LEAID PROCESSING COMPLETE. RC=0                                              
******************************** BOTTOM OF DATA ********************************
Regards,
Anuj

User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

Post by Krishna » Tue Dec 07, 2010 4:40 pm

Anuj - We both are on the same page. Just suggestions are different.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Wed Dec 08, 2010 1:45 pm

Hi Krishna,

I'd like to believe that that we are...

have a good one, :)
Regards,
Anuj

User avatar
Gurugars
Active Member
Posts: 107
Joined: Sat Oct 23, 2010 2:17 pm
Location: Chennai,India.

Post by Gurugars » Wed Dec 08, 2010 11:10 pm

Hi krishna and anuj,

thank u so much for your valuable suggestions.


Guru:-)
Guru:-)

You're never fully dressed without a smile :)

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Thu Dec 09, 2010 12:36 pm

You're welcome. :)
Regards,
Anuj

academyindia4

Topic deleted by Admin

Post by academyindia4 » Mon Feb 01, 2016 1:22 am

<< Content deleted By Admin >>

academyindia4

Topic deleted by Admin

Post by academyindia4 » Wed Feb 03, 2016 12:38 am

<< Content deleted By Admin >>

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others