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

Search a KSDS file using EXEC CICS READ


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
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
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
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
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: 6966
Location: porcelain throne

PostPosted: Wed Nov 15, 2006 5:10 pm
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
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: 6966
Location: porcelain throne

PostPosted: Thu Nov 16, 2006 7:25 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Using API Gateway from CICS program CICS 0
Search our Forums:

Back to Top