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

getting u4038 abend


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Wed Nov 14, 2007 11:28 am
Reply with quote

Hi,
I'm running a cobol-sort prog using IGYWCLG. I'm getting correct result.. but only last record is repeating in output file. and also getting S000 U4038 abend code. Please help me to solve this.

thanks in advance
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Nov 14, 2007 11:43 am
Reply with quote

Vinay,

Please post few more details displayed in the sysout. Also, check this link.

http://ibmmainframes.com/viewtopic.php?t=4431&highlight=4038
Back to top
View user's profile Send private message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Wed Nov 14, 2007 12:04 pm
Reply with quote

I had 40 recs in input file... it's writing 41 recs in output file...
The message i'm getting in CEEDUMP is-- "SORT2 was not compiled with the SYM suboption of the TEST option. A formatted variable dump cannot be produced".
and in sysout is-- "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 +000008BE at address 00006DFE.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed Nov 14, 2007 12:12 pm
Reply with quote

look at the jcl log to see the original abend,
U4038 is a generic abend which comes at the end of LE abend processing
if You need more help post the relevant lined form the log
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Nov 14, 2007 8:32 pm
Reply with quote

Hello,

You may be getting the last record twice due to some processing after end of file. This might also cause the abend.
Back to top
View user's profile Send private message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Thu Nov 15, 2007 10:06 am
Reply with quote

dick,
You are right dick,same thing happening here... Still I'm trying..
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Thu Nov 15, 2007 2:53 pm
Reply with quote

Hi Vinay,

May be the Loop is not correct, if you send code, we can help you

Quote:
I had 40 recs in input file... it's writing 41 recs in output file...


Any how use following logic

Code:
PROCEDURE DIVISION
0000-MAIN.
       .
        .

       OPEN INPUT INPUT-FILE
               OUTPUT OUT-FILE

      READ INPUT-FILE
      PERFORM PARA-1 UNTIL EOF
      STOP RUN

PARA-1
        WRITE OUT-REC FROM INPUT-REC
        READ INPUT-FILE AT END SET EOF TO TRUE
Back to top
View user's profile Send private message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Thu Nov 15, 2007 4:09 pm
Reply with quote

Code:

PROCEDURE DIVISION USING LS-FIELD.                   
    ACCEPT LS-FIELD.                                 
    PERFORM A00-OPEN-FILES.                           
    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.                                           
PERFORM C00-CLOSE-FILES.                         
STOP RUN.                                         
A00-OPEN-FILES.                               
    OPEN INPUT IN-FILE.                       
    OPEN OUTPUT OUT-FILE.                     
                                               
A10-INPUT-PROCEDURE.                           
    PERFORM UNTIL WS-FLAG = 'Y'               
       READ IN-FILE AT END MOVE 'Y' TO WS-FLAG
            NOT AT END MOVE IN-REC TO SYS-REC 
       END-READ                               
       RELEASE SYS-REC                         
     END-PERFORM.                       
 B10-OUTPUT-PROCEDURE.                   
     RETURN SYS-FILE                     
          AT END GO TO C00-CLOSE-FILES. 
     MOVE SYS-REC TO OUT-REC.           
     WRITE OUT-REC.                     
     GO TO B10-OUTPUT-PROCEDURE.         
C00-CLOSE-FILES.           
    CLOSE IN-FILE, OUT-FILE.


And this my comp,run jcl....
[/code]
//CKP1SA JOB '283597','VINAY',NOTIFY=&SYSUID,
// MSGCLASS=Y,PRTY=15
//STEP1 EXEC IGYWCLG,PARM.COBOL='FASTSRT'
//COBOL.SYSIN DD DSN=E1682.VINAY.COBOL(SORT2),DISP=SHR
//LKED.SYSLMOD DD DSN=E1682.VINAY.LOADLIB(SORT2),DISP=SHR
//LKED.SYSLIB DD DSN=CEE.SCEELKED,DISP=SHR
//GO.INP DD DSN=E1682.VINAY.INP,DISP=SHR
//GO.OUTP DD DSN=E1682.VINAY.OUTP,DISP=SHR
//GO.SYST DD DSN=&TEMP,DISP=(,PASS),SPACE=(TRK,(10,10),RLSE)
//GO.SYSIN DD *
A
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Thu Nov 15, 2007 5:21 pm
Reply with quote

Vinay,

Code:
PROCEDURE DIVISION USING LS-FIELD.                   
    ACCEPT LS-FIELD.                                 
    PERFORM A00-OPEN-FILES.                           
    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.                                           
    PERFORM C00-CLOSE-FILES.                     
    STOP RUN.                                         
A00-OPEN-FILES.                               
    OPEN INPUT IN-FILE.                       
    OPEN OUTPUT OUT-FILE.                     
                                               
A10-INPUT-PROCEDURE.                           
    PERFORM UNTIL WS-FLAG = 'Y'               
       READ IN-FILE AT END MOVE 'Y' TO WS-FLAG
            NOT AT END MOVE IN-REC TO SYS-REC 
       END-READ                               
       RELEASE SYS-REC                         
     END-PERFORM.                       
 B10-OUTPUT-PROCEDURE.                   
     RETURN SYS-FILE                     
          AT END GO TO C00-CLOSE-FILES. 
     MOVE SYS-REC TO OUT-REC.           
     WRITE OUT-REC.                     
     GO TO B10-OUTPUT-PROCEDURE.         
