Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
VSAM ERROR 92 while trying to write a record.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: VSAM ERROR 92 while trying to write a record.
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

Senior Member


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

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

Have a look on this previous thread: http://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: 8201
Location: Dubuque, Iowa, USA

PostPosted: Tue Jun 23, 2009 6:21 pm    Post subject:
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    Post subject:
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: 8620
Location: Back in jolly old England

PostPosted: Wed Jun 24, 2009 3:49 pm    Post subject:
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: 8201
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 24, 2009 5:24 pm    Post subject:
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

Senior Member


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

PostPosted: Wed Jun 24, 2009 5:47 pm    Post subject:
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: 8201
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 24, 2009 5:54 pm    Post subject:
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: 6970
Location: porcelain throne

PostPosted: Wed Jun 24, 2009 6:05 pm    Post subject:
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: 8620
Location: Back in jolly old England

PostPosted: Wed Jun 24, 2009 6:08 pm    Post subject:
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    Post subject:
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    Post subject:
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    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 ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm

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