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

Sample JCL required for Alternate Key


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

New User


Joined: 11 May 2007
Posts: 20
Location: Canada

PostPosted: Tue Feb 10, 2009 8:54 am
Reply with quote

Hi,

I am coding a program with Alternate key KSDS file for first time. Can anyone provide me the sample JCL for it. My requirement is as follows.

1. Copy the flat file data into KSDS.
2. Use the KSDS file to run the program.

Note: The Key to fetch the data from this file containd duplicates. Hence I am making this as the alternate key.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Tue Feb 10, 2009 9:16 am
Reply with quote

Oh my Lord,
Have you looked at Creating alternate indexes in the guide and ALTERNATE RECORD KEY clause in the reference? icon_rolleyes.gif
Back to top
View user's profile Send private message
avina

New User


Joined: 04 Dec 2007
Posts: 16
Location: Kolkata

PostPosted: Mon Mar 09, 2009 6:19 pm
Reply with quote

You can use repro to do a simple copy from flat file to a KSDS cluster and then create a Key ( With alternate index defined with parameter NONUNIQUEKEY ). A simple suggestion will be to have the output file in a to remove the duplicate records ( having duplicate key ) with SORT and then REPRO to a VSAM file .

Else sort your flat file to remove the duplicates first then do a repro, as per your requirement.
Back to top
View user's profile Send private message
avina

New User


Joined: 04 Dec 2007
Posts: 16
Location: Kolkata

PostPosted: Mon Mar 09, 2009 6:24 pm
Reply with quote

see if this helps you

//DEFALTIX EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE AIX (NAME (SIMOTIME.DATA.ALTKSD1) -
RELATE (SIMOTIME.DATA.ALTKSD) -
RECORDSIZE (512 512) -
TRACKS (10 5) -
KEYS (12 68) -
UPGRADE)
Back to top
View user's profile Send private message
avina

New User


Joined: 04 Dec 2007
Posts: 16
Location: Kolkata

PostPosted: Mon Mar 09, 2009 6:25 pm
Reply with quote

also see this post

www.ibmmainframes.com/about29110.html
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Mar 09, 2009 6:29 pm
Reply with quote

Quote:
Note: The Key to fetch the data from this file containd duplicates. Hence I am making this as the alternate key.

Is this the base KSDS which may NOT contain duplicate keys - a completely different problem, or is this the AIX which is allowed to contain duplicate keys.
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 Help needed to assemble IMS sample co... ABENDS & Debugging 4
No new posts Add column to existing records using ... JCL & VSAM 2
This topic is locked: you cannot edit posts or make replies. Sample CICS Webservices Program CICS 1
No new posts Required Date Format in Include Sort ... DFSORT/ICETOOL 6
No new posts Issue in KWIKKEY utility while creat... JCL & VSAM 2
Search our Forums:

Back to Top