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

logic error occurs when writing a esds vsam file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rock Xu

New User


Joined: 04 Dec 2009
Posts: 15
Location: Shanghai China

PostPosted: Tue Dec 14, 2010 8:28 am
Reply with quote

Hello, Everyone:
I am trying to pass some parameter from JCL to cobol by 'sysin' and then write these info into a vsam file. Return code is 0 but there're nothing in file. I checked the spool.

The warning:IGZ0003W A logic error occurred for file O1 in program TASK1211 at relative loc O1 in program TASK1211 at relative location X'04C8'.

To make sure there's no mistake in my cobol prog I replace the vsam file by flat data set and it works. So it must be something wrong about the VSAM file which I created.

I defined the fd record like this:
FILE SECTION.
FD O1
DATA RECORD IS OUTPUT-RECORD.
01 OUTPUT-RECORD PIC X(5000).


And my ESDS attribute:
Organization: ESDS Write check: NO
KSDS key length: 0 Buffer space: 40960
KSDS key location: 0 Erase on delete: NO
Average record size: 5000 Imbedded index: NO
Maximum record size: 5000 Replicated index: NO

I didn't use vsam files quite a lot. Do I need to calculate the length of such as rdf when try to write a ESDS?
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 Dec 14, 2010 8:38 am
Reply with quote

What does your SELECT statement look like?
Back to top
View user's profile Send private message
Rock Xu

New User


Joined: 04 Dec 2009
Posts: 15
Location: Shanghai China

PostPosted: Tue Dec 14, 2010 8:41 am
Reply with quote

Hello, Robert:
My SELECT statement:
SELECT O1 ASSIGN TO AS-O1
ORGANIZATION IS SEQUENTIAL
ACCESS IS SEQUENTIAL
FILE STATUS IS OUT-STAT.
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 Dec 14, 2010 9:05 am
Reply with quote

What is the file status code for the OPEN? And for the WRITE?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Dec 14, 2010 1:59 pm
Reply with quote

IGZ0003W

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.

Does that apply to your program logic?
Back to top
View user's profile Send private message
Rock Xu

New User


Joined: 04 Dec 2009
Posts: 15
Location: Shanghai China

PostPosted: Fri Dec 17, 2010 1:19 pm
Reply with quote

Hello Robert:
Sorry for delaying such a long time. I got some other work to do.
My write file status is 92. Means logic error.

Also thanks Peter, I am checking it now.
Back to top
View user's profile Send private message
Rock Xu

New User


Joined: 04 Dec 2009
Posts: 15
Location: Shanghai China

PostPosted: Fri Dec 17, 2010 1:36 pm
Reply with quote

Hello, Peter:
I don't think so.
1.I need to write file o1 so I should not open it as input.
2.The ESDS is existing, If I open it as an output file, Open file status will be 37.
3.So open the ESDS as i-o is the only choice.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Dec 17, 2010 3:22 pm
Reply with quote

For your open status see :

ibmmainframes.com/about39315.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: Fri Dec 17, 2010 6:11 pm
Reply with quote

Quote:
2.The ESDS is existing, If I open it as an output file, Open file status will be 37.
This would only be true if your JCL is wrong. Normally, the file status should be 00 for an OPEN OUTPUT on an ESDS VSAM file.
Back to top
View user's profile Send private message
Rock Xu

New User


Joined: 04 Dec 2009
Posts: 15
Location: Shanghai China

PostPosted: Fri Jan 07, 2011 6:30 am
Reply with quote

Hello, Robert
I know what's wrong. In the system which I worked on, I must create an esds by model an specific existing esds file. If I create the esds by fileaid by myself, some parameter maybe wrong and the system didn't allow me to write it.

Thank you all and thanks for all of your suggestions.
Regards.
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: Fri Jan 07, 2011 6:51 am
Reply with quote

Glad to hear you got it resolved!
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top