Error while copying VSAM file



Help for IBM's record-oriented filesystem VSAM, ESDS, KSDS, RRDS, LDS and Storage management Subsystems

Error while copying VSAM file

Postby ashokkumar_rn » Wed Mar 27, 2013 8:21 pm

Hi,

The below step is being used in one of my jobs to copy a VSAM file to a PS file.

//STEP01 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT FILE(VSAM file),DISP=SHR
//SORTOUT DD DSN=OUTPUT FILE(PS dataset),DISP=OLD
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=SORTOUT,VTOF,OUTREC=(5,300)
/*

Sometimes this step fails with the below error message -

VSAM INPUT ERROR L(156) SORTIN

To resolve this all I have to do is restart the job from this step after some time.

Can someone help me understand why this happens and what can be done to fix this permanently?

Thanks in advance.
ashokkumar_rn
 
Posts: 12
Joined: Wed Mar 27, 2013 7:59 pm
Has thanked: 8 times
Been thanked: 0 time

Re: Error while copying VSAM file

Postby steve-myers » Wed Mar 27, 2013 8:31 pm

If we can believe your initial post, the SORTIN DD statement is specifying a member of a PDS.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Error while copying VSAM file

Postby Robert Sample » Wed Mar 27, 2013 8:33 pm

Is the VSAM file open in another address space (such as a CICS region) while you are doing your copy? If not, change the DISP=SHR to DISP=OLD to verify that nothing else can access the file while you are doing your copy.

These users thanked the author Robert Sample for the post:
ashokkumar_rn (Wed Mar 27, 2013 8:49 pm)
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Error while copying VSAM file

Postby Akatsukami » Wed Mar 27, 2013 8:36 pm

You should have mentioned that the message number was ICE076A.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Error while copying VSAM file

Postby ashokkumar_rn » Wed Mar 27, 2013 8:45 pm

@Robert - This VSAM file is not being used CICS. This is the only job that uses this file. I will try changing disposition to DISP=OLD and see if this resolves the problem. The problem is that this happens very rarely. Say, once in 2-3 months and all I do to resolve the problem is just restart the job from the failed step.

@Akatsukami - Yes. The message number was indeed ICE076A. I tried going thru the online forums to see if I can find why this was happening but I did not get much information.

@Steve - I have not specified the exact file name in SORTIN. The actual production step has a VSAM file there.
ashokkumar_rn
 
Posts: 12
Joined: Wed Mar 27, 2013 7:59 pm
Has thanked: 8 times
Been thanked: 0 time

Re: Error while copying VSAM file

Postby Akatsukami » Wed Mar 27, 2013 8:52 pm

ashokkumar_rn wrote:@Akatsukami - Yes. The message number was indeed ICE076A. I tried going thru the online forums to see if I can find why this was happening but I did not get much information.

You would do better to go directly to the DFSORT Messages and Codes manual, and only to help fora if the meaning of the message or error code remains unclear.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Error while copying VSAM file

Postby Robert Sample » Wed Mar 27, 2013 9:10 pm

For ICE076A, the L(156) is the feedback code. The manual has this to say about 156:
An invalid control interval was detected during keyed processing. The possible invalid conditions are:

A key is not greater than the previous key.
A key is not in the current control interval.
A spanned record RDF is encountered.
A freespace pointer is invalid.
The number of records does not match a group RDF record count.
If the file is not used by any other address space, then you may need to add an IDCAMS VERIFY step before your SORT step.

These users thanked the author Robert Sample for the post:
ashokkumar_rn (Thu Mar 28, 2013 2:11 pm)
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Error while copying VSAM file

Postby ashokkumar_rn » Thu Mar 28, 2013 3:17 pm

Thanks Robert. Just out of curiosity, if this VSAM file was being used by another address space like(CICS) then how can I prevent such failure?
ashokkumar_rn
 
Posts: 12
Joined: Wed Mar 27, 2013 7:59 pm
Has thanked: 8 times
Been thanked: 0 time

Re: Error while copying VSAM file

Postby Robert Sample » Thu Mar 28, 2013 4:36 pm

You cannot prevent all such failures -- if the problem is failing hardware, then the 156 feedback codes will continue (usually intermittently) until the disk drive fails completely.

However, the point about other address spaces (and CICS in particular) is that at least two of the five conditions listed in the manual message could occur if another address space is updating the VSAM file at the same time your program is reading it. If that were the case, there are two reasonably easy solutions and one difficult solution to choose from: (1) close the file in CICS (or whatever the other address space is) while your program is using the file, (2) use DISP=OLD for the VSAM file in your JCL so you have exclusive control when reading the data, or (3) (this is the hard one) implement enqueue / dequeue logic in both the other address space and your program to ensure the VSAM file retains integrity.

One thing that is relevant is the share options for the VSAM file since (1,3) is the only combination that causes VSAM to maintain integrity of the file. (2,3) places the responsibility upon your program to ensure read integrity (in other words, something could update the data while you are reading the file), while (3,3) and (4,3) basically require the third option I listed in the previous paragraph.

These users thanked the author Robert Sample for the post:
ashokkumar_rn (Thu Mar 28, 2013 6:12 pm)
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to VSAM/SMS

 


  • Related topics
    Replies
    Views
    Last post