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

COBOL program error ENDED AT SVSCJES2 - ABENDED S000 U4038

IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
Reply with quote

JCL to run.

//COBRUN       EXEC IGYWCLG                                       
//GO.BALANCE   DD *                                               
//GO.DEPOSIT   DD *                                               
//GO.WITHDRW   DD *                                               

cobol program.

IDENTIFICATION DIVISION.                                       
       PROGRAM-ID.  MyBank.                                           
       AUTHOR.      Otto B Wealthy.                                   
       ENVIRONMENT DIVISION.                                           
       INPUT-OUTPUT SECTION.                                           
           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.                                             
           OPEN I-O BALANCE-AMT.                                       
           OPEN INPUT DEPOSIT-AMT.                                     
           OPEN INPUT WITHDRW-AMT.           
           CLOSE BALANCE-AMT.                                         
           CLOSE DEPOSIT-AMT.                                         
           CLOSE WITHDRW-AMT.                                         
           STOP RUN.   


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: 2455
Location: Hampshire, UK

PostPosted: Sat Apr 11, 2020 7:41 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming


Similar Topics
Topic Forum Replies
No new posts Can EATTR be coded in an IMS COBOL pgm? IMS DB/DC 1
No new posts Cobol transactions in SYSVIEW COBOL Programming 0
No new posts Zunit Test case editor error Testing & Performance 4
No new posts executing XCTL command in COBOL witho... CICS 5
No new posts Forcing a step to run (even if abended) JCL & VSAM 8
Search our Forums:

Back to Top