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

Copy QSAM to VSAM using IDCAMS: RECORD OUT OF SEQUENCE ERROR


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

New User


Joined: 19 Apr 2007
Posts: 39
Location: Chennai

PostPosted: Thu May 17, 2007 1:31 pm
Reply with quote

Hi all

I need to copy from a QSAM file to VSAM file. My data is given in the attachment. I get MAXCC=12 and the message log says
ACTION ERROR ON (file name)
RECORD OUT OF SEQUENCE - KEY FOLLOWS :
000000 F2F8F8F6 F2F9F9E2 F0

Can anyone tell me how to solve this

Cheers
Shri
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu May 17, 2007 3:08 pm
Reply with quote

You need to sort the data on the VSAM key before loading it into the file.
Back to top
View user's profile Send private message
Shrimathi Krishnan

New User


Joined: 19 Apr 2007
Posts: 39
Location: Chennai

PostPosted: Thu May 17, 2007 4:13 pm
Reply with quote

but my data is already in sorted order only sire...

eg

cusno billnum
2890 100
2899 201
2899 202
2899 203

can u please help me out??
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu May 17, 2007 4:16 pm
Reply with quote

What is the key position and length of the VSAm file, and did you sort your flat file on exactly the same position and length.

Please show us your VSAM cluster definition.

Is the cluster an extended facilities VSAM cluster.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu May 17, 2007 4:29 pm
Reply with quote

Shrimathi Krishnan wrote:
but my data is already in sorted order
Then how do you explain
Quote:
RECORD OUT OF SEQUENCE
icon_question.gif
Back to top
View user's profile Send private message
sandeep1dimri

New User


Joined: 30 Oct 2006
Posts: 76

PostPosted: Thu May 17, 2007 4:43 pm
Reply with quote

can you post the Cluster defination and QSAM file data upto the length of the key of cluster
Back to top
View user's profile Send private message
ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Thu May 17, 2007 5:07 pm
Reply with quote

Better option u can edit ur vsam file and put Hex on and find the Error record It may be duplicate key field or improper key.VSAM File we support for 12 error records after that it show abend.

Error record is give below

Code:


000000 F2F8F8F6 F2F9F9E2 F0
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu May 17, 2007 5:50 pm
Reply with quote

Quote:
Better option u can edit ur vsam file and put Hex on

BUT ........... only if you have a pay for product to allow VSAM edit from TSO.
Back to top
View user's profile Send private message
Shrimathi Krishnan

New User


Joined: 19 Apr 2007
Posts: 39
Location: Chennai

PostPosted: Thu May 17, 2007 6:04 pm
Reply with quote

HI

I sorted the sortin qsam file with the same keys and then tried to sort into vsam file. Got
008(08)
Explanation for this error is :
You attempted to store a record with a Duplicate Key, or there
is a duplicate record for an alternate index with the unique
key option.

The copy book structure is :

Cusnok3
Cusno
Cusnok1
sttnum
keydte
Cusnok2
ownerid

Am i clear??
So what shall i do now?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu May 17, 2007 6:10 pm
Reply with quote

Are you loading an empty cluster or adding records to an already populated cluster ?

If this is an empty cluster - please supply the information asked for below.

Well, I suppose I could once more ask you to post your cluster definition. Or at least ask that you tell me the key position and length.

Also your sort code will help too.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 18, 2007 12:38 am
Reply with quote

Hello,

Re-run your sort eliminating duplicates.
Back to top
View user's profile Send private message
Shrimathi Krishnan

New User


Joined: 19 Apr 2007
Posts: 39
Location: Chennai

PostPosted: Fri May 18, 2007 11:28 am
Reply with quote

