Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Alternate Index Error !

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Kumaresan.nk

New User


Joined: 22 Mar 2010
Posts: 31
Location: Chennai

PostPosted: Wed Apr 21, 2010 11:35 am    Post subject: Alternate Index Error !
Reply with quote

Hi,

I'm trying to access a VSAM file using an Alternate Key. I have created an alternate index for that VSAM. But while giving the alternate key and compiling, I'm getting the following error -

"ALTERNATE RECORD KEY" "AIR-TAXID" had the same leftmost character position as that of the "RECORD KEY" for this file"

Can anyone please help me with this.

Here is the file description -

SELECT AIRTAXID-MAST ASSIGN TO ADDRMSTR
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS AIR-KEY
ALTERNATE RECORD KEY IS
AIR-TAXID WITH DUPLICATES
FILE STATUS IS AIR-TAXID-STATUS.

Here's the Primary Key description -

01 AIR-TAXID-RECORD.
05 AIR-KEY.
10 AIR-KEY-COMPANY PIC X(004).
10 AIR-KEY-TAXID PIC 9(009).

Here's the alternate key -

01 AIR-TAXID PIC 9(009).

Am just using the second half of the Primary Key as the alternate key to fetch data.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Apr 21, 2010 11:39 am    Post subject:
Reply with quote

It may help if you also post the two VSAM definitions, base cluster and AIX.
Back to top
View user's profile Send private message
Kumaresan.nk

New User


Joined: 22 Mar 2010
Posts: 31
Location: Chennai

PostPosted: Wed Apr 21, 2010 11:43 am    Post subject:
Reply with quote

Here's the Base Cluster definition -

DEFINE CLUSTER -
(NAME(USER.NONX.IRSCAEDD) -
RECORDSIZE(13 13) -
FREESPACE(20 20) -
BUFSPC(20480) -
CYL(200 100) -
SHAREOPTIONS(3 3) -
CISZ(4096) -
SPEED -
UNIQUE -
KEYS(13 0) -
VOLUME(TESTDA TESTDA TESTDA TESTDA TESTDA))
DATA (NAME(USER.NONX.IRSCAEDD.DATA)) -
INDEX (NAME(USER.NONX.IRSCAEDD.INDEX))


Here's the Alternate Index definition -

DEFINE ALTERNATEINDEX
(NAME(USER.NONX.IRSCAEDD.ALTNT)
RELATE(USER.NONX.IRSCAEDD)
KEYS(9 4)
REUSE
UPGRADE
CYLINDERS(200 100)
RECORDSIZE(13 53392)
SHAREOPTIONS(3 3)
VOLUMES(TESTDA TESTDA TESTDA TESTDA)
NONUNIQUEKEY
FREESPACE(25 25))
DATA (NAME(USER.NONX.IRSCAEDD.ALTNT.DATA)
CISZ(4096))
INDEX (NAME(USER.NONX.IRSCAEDD.ALTNT.INDEX)
CISZ(1024))
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Wed Apr 21, 2010 4:27 pm    Post subject:
Reply with quote

Code:
SELECT AIRTAXID-MAST ASSIGN TO ADDRMSTR
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS AIR-KEY
ALTERNATE RECORD KEY IS
AIR-KEY-TAXID WITH DUPLICATES
FILE STATUS IS AIR-TAXID-STATUS.
The alternate record key must start in the 5th byte of the 01 within the FD -- you have it starting in byte 1.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Apr 21, 2010 4:31 pm    Post subject:
Reply with quote

"ALTERNATE RECORD KEY" "AIR-TAXID" had the same leftmost character position as that of the "RECORD KEY" for this file"
Instead of:
01 AIR-TAXID PIC 9(009).
Try:
01 FILLER.
05 FILLER.
10 FILLER X(004).
10 AIR-TAXID PIC 9(009).
Back to top
View user's profile Send private message
Kumaresan.nk

New User


Joined: 22 Mar 2010
Posts: 31
Location: Chennai

PostPosted: Thu Apr 22, 2010 10:31 am    Post subject:
Reply with quote

Hi,

When i gave the description as said above the program worked. But i guess there is some pblm with my alternate index VSAM. I guess the data isn't been populated correctly. Below are the details -

VSAM Base Definition -

