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

VSAM ERROR 92 while trying to write a record.


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

New User


Joined: 07 Aug 2007
Posts: 27
Location: chennai

PostPosted: Tue Jun 23, 2009 4:40 pm
Reply with quote

Hi,

I need to rewrite a field that is part of the alternate key in a VSAM file.
Therefore I do a delete and write. When the program tries to write the record, it abends with Logical error.

I have defined the file as,
Code:
SELECT  TAXAUD              ASSIGN TO      TAXAUD
                            ORGANIZATION IS INDEXED
                            ACCESS IS SEQUENTIAL
                            RECORD KEY IS TXAUD-PRIMARY-KEY
                            STATUS IS VSAM-STATUS.


The file is read as,
Code:
READ  TAXAUD


In the JCL I have included only the main cluster.

The progam abends with the following error.
IGZ0003W A logic error occurred for file TAXAUD in program DIVDTCON at relative location X'09C0'.

VSAM error code is 92.

Please help to resolve it.

Thanks.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Jun 23, 2009 5:38 pm
Reply with quote

Have a look on this previous thread: www.ibmmainframes.com/post-97355.html
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jun 23, 2009 6:21 pm
Reply with quote

What does the JCL statement for TAXAUD look like?

Did you verify a file status code of 00 on the DELETE before you attempted the write?

Did you verify offset 09C0 is actually part of the WRITE statement by looking at the compile output (LIST or OFFSET options)?
Back to top
View user's profile Send private message
thilakvs
Warnings : 1

New User


Joined: 07 Aug 2007
Posts: 27
Location: chennai

PostPosted: Wed Jun 24, 2009 1:16 pm
Reply with quote

Hi Anuj,

The thread provides details on IAM file, mine is a VSAM.

Hi Robert,

The vsam status after delete is zero. I was not able to point out the offset in the listing.

However, I have solved the issue. Looks like while I am trying to write the file, the record is not getting inserted at the correct position.

I modified the process as below.
1. Delete the records from vsam file and extract them to a flat file (the flat file has the corrected key).
2. Merge records from vsam and flat file.
3. Load this to the vsam (after delete, define of the vsam).

Thank you for your response. Appreciate it!!
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jun 24, 2009 3:49 pm
Reply with quote

Quote:
The thread provides details on IAM file, mine is a VSAM.

This should make absolutely no difference at all to the processing of the file. You would get the same logic error using an IAM file as you would using a VSAM file.

Quote:
I modified the process as below.
1. Delete the records from vsam file and extract them to a flat file (the flat file has the corrected key).
2. Merge records from vsam and flat file.
3. Load this to the vsam (after delete, define of the vsam).

Seems rather a long way around the problem, especially if the file is large and contains a couple of hundred thousand records.

I would suggest that you correct the logic error in the program rather than find some convoluted method to bypass the errors.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 24, 2009 5:24 pm
Reply with quote

As expat said, the larger the file the worse your solution will be. But as long as it works & your management is happy with the solution go with it.

Of course, there are unanswered questions:
1. You mentioned alternate index in the very first line. Yet nothing you posted references alternate index.
2. File status 92 is a logic error. You're bypassing the logic error by getting rid of the logic -- so you haven't really learned anything to prevent this problem the next time this situation arises.
3. One possible source of the logic error is your statement that in your JCL you only included the base cluster name; if the alternate index is defined with UPGRADE then having a DD statement pointing to the alternate index PATH is not optional and could very well cause your logic error.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Jun 24, 2009 5:47 pm
Reply with quote

Quote:
The thread provides details on IAM file, mine is a VSAM.
icon_rolleyes.gif, fine dont look there in that thread then - why the **** did I search !
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 24, 2009 5:54 pm
Reply with quote

Quote:
why the **** did I search
You're a glutton for punishment? icon_biggrin.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 24, 2009 6:05 pm
Reply with quote

after all, the TS did look in at the link,
but discounted it because it was off subject.

So, if you are going to provide one, make sure the link fits. icon_lol.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jun 24, 2009 6:08 pm
Reply with quote

Anuj Dhawan wrote:
Quote:
The thread provides details on IAM file, mine is a VSAM.
icon_rolleyes.gif, fine dont look there in that thread then - why the **** did I search !

Just looked on the rosta, Anuj, you are librarian for June icon_lol.gif
Back to top
View user's profile Send private message
SaiHema

New User


Joined: 21 May 2009
Posts: 8
Location: Chennai

PostPosted: Wed Jun 24, 2009 6:23 pm
Reply with quote

007000 WHEN '92' DISPLAY 'LOGIC ERROR/OPENING AN OPEN FILE'
007100 DISPLAY 'OR READING OUTPUT FILE'
007200 DISPLAY 'OR WRITE INPUT FILE'
007300 DISPLAY 'OR DEL/REW BUT NO PRIOR READ'

one reason for cobol program gives abends with VSAM error code 92, you wirte the record to the file wthout a prior read. you nead to read the same record using the key and the use re-write. Otherwise u ll get error code '92'.

Please correct me if i am wrong.
Back to top
View user's profile Send private message
SaiHema

New User


Joined: 21 May 2009
Posts: 8
Location: Chennai

PostPosted: Wed Jun 24, 2009 6:25 pm
Reply with quote

Also to use REWRITE command, the organization should be 'INDEXED' and Access mode should be 'DYNAMIC'. Please check it once.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top