Portal | 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: 19
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: 2418
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 SYNCSORT Error - CONTROL FIELD BEYOND... arunn SYNCSORT 10 Sun Oct 04, 2020 4:10 pm
This topic is locked: you cannot edit posts or make replies. Missing Negative sign in COBOL jzhardy COBOL Programming 6 Sat Sep 26, 2020 11:32 am
No new posts Easytrieve EZABX007 with error code 0... Carol Schablow CA Products 7 Thu Sep 24, 2020 3:30 am
No new posts COBOL reading from SYSIN jzhardy COBOL Programming 1 Mon Sep 21, 2020 2:37 pm
No new posts how to read accounting information in... jzhardy COBOL Programming 1 Mon Sep 21, 2020 9:57 am

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