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

Is Comp field can be primary key in VSAM?


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

New User


Joined: 22 Nov 2006
Posts: 23
Location: Mumbai

PostPosted: Wed Feb 21, 2007 12:48 pm
Reply with quote

Hi,

I have a flat file and first four bytes occupies s9(9) comp. I would like to create one vsam file for the above file with first 4bytes as key.

I have sorted the flat file SORT FIELDS=(1,4,BI,A) , after that i have generated the cluster and tried to copy that flat file to Vsam and its giving Key out of sequence.

My Cluster def:

DEFINE CLUSTER -
(NAME (XXXXXXX.YYYYY.ZZZZ.VSAM1) -
CYLINDERS(50,50) -
CISZ (2048) -
FSPC (5,10) -
KEYS(4,0) -
RECORDSIZE(102,102) -
) -
DATA -
(NAME(XXXXXXX.YYYYY.ZZZZ.VSAM1.DATA)) -
INDEX -
(NAME(XXXXXXX.YYYYY.ZZZZ.VSAM1.INDEX) -
CISZ (3072) -
)


Please help me how to resolve this.

Thanks
-Narisimha
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Wed Feb 21, 2007 2:54 pm
Reply with quote

I think I know where the problem is, how are you loading the dataset when you get the key out of sequence?
Back to top
View user's profile Send private message
Narismha

New User


Joined: 22 Nov 2006
Posts: 23
Location: Mumbai

PostPosted: Wed Feb 21, 2007 3:01 pm
Reply with quote

Hi,

I am unable to create the VSAM file(loading the data set). That is what my problem is.

Let me explain my process:

Step1> Sort the flat file ( Rec len 102 and first 4 bytes are s9(9) comp)
SORT FIELDS=(1,4,BI,A) ?? is this correct???
Step2> Define cluster ( Please check the previous mail)
Step3> Repro from INDD(sorted flat file) to OUTDD(VSAM file)
This step is running with MAxcc=12 and it tells rec-out-of-seq.

Please let me know if you need more information.

Thanks
-Narisimha
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: Wed Feb 21, 2007 11:06 pm
Reply with quote

Hello,

Please try SORT FIELDS=(1,4,CH,A).
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 Feb 22, 2007 12:00 am
Reply with quote

I was thinking that too, but a BI is unsigned binary, wouldn't the sign bit act like an extra bit and instead of making negitive it would make even bigger?
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: Thu Feb 22, 2007 1:36 am
Reply with quote

The "pic" is s9(9) comp. A -1 in that field will be FFFFFFFF. It stores the complement rather than the numeric value with the high order bit turned on.

It would be good if we could see the "keys" at the point where the load fails, but i'd still try the CH instead of the BI.
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 Feb 22, 2007 2:00 am
Reply with quote

Thinking along those lines except the poster sorted and loaded without cobol.... icon_confused.gif
Back to top
View user's profile Send private message
punith007
Warnings : 1

New User


Joined: 16 May 2006
Posts: 11
Location: INDIA

PostPosted: Thu Feb 22, 2007 9:42 am
Reply with quote

Hi all,

Is that the above out-of-seq problem arises due to the fact that the flat file have duplicate entries ?

Narisimha, please check that you dont have duplicate entries in the proposed primary key in the flat file.


Generally out-of-seq arises due to
(1) file not sorted on key field
(2) duplicate entries in key field

Regds
Punith
Back to top
View user's profile Send private message
Narismha

New User


Joined: 22 Nov 2006
Posts: 23
Location: Mumbai

PostPosted: Mon Feb 26, 2007 1:53 pm
Reply with quote

Thanks for all your efforts.

Sorry for the mistake. it have duplicate entries. I have given "SUM fields = none" and its working fine.

Thanks and Regards
-Narisimha
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: Mon Feb 26, 2007 9:24 pm
Reply with quote

You're welcome.

Thank you for posting the resolution 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 Access to non cataloged VSAM file JCL & VSAM 18
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
Search our Forums:

Back to Top