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
 

 

Search a KSDS file using EXEC CICS READ

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
nabarun

New User


Joined: 27 Apr 2005
Posts: 13
Location: india

PostPosted: Wed Nov 15, 2006 1:55 pm    Post subject: Search a KSDS file using EXEC CICS READ
Reply with quote

i want to sreach a KSDS file using EXEC CICS READ
the keys are like this:
aa500
ba500
ca501
da500
...................
i hv to search the records ending with 00 in the keyfield.

how can i do this?
Back to top
View user's profile Send private message

ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Wed Nov 15, 2006 2:48 pm    Post subject:
Reply with quote

READ
DATASET (file name)
INTO (data area)
RIDFLD (record key area)
GENERIC
KEYLENGTH (data value)

you can use generic option for partial key but i dont think you can use it for last bytes of the key ..... keylength in the above read specifies how many bytes of the key shud match starting from left ...... i dont knw abt any option to match the last few bytes of the key ......
Back to top
View user's profile Send private message
nabarun

New User


Joined: 27 Apr 2005
Posts: 13
Location: india

PostPosted: Wed Nov 15, 2006 3:47 pm    Post subject:
Reply with quote

that thing i know but i want to search by using the last two bytes. how i can do so???
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Nov 15, 2006 5:10 pm    Post subject: Re: solve my query
Reply with quote

if the file is not toooooo big: SORT and keep only those with '00' in last part of key.

if you must read thru cobol, as the other poster says, you can't define a key for a read as %00, you have to read everything and only process those that fit the pattern (a COBOL compare - IF assend-of-the-key = '00'


a little reading of the manual would have helped you.

by the way, really lousy title for a question.
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Thu Nov 16, 2006 5:28 pm    Post subject:
Reply with quote

the file being a ksds u cannot sort the file based on some chars on the key .... in vsam the entry is made according to ascending values of the key and is already sorted ......
in this case read the file chk for the key and if the key matches ur criteria search the record or else do a read next ....
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Nov 16, 2006 7:25 pm    Post subject: Re: Search a KSDS file using EXEC CICS READ
Reply with quote

ashmir,

1. you can sort a VSAM KSDS file, just declare it as the input.
2. since you can input a VSAM KSDS file to sort, use an include parm to only keep those with the '00' in the proper location.
3. output of sort will be those records which poster needs.
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm


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