//JS01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=XXXX.TYYY.IN1
// DISP=SHR
//SORTOUT DD DSN=XXXX.TYYY.OUT1,
// DISP=(,CATLG,DELETE),
// SPACE=(TRK,(1,1),RLSE),
// DCB=*.SORTIN
//XSUM DD DSN=XXXX.TYYY.OUT2
// DISP=(,CATLG,DELETE),
// SPACE=(TRK,(1,1),RLSE),
// DCB=*.SORTIN
//SYSIN DD *
SORT FIELDS=(9,19,CH,A,28,4,BI,A)
SUM FIELDS=NONE,XSUM


I EXECUTED THIS JCL.. IT GAVE ME JCL ERROR 16 AND THE XSUM FIEL WAS EMPTY
I tried to sort my qsam file with the same keys and then tried sorting it to
vsam file.... then i got 'VSAM LOGICAL ERROR 08 ON OUTPUT
'

Please suggest me some step...
Back to top
View user's profile Send private message
Shrimathi Krishnan

New User


Joined: 19 Apr 2007
Posts: 39
Location: Chennai

PostPosted: Fri May 18, 2007 11:31 am
Reply with quote

My copy book is
FIELD
--------- FIELD LEVEL/NAME ---------- -PICTURE- -NUMBER START END LENGTH
CUSNO01 1 66 66
3 CUSNOK3 GROUP 1 1 31 31
5 CUSNO X(7) 2 1 7 7
5 CUSNOTPE X 3 8 8 1
5 CUSNOK1 GROUP 4 9 31 23
7 STTNO X(19) 5 9 27 19
7 KEYDTE S9(9) 6 28 31 4
3 STTDTE S9(9) 7 32 35 4
3 ENDNO X(19) 8 36 54 19
3 STPDTE S9(9) 9 55 58 4
3 STPDTE-NO-END-FLAG REDEFINES STPDTE
3 STPDTE-NO-END-FLAG X(4) 10 55 58 4
3 PRDCMP XX 11 59 60 2
3 CUSNOK2 GROUP 12 61 64 4
5 OWNERID S9(9) 13 61 64 4
3 SECUREIND X 14 65 65 1
3 RATTPE X 15 66 66 1
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri May 18, 2007 12:02 pm
Reply with quote

Are you loading an empty cluster or adding records to an already populated cluster ?

If this is an empty cluster - please supply the information asked for below.

Well, I suppose I could once more ask you to post your cluster definition. Or at least ask that you tell me the key position and length.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri May 18, 2007 12:03 pm
Reply with quote

if You want advice on solving your problem You should post the requested information:
"THE VSAM CLUSTER IDCAMS DEFINE STATEMENT"

the records You posted appear to be in sequence, but the UNIQUE key is 4+3 bytes long;
if You used a 4 bytes vsam key then You are going to have duplicate records and hence the error .....

regards
Back to top
View user's profile Send private message
Shrimathi Krishnan

New User


Joined: 19 Apr 2007
Posts: 39
Location: Chennai

PostPosted: Fri May 18, 2007 1:30 pm
Reply with quote

Cluster definition
Data Component Information:
Device type: 3390
Organization: KSDS
KSDS key length: 23
KSDS key location: 8
Average record size: 66
Maximum record size: 66
Allocated Space: Unit Primary Secondary
Data: CYLINDERS 40 4
Index: TRACKS 15 15
Dataset Date Information:
Creation date: 2007/05/18
Expiration date:
Modification date: 2007/05/18
Modification time: 07:52 AM GMT
Current Allocations in Tracks:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current Allocations in Tracks: Current Utilization in Tracks:
Allocated space: 600 Used data space: 1 ( 0 %)
Allocated extents: 1 Used extents: 1 ( 100 %)
Allocation type: UNIQUE Prime records: 12
KSDS Index Allocation in Tracks: Deleted records: 0
Allocated space: 15 Inserted records: 0
Number of records: 1 Updated records: 0
- - - - - - - - - - - Current Reorganization Information - - - - - - - - - - -
Data - Control Area Information: Control Interval Information:
Physical record size: 18432 Size-data: 18432 Index: 1024
Records per track: 3 Number CIs/CA: 45
Tracks per CA: 15 Number free CIs/CA: 0
Retrieved records: 0 Percent free CIs/CA: 0
Max record number 0 Percent free bytes/CI: 0
Number CA splits: 0 Number CI splits: 0
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri May 18, 2007 2:25 pm
Reply with quote

