VSAM fiel copy with different key lengths



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

VSAM fiel copy with different key lengths

Postby Nara_513 » Fri Apr 27, 2012 10:34 pm

Hi All,

My requiremtn is : I need to convert a VSAM file of key length 23 (which consists if two keys one 15 and one 8 ) to VSAM file of key length 15.

I copied teh Input VSAM to flat file an then created a new VSAM file say second with teh follwoing code:

DEFINE CLUSTER (NAME(SECOND.FILE.MINDEX)     -
                INDEXED                               -
                KEYS(15 1)                             -
                SPEED                                 -
                SHR(3 3)                              -
                VOL(SYSDA)                           -
                RECORDSIZE(74 74))                    -
       DATA    (NAME(SECOND.FILE.MINDEX.DATA) -
                CYL(796 198)                            -
                CISZ(4096))                           -
       INDEX   (NAME(SECOND.FILE.MINDEX.INDEX) -
                TRK(67 17)                              -
                CISZ(1024))


after that i used the reproduce command to copy the flat file contents to the VSAM file created...

I could see that teh follwoing are happening:

IDC3314I **RECORD OUT OF SEQUENCE - KEY FOLLOWS:
000000 F7F0F0F0 F0F0F240 40404040 4040F2

IDC31467I MAXIMUM ERROR LIMIT REACHED.
IDC0005I NUMBER OF RECORDS PROCESSED WAS 172886
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12


Also...i could see that key is not copying correctly :

Input file sample data:


----+----1----+----2----+----
*****************************
00941284       20081002065659
00941285       20081002070023
010109         00000000000000
01390480       19990321104002
01390481       19990321104326
01390484       19990321113952
01390485       19990321114045



But in ouput VSAm file: i could see that
----+----1----+----2----+---
****************************
0941284       20081002065659
0941285       20081002070023
10109         00000000000000
1390480       19990321104002
1390481       19990321104326
1390484       19990321113952
1390485       19990321114045
1390489       19990321114159
1692290       19990402164900



The zeroes that are present at the start of the key in flat file are not getting copied to the VSAM output file.

Am not sure why the records got copied till 172886 and stopped..

Can anyone let me know how i can copy the exact key and what is the exact issue is with the job abending after particular no of records copied to teh vsam file...?

Thanks in Advance
Nara_513
 
Posts: 44
Joined: Fri Dec 02, 2011 1:11 am
Has thanked: 0 time
Been thanked: 0 time

Re: VSAM fiel copy with different key lengths

Postby Akatsukami » Fri Apr 27, 2012 11:19 pm

Nara_513 wrote:IDC31467I MAXIMUM ERROR LIMIT REACHED.
IDC0005I NUMBER OF RECORDS PROCESSED WAS 172886
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12
Am not sure why the records got copied till 172886 and stopped..

Have your melamed explain to you the meaning of MAXIMUM ERROR LIMIT REACHED :evil:

As for the cause of those errors, show us the attributes -- the record format in particular -- of the unload data set.
"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: VSAM fiel copy with different key lengths

Postby Robert Sample » Fri Apr 27, 2012 11:45 pm

Have you investigated the possibility that the VSAM file has a key length of 23 because the 15-byte key is not unique? Anc since the primary key on a VSAM file must be unique ....
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: VSAM fiel copy with different key lengths

Postby Akatsukami » Sat Apr 28, 2012 12:08 am

Nara_513 wrote:
DEFINE CLUSTER (NAME(SECOND.FILE.MINDEX)     -
                INDEXED                               -
                KEYS(15 1)                             -
                SPEED                                 -
                SHR(3 3)                              -
                VOL(SYSDA)                           -
                RECORDSIZE(74 74))                    -
       DATA    (NAME(SECOND.FILE.MINDEX.DATA) -
                CYL(796 198)                            -
                CISZ(4096))                           -
       INDEX   (NAME(SECOND.FILE.MINDEX.INDEX) -
                TRK(67 17)                              -
                CISZ(1024))