C00-CLOSE-FILES.           
    CLOSE IN-FILE, OUT-FILE.



Chnage program like this

Vinay,

Code:
    PROCEDURE DIVISION USING LS-FIELD.                   
    ACCEPT LS-FIELD.                                 
    PERFORM A00-OPEN-FILES.                           
    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.                                           
    PERFORM C00-CLOSE-FILES.                       
    STOP RUN.                                         
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.   

--------------------------------------------------------------

This is why the record get repeated in output file

------------------------------------------------------------
Code:
 B10-OUTPUT-PROCEDURE.                   
     RETURN SYS-FILE                     
          AT END GO TO C00-CLOSE-FILES. 
     MOVE SYS-REC TO OUT-REC.           
     WRITE OUT-REC.                     
     GO TO B10-OUTPUT-PROCEDURE.         
C00-CLOSE-FILES.           
    CLOSE IN-FILE, OUT-FILE.



Why you are giving, its not necessary remove this code

Execute and let me know the result
Back to top
View user's profile Send private message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Fri Nov 16, 2007 11:05 am
Reply with quote

Raghu,
SYS-REC is temp file used for sorting. I need to write recs in out-file. So why i'm using B10-PARA. And i tried with your code also but i'm getting same abend.
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Fri Nov 16, 2007 2:35 pm
Reply with quote

Hello Vinay,

Quote:
SYS-REC is temp file used for sorting. I need to write recs in out-file. So why i'm using B10-PARA


The code which you gave is a type of ADVANCED SORT,

What you doing there is

1) You are reading sequentially from INPUT-FILE then writing into the SORT-FILE using RELEASE command
2) Then you are reading record from SORT-FILE then writing into OUTPUT-FILE
( B10-PARA will do this)

Change program as i suggest below

-------------------------------------------------------------

Code:
    PROCEDURE DIVISION USING LS-FIELD.                   
    ACCEPT LS-FIELD.                                 
    PERFORM A00-OPEN-FILES.                           
    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.                                           
                   
    STOP RUN.                                         
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 C00-CLOSE-FILES. 
     MOVE SYS-REC TO OUT-REC.           
     WRITE OUT-REC.                     
     GO TO B10-OUTPUT-PROCEDURE.         
C00-CLOSE-FILES.           
    CLOSE IN-FILE, OUT-FILE.



Execute and let me know the result
Back to top
View user's profile Send private message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Fri Nov 16, 2007 5:14 pm
Reply with quote

Raghu,
I used the code sent by you. Now I'm getting correct result i.e last rec is not repeating but still i'm getting abend.
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Fri Nov 16, 2007 5:21 pm
Reply with quote

Hi Vinay,

Did you removed
Code:

PERFORM C00-CLOSE-FILES.
from before STOP RUN

Go through manual first, really it will help you

Execute once again and let me know result, if it still throw error send me JCL
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Fri Nov 16, 2007 5:26 pm
Reply with quote

Hi vinay,

Quote:
I used the code sent by you. Now I'm getting correct result i.e last rec is not repeating but still i'm getting abend.


What did u mean, You are getting result correctly but it still get abended
Back to top
View user's profile Send private message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Fri Nov 16, 2007 6:01 pm
Reply with quote

Ya i removed that also. Now i'm sending my JCL also... i think it's already in this topic....
Code:
//CKP1SA JOB '283597','VINAY',NOTIFY=&SYSUID,                     
//          MSGCLASS=Y,PRTY=15                                     
//STEP1 EXEC IGYWCLG,PARM.COBOL='FASTSRT'                         
//COBOL.SYSIN DD DSN=E1682.VINAY.PDS(SORT2),DISP=SHR               
//LKED.SYSLMOD DD DSN=E1682.VINAY.LOADLIB(SORT2),DISP=SHR         
//GO.INP DD DSN=E1682.VINAY.INP,DISP=SHR                           
//GO.OUTP DD DSN=E1682.VINAY.OUTP,DISP=SHR                         
//GO.SYST DD DSN=&TEMP,DISP=(,PASS),SPACE=(TRK,(10,10),RLSE)       
//GO.SYSIN DD *                                                   
A                                                                 
Back to top
View user's profile Send private message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Fri Nov 16, 2007 6:08 pm
Reply with quote

Quote:
What did u mean, You are getting result correctly but it still get abended
I mean I'm getting correct no of recs in output file in correct sorted order.. But still job ending with S000 U4038 abend... and in sysout i'm getting msg as...
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.
END OF DFSORT



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

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Thu Nov 22, 2007 4:54 pm
Reply with quote

Anybody got any idea(solution) for my probs.......
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Call an hlasm from REXX in batch and ... CLIST & REXX 4
No new posts What is the most complex abend you've... Mainframe Interview Questions 8
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
No new posts WER999A - UNSUCCESSFUL SORT 8ED U Ab... SYNCSORT 5
Search our Forums:

Back to Top