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.

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: 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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts Error to read log with rexx CLIST & REXX 11
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Error when install DB2 DB2 2
Search our Forums:

Back to Top