MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Alternate index and dupkey

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware
View previous topic :: View next topic  
Author Message
fab01
Beginner


Joined: 28 Feb 2005
Posts: 4
Topics: 2

PostPosted: Mon Feb 28, 2005 4:03 am    Post subject: Alternate index and dupkey Reply with quote

Hi everybody !
here's a JCL for creating an aix with nonunique keys
Code:

DEFINE AIX ( NAME(CHTA.CVP.MJNL.AIX.P1)         -   
             RELATE(CHTA.CVP.MJNL)              -   
             KEYS(06 69)                        -   
             TRACKS(1 1)                        -   
             SHAREOPTIONS(2 3)                  -   
             NONUNIQUEKEY                       -   
             UPGRADE                            -   
           )                                    -   
       DATA ( NAME(CHTA.CVP.MJNL.AIX.P1.DATA)   -   
              CONTROLINTERVALSIZE(4096)            -
              FREESPACE(10 1)                      -
            )                                      -
       INDEX ( NAME(CHTA.CVP.MJNL.AIX.P1.INDEX)    -
              CONTROLINTERVALSIZE(2048)            -
             )                                       
                                                     
BLDINDEX INDATASET(CHTA.CVP.MJNL)                  -
         OUTDATASET(CHTA.CVP.MJNL.AIX.P1)          -
         EXTERNALSORT WORKFILES(WORKAIX1 WORKAIX2)   
                                                     
DEFINE   PATH(NAME(CHTA.CVP.MJNL.PATH.P1)          -
         PATHENTRY(CHTA.CVP.MJNL.AIX.P1) )           

This AIX is attached to cics file which name is MJXB
It seems t work well because the retrun code is = zero when i 'sub' the jcl
But i have got problem when usign this file
When i start browse and read next MJXB, i ve got DUPKEY
I don't understand why i ve got dupkey because the AIX is declared as NONUNIQUE key.
The DUPKEY error is:
an error or is a warning ?
The DUPKEY error is always on all AIX files with non unique keys ?
Could you help me ?
Thanks by advance.
Sorry for my frenchie english Embarassed
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Feb 28, 2005 8:45 am    Post subject: Reply with quote

fab01,

I guess you are confused with the term NONUNIQUEKEY

NONUNIQUEKEY specifies that the alternate key value might be the same for two or more data records in the base cluster.

Now when you did a READNEXT, you got a Dupkey error as a record is retrieved by way of an alternate index with the NONUNIQUEKEY attribute, and another alternate index record with the same key follows

Hope this helps...

Cheers

Kolusu

PS: This topic should be in the CICS forum rather than a DB2 forum. I am moving the topic to CICS forum.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fab01
Beginner


Joined: 28 Feb 2005
Posts: 4
Topics: 2

PostPosted: Mon Feb 28, 2005 9:47 am    Post subject: Reply with quote

Thanks a lot.
I'm agree with you tha NONUNIQUEKEY specifies that the alternate key value might be the same for two or more data records in the base cluster.
So finally, it is normal that i ve got DUPKEY. ?
Back to top
View user's profile Send private message
gharisankar
Beginner


Joined: 10 Jul 2004
Posts: 19
Topics: 3
Location: C/O Platform - Mainframe

PostPosted: Mon Mar 07, 2005 8:19 pm    Post subject: Reply with quote

Yes, This is Normal If your VSAM has NONUNIQUEKEYS. If you want to nullify the error, you have to HANDLE the DUPKEY condition.
Evaluate the EIBRESP after READNEXT, the NORMAL and DUPKEY validations should be same. please correct me if I am wrong.
_________________
Regards
Hari Smile
Back to top
View user's profile Send private message
suma
Beginner


Joined: 23 Jan 2006
Posts: 65
Topics: 29

PostPosted: Wed Apr 15, 2009 8:10 am    Post subject: Reply with quote

does anyone worked on browsing a file using alternate key? and handled DUPKEY condition?
Please let me know ..how can we browse using alternate key when there is NONUNIQUEKEYS in the vsam file defination?


thanks
Suma
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group