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
 

 

Random search in file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
dipanshu

New User


Joined: 16 Jan 2006
Posts: 53
Location: pune

PostPosted: Sat Apr 22, 2006 12:35 pm    Post subject: Random search in file
Reply with quote

Hi All,

Can we search a file in random mode on the basis of Partial key.

Say the key length in Vsam file is of 40
and I only want to search for the last 10 characters of the key

ie move '0123456789' to key(31:10)
read <file1>

It it possible

Thanks,
Dipanshu
Back to top
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Sun Apr 23, 2006 6:38 am    Post subject: Re: Random search in file
Reply with quote

Dipanshu.

I believe the only way to do that is to define a secondary key for that location.

Dave
Back to top
View user's profile Send private message
shivani_tech
Warnings : 2

New User


Joined: 08 Jan 2006
Posts: 22
Location: UNITED KINGDOM

PostPosted: Sun Apr 23, 2006 1:31 pm    Post subject:
Reply with quote

ya only with the help of alternate key...........we can solve out this.
Back to top
View user's profile Send private message
dipanshu

New User


Joined: 16 Jan 2006
Posts: 53
Location: pune

PostPosted: Mon Apr 24, 2006 9:15 am    Post subject: Re: Random search in file
Reply with quote

Hi shivani,

Many thanks 4 reply,

Could u or anyone please elaborate the above reply.

Thanks Dipanshu
Back to top
View user's profile Send private message
sreenivas_kommana

New User


Joined: 11 Apr 2006
Posts: 1

PostPosted: Tue Apr 25, 2006 5:23 pm    Post subject: alternate key on vsam file
Reply with quote

alternate key on vsam is Alternate Index.
Define AIX on your VSAM file. Find below the format:

EXAMPLE.AIX - your alternate index
EXAMPLE.KSDS2 - your base VSAM file

//DEFAIX1 JOB ...
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
DEFINE ALTERNATEINDEX -
(NAME(EXAMPLE.AIX) -
RELATE(EXAMPLE.KSDS2) -
MASTERPW(AIXMRPW) -
UPDATEPW(AIXUPPW) -
KEYS(3 0) -
RECORDSIZE(40 50) -
VOLUMES(VSER01) -
CYLINDERS(3 1) -
NONUNIQUEKEY -
UPGRADE) -
CATALOG(USERRCAT/USERUPPW)
/*

NOTE: You can refer the below link for more help.
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dgt1v403/CCONTENTS

-kommana
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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