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

COBOL Error Codes 98 and 41


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

New User


Joined: 29 May 2003
Posts: 2

PostPosted: Thu May 29, 2003 5:29 pm
Reply with quote

I have an "Cobol I/O error 98 and 41" Do you know what that means?
Back to top
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1210
Location: India

PostPosted: Thu May 29, 2003 5:37 pm
Reply with quote

Sunitha wrote:
I have an "Cobol I/O error 98 and 41" Do you know what that means?


Error 41 is an Cobol file error, you have tried to open a file that's already opened. Before opening the file again, check whether it is closed previously. (watch program flow)

Error code 98 is implementer defined and the reason depends on the compiler you are using.
Back to top
View user's profile Send private message
xzsymr

New User


Joined: 06 Jun 2003
Posts: 7
Location: NZ

PostPosted: Thu Jun 12, 2003 2:57 pm
Reply with quote

Status 98 is file locked. Caused by either RLS or SHR(1)
Back to top
View user's profile Send private message
Sunitha

New User


Joined: 29 May 2003
Posts: 2

PostPosted: Sat Jun 14, 2003 7:22 am
Reply with quote

xzsymr wrote:
Status 98 is file locked. Caused by either RLS or SHR(1)


But sir, What is RLS & SHR(1)...

I can't understand your answer... Is 98 available in Mainframe COBOL. This qs be asked in my Interview.
Back to top
View user's profile Send private message
DNelsonPNC

EXPERT


Joined: 15 Jun 2003
Posts: 10
Location: North Carolina

PostPosted: Sun Jun 15, 2003 7:14 am
Reply with quote

FILE STATUS values can be found in ERROR DESCRIPTOR (available on Download page of this site).
Back to top
View user's profile Send private message
xzsymr

New User


Joined: 06 Jun 2003
Posts: 7
Location: NZ

PostPosted: Sun Jun 15, 2003 12:27 pm
Reply with quote

RLS - is Record level Sharing. Normaly VSAM will lock entire CI (Control Intervals) in the later releases of VSAM ands SMS only the record level read for update is locked.

SHR(1) is the share options defined for the file

basiclally Only 1 user on 1 system can use the file.
Back to top
View user's profile Send private message
saravanans4

New User


Joined: 01 Sep 2003
Posts: 26

PostPosted: Mon Sep 01, 2003 1:06 pm
Reply with quote

how to move values(for e.g date) from COBOL program to JCL.....
please guide me
Back to top
View user's profile Send private message
DNelsonPNC

EXPERT


Joined: 15 Jun 2003
Posts: 10
Location: North Carolina

PostPosted: Tue Sep 02, 2003 1:25 am
Reply with quote

There is no provision in MVS to copy application data to JCL. The only comm between application and JCL is via ReturnCode in the range of 0<=4095.
Back to top
View user's profile Send private message
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 237
Location: USA

PostPosted: Tue Sep 02, 2003 10:53 am
Reply with quote

Hello Sunitha,


You can get I/O error 98 due to the RLS / SHR(1) and 41 due to opening an already open file.

Please go through the following explanation about the RLS parameter and let me know in case of any concerns

RLS:
You can, on a system that includes MVS/DFSMS Version 1 Release 3 or higher, use the RLS parameter to specify the level of record sharing, or sharing protocol, for a VSAM data set containing records that must be shared. See DFSMS/MVS Using Data Sets for a description of the sharing protocols and to determine whether your application can run in a shared data environment without modification.


Note: RLS is most useful for an existing application. For a new or heavily-modified application, you can request record-level sharing in application code and do not need to specify RLS on the DD statement.

Specifying RLS does not override any other JCL parameter.

RLS = NRI / CR


NRI - No Read Integrity.
The application can read all records. Use this subparameter if the application can read uncommitted changes made to a data set by another application. NRI provides better performance than the CR subparameter because it avoids the overhead of obtaining a lock when reading a record from the data set.


