Page 1 of 1

ABENDED S000 U4038

Posted: Fri Dec 03, 2010 5:50 pm
by Gurugars
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.

Posted: Fri Dec 03, 2010 6:15 pm
by Krishna
Do you have STOP RUN after IF condition in your program?

Posted: Fri Dec 03, 2010 6:29 pm
by Gurugars
just now saw that and corrcted the thing yaar.. thanks for the reply krishna..

Posted: Mon Dec 06, 2010 2:46 pm
by Anuj Dhawan
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?

Posted: Mon Dec 06, 2010 6:19 pm
by Krishna
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.

Posted: Tue Dec 07, 2010 1:00 pm
by Anuj Dhawan
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.

Posted: Tue Dec 07, 2010 2:54 pm
by Anuj Dhawan
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 ********************************

Posted: Tue Dec 07, 2010 4:40 pm
by Krishna
Anuj - We both are on the same page. Just suggestions are different.

Posted: Wed Dec 08, 2010 1:45 pm
by Anuj Dhawan
Hi Krishna,

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

have a good one, :)

Posted: Wed Dec 08, 2010 11:10 pm
by Gurugars
Hi krishna and anuj,

thank u so much for your valuable suggestions.


Guru:-)

Posted: Thu Dec 09, 2010 12:36 pm
by Anuj Dhawan
You're welcome. :)

Topic deleted by Admin

Posted: Mon Feb 01, 2016 1:22 am
by academyindia4
<< Content deleted By Admin >>

Topic deleted by Admin

Posted: Wed Feb 03, 2016 12:38 am
by academyindia4
<< Content deleted By Admin >>