Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
COBOL program error ENDED AT SVSCJES2 - ABENDED S000 U4038

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

New User


Joined: 23 Mar 2020
Posts: 17
Location: India

PostPosted: Sat Apr 11, 2020 6:32 pm    Post subject: COBOL program error ENDED AT SVSCJES2 - ABENDED S000 U4038
Reply with quote

JCL to run.

Code:
//COBRUN       EXEC IGYWCLG                                       
//COBOL.SYSIN  DD DSN=Z56117.COBOL(BANKACCT),DISP=SHR
//GO.BALANCE   DD *                                               
01234567.01                                                       
//GO.DEPOSIT   DD *                                               
00000567.01                                                       
//GO.WITHDRW   DD *                                               
00000067.01     


cobol program.

Code:
IDENTIFICATION DIVISION.                                       
       PROGRAM-ID.  MyBank.                                           
       AUTHOR.      Otto B Wealthy.                                   
       ENVIRONMENT DIVISION.                                           
       INPUT-OUTPUT SECTION.                                           
        FILE-CONTROL.                                                 
           SELECT BALANCE-AMT ASSIGN TO BALANCE.                     
           SELECT DEPOSIT-AMT ASSIGN TO DEPOSIT.                     
           SELECT WITHDRW-AMT ASSIGN TO WITHDRW.                     
       DATA DIVISION.                                                 
       FILE SECTION.                                                   
       FD BALANCE-AMT                                                 
           RECORD CONTAINS 80 CHARACTERS                               
           RECORDING MODE IS F.                                         
       01 BALANCE-IO.                                                 
           02  BAL-AMT         PIC 9999999.99.                         
           02  FILLER          PIC X(70).                               
       FD DEPOSIT-AMT                                                 
           RECORD CONTAINS 80 CHARACTERS                               
           RECORDING MODE IS F.                                         
       01 DEPOSIT-I.                                                   
           02  DEP-AMT         PIC 9999999.99.                         
           02  FILLER          PIC X(70).                               
       FD WITHDRW-AMT                                                 
           RECORD CONTAINS 80 CHARACTERS                               
           RECORDING MODE IS F.                                         
       01 WITHDRW-I.                                                   
           02  DRAW-AMT        PIC 9999999.99.                         
           02  FILLER          PIC X(70).                               
       WORKING-STORAGE SECTION.                                       
       01 NEWBAL               PIC 9999999.99.                         
       PROCEDURE DIVISION.                                             
       BEGIN.                                                         
           OPEN I-O BALANCE-AMT.                                       
           OPEN INPUT DEPOSIT-AMT.                                     
           OPEN INPUT WITHDRW-AMT.           
           CLOSE BALANCE-AMT.                                         
           CLOSE DEPOSIT-AMT.                                         
           CLOSE WITHDRW-AMT.                                         
           STOP RUN.   


sysout:

There was an unsuccessful OPEN or CLOSE of file BALANCE in program MYBANK at relative location X'18C'.

Neither FILE STATUS nor an ERROR declarative were specified. The status code was 37.
From compile unit MYBANK at entry point MYBANK at compile unit offset +0000018C at entry offset +0000018C at address 1AD0018C. [/code]


please advise, fixing the error I want generate a simple logic to accept withdraw and deposit amount and aggregate the bank balance.
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2365
Location: Hampshire, UK

PostPosted: Sat Apr 11, 2020 7:41 pm    Post subject: Reply to: COBOL program error ENDED AT SVSCJES2 - ABENDED S000 U4038
Reply with quote

Well, it is saying that you have not declared a file status variable - you should have one for each DDNAME. You then check the file status after each open/close/read/write/rewrite and if it is not 0 then you display the status and abend the job.

Now, the run-time has, very considerately, told you what the status is. You now have to look up the documentation to see what that status means and attempt to fix the problem. If you have problem fixing the problem, and you cannot resolve it by reading the documentation or talking with your colleagues, then you can come back here for more help.
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 CALL statement in COBOL for VSE Kirthishine COBOL Programming 1 Fri Jun 26, 2020 12:12 pm
No new posts Force a Return Code and print error m... Rick Ryan SYNCSORT 30 Thu Jun 25, 2020 1:18 am
No new posts Question for Cobol Report Writer jackzhang75 COBOL Programming 3 Wed May 27, 2020 4:35 am
No new posts Compare multiple files using JCL/Rexx... tanvi110788 JCL & VSAM 4 Tue May 19, 2020 5:47 pm
No new posts In JCL Procedure how we can execute R... Dhananjayulu Neeli CLIST & REXX 7 Sat May 16, 2020 12:01 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us