CR - Consistent Read.
This subparameter requests VSAM to obtain a SHARE lock on each record the application reads. This ensures the application will not read uncommitted changes made to a data set by another application. VSAM obtains the lock while processing a GET NUP request, and releases the lock before completing the GET request. An application that processes a data set allocated with RLS=CR may require modification if it tries to read changes to the data set.


Hope this helps,

Regards

Mayuresh
Back to top
View user's profile Send private message
saravanans4

New User


Joined: 01 Sep 2003
Posts: 26

PostPosted: Tue Sep 02, 2003 1:16 pm
Reply with quote

thanks for uur prompt and quick reply.....
i need answer for other question.

suppose if for assumption if we have one variable which has been assigned as comp and for e.g if the comp can have =3,72,000 bytes and if we assign the value for that variable more than that bytes then what would happen....whether it will give any error message......

thanks and regards,
saravanan
Back to top
View user's profile Send private message
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 237
Location: USA

PostPosted: Fri Sep 05, 2003 2:51 pm
Reply with quote

Hello saravanans4,

Quote:
Binary format numbers occupy 2, 4, or 8 bytes of storage.

If the PICTURE clause specifies that the item is signed, the leftmost bit is used as the operational sign.

A binary number with a PICTURE description of four or fewer decimal digits
occupies 2 bytes; five to nine decimal digits, 4 bytes; and 10 to 18 decimal digits, 8 bytes.

Binary items with nine or more digits require more handling by the compiler.

Testing them for the SIZE ERROR condition and rounding is more cumbersome than with other types.

Use the TRUNC(STD|OPT|BIN) compiler option to indicate how binary data (BINARY, COMP, or COMP-4) is to be truncated.


TRUNC STD will truncate the data and will show it in the display format.
TRUNC BIN will truncate the BINARY data.
TRUNC OPT will truncate the data depending upon the use of the variable.
and generally avoid using TRUNC OPT option as it may cause problems in case that variable is used in some computations.

TRUNC BIN is the default option.

Conclusion:
IF you try to move the data which is of more length than the PIC clause of the variable, it will get TRUNCATED and will not give any ERROR.
IF you want to be sure that the data is not truncated, you can use ON SIZE ERROR condition.

Hope this helps,

Regards

Mayuresh Tendulkar
Back to top
View user's profile Send private message
saravanans4

New User


Joined: 01 Sep 2003
Posts: 26

PostPosted: Fri Sep 05, 2003 6:47 pm
Reply with quote

thanks boss...
very much delighted by the quick and prompt response......

thanks and regards
saravanan
Back to top
View user's profile Send private message
kunalgadree

New User


Joined: 13 Apr 2006
Posts: 2

PostPosted: Wed May 03, 2006 5:30 pm
Reply with quote

98----file is locked....
41-----when ur trying to open a file without closing it.......
Back to top
View user's profile Send private message
rajesh_mbt

New User


Joined: 27 Mar 2006
Posts: 97
Location: India

PostPosted: Mon Nov 27, 2006 5:55 pm
Reply with quote

Hi Senthil
There could be few reasons but without program, we can't assume anything. Hence, would post your program here which will make it more visible to others.
Back to top
View user's profile Send private message
rajesh_mbt

New User


Joined: 27 Mar 2006
Posts: 97
Location: India

PostPosted: Mon Nov 27, 2006 5:59 pm
Reply with quote

Hey All
Please ignore the above post which is wrogly posted here instead of posting someone else.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Nov 28, 2006 12:34 pm
Reply with quote

hi
download abend asist, this will help you to certain extent...

Mainframe Downloads

icon_neutral.gif
Back to top
View user's profile Send private message
dnreddy

New User


Joined: 08 Dec 2006
Posts: 8
Location: chennai

PostPosted: Tue Apr 10, 2007 3:06 pm
Reply with quote

Hi

COBOL ABENDS 98 & 41

98-->
Reason -- IMPLEMENTER DEFINED
Description -- File is Locked - OPEN failed


41-->
Reason -- LOGICAL ERROR. ATTEMPT TO OPEN A FILE
WHICH IS ALREADY OPENED
Description -- An OPEN statement was attempted for a file in the
open mode.
User Response-- Close the file before opening it with different
mode
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 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
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top