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 

How to make key in dataset unique?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
ANDY
Beginner


Joined: 07 Feb 2004
Posts: 127
Topics: 67

PostPosted: Mon Jul 19, 2004 3:24 am    Post subject: How to make key in dataset unique? Reply with quote

I have a dataset and I want to make one of its vloume as key, how can I remove duplicate key?
_________________
cheers,
Andy
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Jul 19, 2004 4:06 am    Post subject: Reply with quote

Andy,

This is the weird requirement I ever heard.

1. What has the VOLUME got to do with key? what exactly is your requirement?


btw if you are not aware of volume parameter, then here is a small explanation of volume parameter.
Code:

The VOLUME parameter identifies the volume serial number of the volume on which a data set resides. You can use the VOLUME parameter to request a particular volume, volume retention for usage in a subsequent job step, or to name multiple volumes.       


2. A sequential dataset does not have a key. You can define keys in a vsam cluster

3.And regarding removal of duplicate key, you can find numerous examples of it in the utilities forum.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
NutCracker
Beginner


Joined: 13 Dec 2002
Posts: 45
Topics: 3
Location: 3rd Block from the SUN

PostPosted: Tue Jul 20, 2004 1:22 am    Post subject: Reply with quote

Quote:

<snip> have a dataset and I want to make one of its vloume as key <snip>


Is 'Volume' one of the columns contents in the dataset Question
Back to top
View user's profile Send private message
ANDY
Beginner


Joined: 07 Feb 2004
Posts: 127
Topics: 67

PostPosted: Tue Jul 20, 2004 5:26 am    Post subject: Reply with quote

what I mention here 'volume' is a field of table, sequential dataset does not have key. But if I need transfer its data to a VSAM file or DB2 table, I will treat it a key dataset.
_________________
cheers,
Andy
Back to top
View user's profile Send private message
vijay
Beginner


Joined: 09 May 2003
Posts: 131
Topics: 64

PostPosted: Tue Jul 20, 2004 7:56 am    Post subject: Reply with quote

1.sort the sequential file based on the key.
sort fields=(1,12,ch,a) --> 1 to 12 bytes is key
sum fields=none --> removes duplicates if any based on the key.
2.Use IDCAMS REPRO to copy the sorted file to the vsam.
Back to top
View user's profile Send private message
ANDY
Beginner


Joined: 07 Feb 2004
Posts: 127
Topics: 67

PostPosted: Sat Jul 24, 2004 6:10 am    Post subject: Reply with quote

Dear vijiay:

Thank you. It worked.
_________________
cheers,
Andy
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 -> Application Programming 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