Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Is Comp field can be primary key in VSAM?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Is Comp field can be primary key in VSAM?
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: 3158
Location: Tucson AZ

PostPosted: Wed Feb 21, 2007 2:54 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Feb 21, 2007 11:06 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Feb 22, 2007 12:00 am    Post subject:
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

Site Director


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

PostPosted: Thu Feb 22, 2007 1:36 am    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Feb 22, 2007 2:00 am    Post subject:
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    Post subject: Re: Is Comp field can be primary key in VSAM?
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    Post subject:
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

Site Director


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

PostPosted: Mon Feb 26, 2007 9:24 pm    Post subject:
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    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 READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts VSAM Space Allocation mrgnndhmk JCL & VSAM 7 Sat Apr 22, 2017 12:42 am
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us