The more I looked at these control cards, the more my suspicions were raised. I finally confirmed them by reading the fine manual (yes, even I need to do that on occasion). The second sub-parameter of KEYS is offset, not position. Positions begin at 1, offsets at 0. This is the cause of both your out-of-sequence errors and losing the first character of they key; change it to KEYS(15 0).
"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: VSAM fiel copy with different key lengths

Postby Nara_513 » Sat Apr 28, 2012 11:49 am

HI Akatsukani,

Hmm...I did tried first with the KEYS(15 0) ....but then also the same result...so i changed to KEYS(15 1) hoping it will work...

the record length of both the flat file and VSAM file are given correct...
Last edited by Nara_513 on Sat Apr 28, 2012 11:54 am, edited 1 time in total.
Nara_513
 
Posts: 44
Joined: Fri Dec 02, 2011 1:11 am
Has thanked: 0 time
Been thanked: 0 time

Re: VSAM fiel copy with different key lengths

Postby Nara_513 » Sat Apr 28, 2012 11:50 am

Robert Sample wrote:Have you investigated the possibility that the VSAM file has a key length of 23 because the 15-byte key is not unique? Anc since the primary key on a VSAM file must be unique ....



Robert the key of length 15 is unique ...i mean their are no duplicates... :D
Nara_513
 
Posts: 44
Joined: Fri Dec 02, 2011 1:11 am
Has thanked: 0 time
Been thanked: 0 time

Re: VSAM fiel copy with different key lengths

Postby BillyBoyo » Sat Apr 28, 2012 2:25 pm

I think you have to do it again with the ( 15 0 ).

What are you using to produce the screen output with the VSAM data on it? If it is "something" displaying the Key followed by the Data, then the byte accidently created in front of the key will probably get "lost" from the display.

Defining the key incorrectly will generate "out of sequence" messages as long as the first two bytes of the "key" are not unique across the file, as long as the rest of the key is not always ascending.

Actual Key Sequence
10111111
30000000


Incorrect Key, Out of Sequence
0111111b
0000000b
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: VSAM fiel copy with different key lengths

Postby Nara_513 » Sat Apr 28, 2012 11:52 pm

Hi All,

I got it...!!!

Some of the records in my input file are not in sorted order...so i did a sort with the keylength 15 and i tried to run the repro...it worked... :-)
Thanks to all who helped me in this... :-)
Nara_513
 
Posts: 44
Joined: Fri Dec 02, 2011 1:11 am
Has thanked: 0 time
Been thanked: 0 time

Re: VSAM fiel copy with different key lengths

Postby BillyBoyo » Sun Apr 29, 2012 2:57 am

I'm not so sure.

You have a KSDS with a 23 byte key, one component is 15 bytes, the other eight bytes.

You need to create a new KSDS with the same data, but this time a key of only 15 bytes, those same 15 bytes as the major part of the original key.

You copied the VSAM KSDS to a flat file.

You delete/define the new KSDS.

You then repro the flat file to the new KSDS.

You get a number of "out of sequence" messages and your repro stops.

This is what you described to us,

There is nothing anywhere in the above which will allow the data to get out of sequence.

The only way you can get the out-of-sequence messages from the repro is if, as the Honourable Akatsukami spotted, you get your key wrong,

Either something of the above is incorrect, or you now have a file which has misaligned data at best and is definitely not in the original order.

You sorted with a length of 15, what start position did you use? What did you use to copy the original KSDS to the flat file?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: VSAM fiel copy with different key lengths

Postby Nara_513 » Sun Apr 29, 2012 4:07 am

Hi ,

I am sure that i used the corret key of length 15
I used the normal sort step to copy the VSAM file to Flat file.

i did a sort with a duplicate removal step in extra:
//SYSIN  DD  *
 SORT FIELDS=(1,15,CH,A)
 SUM FIELDS=NONE

and reran the repro with the sorted out file

I have checked both the input sort file and the output file, both have the same no of records...
Nara_513
 
Posts: 44
Joined: Fri Dec 02, 2011 1:11 am
Has thanked: 0 time
Been thanked: 0 time

Next

Return to VSAM/SMS

 


  • Related topics
    Replies
    Views
    Last post