What is the recfm of the input file?
Back to top
View user's profile Send private message
Shrimathi Krishnan

New User


Joined: 19 Apr 2007
Posts: 39
Location: Chennai

PostPosted: Fri May 18, 2007 2:29 pm
Reply with quote

My copy book is
FIELD
--------- FIELD LEVEL/NAME ---------- -PICTURE- -NUMBER START END LENGTH
CUSNO01 1 66 66
3 CUSNOK3 GROUP 1 1 31 31
5 CUSNO X(7) 2 1 7 7
5 CUSNOTPE X 3 8 8 1
5 CUSNOK1 GROUP 4 9 31 23
7 STTNO X(19) 5 9 27 19
7 KEYDTE S9(9) 6 28 31 4
3 STTDTE S9(9) 7 32 35 4
3 ENDNO X(19) 8 36 54 19
3 STPDTE S9(9) 9 55 58 4
3 STPDTE-NO-END-FLAG REDEFINES STPDTE
3 STPDTE-NO-END-FLAG X(4) 10 55 58 4
3 PRDCMP XX 11 59 60 2
3 CUSNOK2 GROUP 12 61 64 4
5 OWNERID S9(9) 13 61 64 4
3 SECUREIND X 14 65 65 1
3 RATTPE X 15 66 66 1
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri May 18, 2007 2:33 pm
Reply with quote

William Thompson wrote:
What is the recfm of the input file?
Variable or fixed?
Back to top
View user's profile Send private message
Shrimathi Krishnan

New User


Joined: 19 Apr 2007
Posts: 39
Location: Chennai

PostPosted: Fri May 18, 2007 3:11 pm
Reply with quote

fixed block sire.. recl=66
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri May 18, 2007 3:43 pm
Reply with quote

Quote:

KSDS key length: 23
KSDS key location: 8


This isn't LISTCAT - probably fileaid. Is the key location shown an offset or true position.

Also, back in the dark and distant past I recall when an extended facilities KSDS was defined the same problem ocurred, and was fixed by increasing the length of the VSAM definition by 4. Maybe worth trying with a 70 70 definition.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri May 18, 2007 3:48 pm
Reply with quote

Shrimathi Krishnan wrote:
fixed block sire.. recl=66
How can you prove this?

What was the sort message number that preceded this error:
RECORD OUT OF SEQUENCE - KEY FOLLOWS :
000000 F2F8F8F6 F2F9F9E2 F0
What does the above number represent, it is only nine bytes long?

What does the following represent:
cusno billnum
2890 100
2899 201
2899 202
2899 203
The above does not coincide to the VSAM key or the sorted fields of STTNO and KEYDTE?

SORT FIELDS=(9,19,CH,A,28,4,BI,A)

CUSNO01 1 66 66
3 CUSNOK3 GROUP
5 CUSNO X(7)
5 CUSNOTPE X
5 CUSNOK1 GROUP
7 STTNO X(19)
7 KEYDTE S9(9) comp

KSDS key length: 23
KSDS key location: 8
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 18, 2007 7:34 pm
Reply with quote

Hello,

Your sort fields do not look at all like your sample data icon_confused.gif
Back to top
View user's profile Send private message
Shrimathi Krishnan

New User


Joined: 19 Apr 2007
Posts: 39
Location: Chennai

PostPosted: Mon May 21, 2007 11:36 am
Reply with quote

Hi all

Thanks a lot for all ur time and suggestions. As suggested i checked again with the sort fields and also made a change in the VSAM cluster definition. I got the desired output..
Once again thanks a lot to all of you....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 22, 2007 3:13 am
Reply with quote

You're welcome icon_smile.gif
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 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 Error when install DB2 DB2 2
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top