View previous topic :: View next topic
|
Author |
Message |
thilakvs Warnings : 1 New User
Joined: 07 Aug 2007 Posts: 27 Location: chennai
|
|
|
|
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,
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
thilakvs Warnings : 1 New User
Joined: 07 Aug 2007 Posts: 27 Location: chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Quote: |
The thread provides details on IAM file, mine is a VSAM. |
, fine dont look there in that thread then - why the **** did I search ! |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
why the **** did I search |
You're a glutton for punishment? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Anuj Dhawan wrote: |
Quote: |
The thread provides details on IAM file, mine is a VSAM. |
, fine dont look there in that thread then - why the **** did I search ! |
Just looked on the rosta, Anuj, you are librarian for June |
|
Back to top |
|
|
SaiHema
New User
Joined: 21 May 2009 Posts: 8 Location: Chennai
|
|
|
|
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 |
|
|
SaiHema
New User
Joined: 21 May 2009 Posts: 8 Location: Chennai
|
|
|
|
Also to use REWRITE command, the organization should be 'INDEXED' and Access mode should be 'DYNAMIC'. Please check it once. |
|
Back to top |
|
|
|