View previous topic :: View next topic
|
Author |
Message |
rohitvw
New User
Joined: 04 Feb 2009 Posts: 12 Location: Chennai
|
|
|
|
How we should write a low value record in KSDS using COBOL. In same program we are reading and deleting records from the respective KSDS file.
Please Help.
Thanks. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
MOVE LOW-VALUES to FD 01 and write the record ... is there a particular problem you're having? |
|
Back to top |
|
|
rohitvw
New User
Joined: 04 Feb 2009 Posts: 12 Location: Chennai
|
|
|
|
I am getting a logical error IGZ0003W. Thanks Robert for quick reply. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
rohitvw wrote: |
I am getting a logical error IGZ0003W. Thanks Robert for quick reply. |
What is the associated code?
Please post it........ |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
From the MAC:
Quote: |
IGZ0003W
A logic error occurred for file file-name in program program-name at relative location relative-location.
Explanation:
This error is usually caused by an I/O operation request that is not valid for the fileāfor example, a WRITE into a file opened for INPUT, or a START to a VSAM ESDS.
A file status clause was specified or an error declarative statement was active for the file.
Programmer response:
Check the operation request and modify the program.
System action:
No system action was taken.
Symbolic Feedback Code:
IGZ003 |
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
I am getting a logical error IGZ0003W
|
no, that is a logic error. your program sucks. |
|
Back to top |
|
|
rohitvw
New User
Joined: 04 Feb 2009 Posts: 12 Location: Chennai
|
|
|
|
File Defination
SELECT OPTIONAL CLFILE ASSIGN TO FM27I02
ORGANIZATION IS INDEXED
RECORD KEY IS FILE-KEY-CL
FILE STATUS IS WB-CL-STATUS.
------------------------------------------------------------------
FD DECLARATION
FD CLFILE.
01 CL-RECORD.
COPY CLRECORD.
-------------------------------------------------------------------
I AM WRITING RECORD IN BELOW FASHION
MOVE LOW-VALUES TO CL-RECORD
WRITE CL-RECORD
BUT WRITE STATEMTMENT IS FAILING WITH IGZ0003W ERROR
PLEASE HELP.
THNAKS. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Question 1: What does the OPEN look like -- since the error message I posted is pretty clear in saying the OPEN could be wrong.
Question 2: What is the file status code value? This can provide valuable data about the error.
Question 3: Since the file is optional, are you even sure it is in the JCL? If not, that could also explain why you're getting an error. |
|
Back to top |
|
|
rohitvw
New User
Joined: 04 Feb 2009 Posts: 12 Location: Chennai
|
|
|
|
Open Look like
OPEN I-O CLFILE.
Dump is not showing the File status but showing the below error message
IGZ0003W A logic error occurred for file FM27IO02 in program FM27 at relative location X'0FAC'.
File is defined in JCL as below
//FM27I01 DD DSN=CLFILE,DISP=SHR,
// AMP=('ACCBIAS=SYSTEM')
Please Suggest. Thanks. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
SELECT OPTIONAL CLFILE ASSIGN TO FM27I02
IGZ0003W A logic error occurred for file FM27IO02 in program FM27 at relative location X'0FAC'.
//FM27I01 DD ...
could the discrepancy in the bolded DD names be the problem? |
|
Back to top |
|
|
rohitvw
New User
Joined: 04 Feb 2009 Posts: 12 Location: Chennai
|
|
|
|
No Actually I am just trying rerun the program by changing the file.
By mistake I gave the Dump for the run when file name is FM27I02 in both Cobol program and JCL.
So file is FM27I02 and correct error message is below
IGZ0003W A logic error occurred for file FM27I02 in program FM27 at relative location X'0FAC'.
Sorry for inconvience.
Thanks.
Plese Suggest. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
What is the file status code on the open -- put a display in to show it and let us know. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
rohitvw wrote: |
Open Look like
OPEN I-O CLFILE. |
If the file is EMPTY (there aren't any friggin records), then you must OPEN the file for OUTPUT, WRITE a single LOW-VALUES record, CLOSE the file and you're done.
Give this a try.... |
|
Back to top |
|
|
rohitvw
New User
Joined: 04 Feb 2009 Posts: 12 Location: Chennai
|
|
|
|
Hi all.
Thanks for your replys.
Actually the file is not empty, it is having nearly 3000 records.
File status is not mentioned any ware in spool.
Please suggest. |
|
Back to top |
|
|
rohitvw
New User
Joined: 04 Feb 2009 Posts: 12 Location: Chennai
|
|
|
|
FIle Status is 10 when I am trying to write the file |
|
Back to top |
|
|
rohitvw
New User
Joined: 04 Feb 2009 Posts: 12 Location: Chennai
|
|
|
|
Is file status is 00 also than also same logical error(IGZ0003W) is coming |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
1. File status is captured by the program. YOU must display it or otherwise have it show up on some output. It will not magically appear in the spool.
2. If you don't check the file status on the open, change your program to do so. Now. Before you do anything else. And display the file status if not 00 or 97.
3. File status 10 occurs only on READ as it means you've hit the end of file. I vaguely remember seeing a 10 on a WRITE but only if the OPEN failed in some way -- see #1 above.
4. File status 10 with IGZ0003W would make sense if you're trying to read a file before writing to it.
5. You're not providing adequate data for debugging, forcing us to guess without adequate information. Cut and paste using BBCode the job output when you run it -- expanded JCL and messages from the system log. When you paste as a message the way you did your COBOL code, you leave stuff out that is critical (such as the actual OPEN statement you have for the file). |
|
Back to top |
|
|
rohitvw
New User
Joined: 04 Feb 2009 Posts: 12 Location: Chennai
|
|
|
|
Hi Robert.
Thanks for you time and suggestions.
Actually program I need to code is a purge program, and after deleting all the necessary records I have to insert a Low value record if low value record is not available.
I have the file status check in program.
So after putting display for file status, i could see that file status is 10 as program already went through the complete file to delete neccesary records when I am trying write the file.
So I tried to write the file in begining of the program also when file status 00 but still it is giving the same error message IGZ0003W.
Could please let me know how to use BBCode and what exactly BBCode is.
Thanks. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Assuming your code is as you posted, the default is ACCESS IS SEQUENTIAL. This requires records be processed in key sequence. You cannot insert a LOW-VALUES record after processing the deletes since the LOW-VALUES record will not be in sequence. This will cause a logic error exactly as you've seen. You must close the file, open it again, and then you should be able to write the LOW-VALUES record. However, considering the significant gaps in the data you've presented us, there's no guarantee that this will work since you may have not mentioned some other critical factor. |
|
Back to top |
|
|
rohitvw
New User
Joined: 04 Feb 2009 Posts: 12 Location: Chennai
|
|
|
|
Hi Robert.
The problem is with access mode only, it should be dynamic to write a record when few records are already present in KSDS file.
Thanks for your help and efforts, I really appreciate that.
I first time used this forum, I am finally very happy as my code is working as required.
Thank you very much.
Regards
Rohit. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Glad to hear you got it working! |
|
Back to top |
|
|
|