DEFINE CLUSTER -
(NAME(USER.NONX.IRSCAEDD) -
RECORDSIZE(13 13) -
FREESPACE(20 20) -
BUFSPC(20480) -
CYL(200 100) -
SHAREOPTIONS(3 3) -
CISZ(4096) -
SPEED -
UNIQUE -
KEYS(13 0) -
VOLUME(TESTDA TESTDA TESTDA TESTDA TESTDA))
DATA (NAME(USER.NONX.IRSCAEDD.DATA)) -
INDEX (NAME(USER.NONX.IRSCAEDD.INDEX))

Alternate Index Definition -

DEFINE ALTERNATEINDEX
(NAME(USER.NONX.IRSCAEDD.ALTNT)
RELATE(USER.NONX.IRSCAEDD)
KEYS(9 4)
REUSE
UPGRADE
CYLINDERS(200 100)
RECORDSIZE(13 53392)
SHAREOPTIONS(3 3)
VOLUMES(TESTDA TESTDA TESTDA TESTDA)
NONUNIQUEKEY
FREESPACE(25 25))
DATA (NAME(USER.NONX.IRSCAEDD.ALTNT.DATA)
CISZ(4096))
INDEX (NAME(USER.NONX.IRSCAEDD.ALTNT.INDEX)

Data In VSAM Base:

0000000000000
0200001343759
0200001385475
0200001400574
0200001488448
0200001562520
0200001763339
0200001804739
0200002121478
0200002321112
0200002328618
0200002340680
0200002361790
0200002364223
0200002380897

Data In VSAM Alternate Index:

0000000000000000000000
0012694912001001269491
0013014160365001301416
0013298242001001329824
0013437590200001343759
0013808440434001380844
0013854750200001385475
0014005740200001400574
0014404131800001440413
00148844802000014884481728001488448
0015462161820001546216
0015625200200001562520
0015675850365001567585
0016268712001001626871
0017633390200001763339


Can you tell me why this occurs like this, please !
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Thu Apr 22, 2010 5:23 pm    Post subject:
Reply with quote

You've got problems with your alternate index definition, for one. The alternate index key length is defined in the AMS for Catalogs manual as:
Quote:
RECSZ = 5 + AIXKL + (n x BCKL)
so 5 + 9 + 13 * ??? is what the alternate index key length should be (where ??? is the maximum number of duplicates of the primary key you expect to have). 27 would be the minimum.
Back to top
View user's profile Send private message
Kumaresan.nk

New User


Joined: 22 Mar 2010
Posts: 31
Location: Chennai

PostPosted: Fri Apr 23, 2010 1:55 pm    Post subject:
Reply with quote

Hi,

I gave the RECZ as - 5+9+(100*13) = 1314.

DEFINE ALTERNATEINDEX -
(NAME(USER.NONX.IRSCAEDD.ALTNT) -
RELATE(USER.NONX.IRSCAEDD) -
KEYS(9 4) -
REUSE -
UPGRADE -
CYLINDERS(200 100) -
RECORDSIZE(13 1314) -
SHAREOPTIONS(3 3) -
VOLUMES(TESTDA TESTDA TESTDA TESTDA) -
NONUNIQUEKEY -
FREESPACE(25 25)) -

But still am getting the data populated in the Alternate Index dataset as in the previous case -

0000000000000000000000
0012694912001001269491
0013014160365001301416
0013298242001001329824
0013437590200001343759
0013808440434001380844
0013854750200001385475
0014005740200001400574
0014404131800001440413
00148844802000014884481728001488448
0015462161820001546216
0015625200200001562520
0015675850365001567585
0016268712001001626871
0017633390200001763339

Don't know why the data appears like this !
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Fri Apr 23, 2010 2:01 pm    Post subject: Reply to: Alternate Index Error !
Reply with quote

reposting the same info will not lead anywhere
the AIX component has been populated properly
did You care to define also the PATH

anyway ... too much to be written to explain all the shebang of alternate indexes
see
http://www.simotime.com/cblalt01.htm
for a very clear explanation of the whole thing
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Fri Apr 23, 2010 4:27 pm    Post subject:
Reply with quote

Quote:
Don't know why the data appears like this !
Exactly how do you expect the data to appear? Based on what you've told us so far, the alternate index data looks precisely as I would expect it to look.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts FUSE - IBM MQ - CICS integration error Kevin Vaz CICS 1 Mon Sep 18, 2017 4:31 pm
No new posts Reply MQ open error Vignesh Sid COBOL Programming 6 Thu Sep 07, 2017 6:02 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us