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

Browse VSAM in CICS.


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Mon Sep 22, 2014 5:22 pm
Reply with quote

Hi All,

I have to read a VSAM KSDS for some characters , they are part of the key and may exist more than once .. Below is the example of the part of the key.

BOAWHABCDEFGHIJ1234567890(Type H Record)
BOAWDABCDEFGHIJ0987654321(Type D Record)
BOAWDABCDEFGHIJ7635775643(Type D Record)
BOAWDABCDEFGHIJ8723462222(Type D Record)
BOAWDABCDEFGHIJ0987857685(Type D Record)

I have to find the H record and then look for all the D records following the criteria of my search


My search will be based on first 15 bytes of the record that is a partial key as the key is 54 byte long starting form 1st position.

I have tried several ways like Random read first for H record and then STARTBR on First D record and Read-Next there after but I am having different issues in each cases..

I just wanted to have an idea whether I am doing it in right way .. I am doing it like below

Random read on H record --> STARTBR ON first D record --> Loop till the last D record matching the first 15 characters.

Please assist. Thanks

Regards
Sumit Chaturvedi
Back to top
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Mon Sep 22, 2014 5:39 pm
Reply with quote

The Type of the record is on position 5 highlighted in Black below


BOAWHABCDEFGHIJ1234567890(Type H Record)
BOAWDABCDEFGHIJ0987654321(Type D Record)
BOAWDABCDEFGHIJ7635775643(Type D Record)
BOAWDABCDEFGHIJ8723462222(Type D Record)
BOAWDABCDEFGHIJ0987857685(Type D Record)
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Mon Sep 22, 2014 11:37 pm
Reply with quote

Sumit, Have you thought of creating alternate index (AIX) on 'H' type of record search?
Back to top
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Tue Sep 23, 2014 3:02 pm
Reply with quote

HI Rohit, Thanks for your response

I did not think about it and I guess we will need so many approvals for that icon_smile.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Sep 23, 2014 6:09 pm
Reply with quote

You do not exactly say HOW it does not work! I know that for partial keys, you did mention that?, the first read positions the pointer BEFORE the first record that matcheds that key. The next read gets that first record (the H record here) and subsequent reads will get the D records.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Sep 23, 2014 7:33 pm
Reply with quote

thesumitk wrote:
The Type of the record is on position 5 highlighted in Black below
BOAWHABCDEFGHIJ1234567890(Type H Record)
BOAWDABCDEFGHIJ0987654321(Type D Record)
BOAWDABCDEFGHIJ7635775643(Type D Record)
BOAWDABCDEFGHIJ8723462222(Type D Record)
BOAWDABCDEFGHIJ0987857685(Type D Record)


In the file, the records are in this order:
BOAWDABCDEFGHIJ0987654321(Type D Record)
BOAWDABCDEFGHIJ0987857685(Type D Record)
BOAWDABCDEFGHIJ7635775643(Type D Record)
BOAWDABCDEFGHIJ8723462222(Type D Record)
BOAWHABCDEFGHIJ1234567890(Type H Record)

thesumitk wrote:
I am having different issues in each cases
Which kind of issues ?

Maybe you can STARTBR then READNEXT to get the H record, then a loop of READPREV to get the D records ?
I haven't worked with VSAM for a long time, you'll have to try and tell if it's feasible.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Tue Sep 23, 2014 11:40 pm
Reply with quote

I was revisiting what you said so far,
Quote:
My search will be based on first 15 bytes of the record that is a partial key as the key is 54 byte long starting form 1st position.

I have tried several ways like Random read first for H record and then STARTBR on First D record and Read-Next there after but I am having different issues in each cases..


Please list down the DIFFERENT issues? I believe you would be having 'BOAWHABCDEFGHIJ' value in your hand to make a partial search. So as Nic and Marso suggested if you READNEXT till you find 'BOAWHABC?EFGHIJ' (?) something different than 'D' then you should get the correct data. Hope you are using the correct syntax and length while you do a read. Please show us the code which does this.
Back to top
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Fri Sep 26, 2014 3:41 pm
Reply with quote

Thanks All for your response ,help and your valuable time..

I am trying something else that's why delay in my response.. Please bear with me .. I will giving all the input soon.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Fri Sep 26, 2014 8:01 pm
Reply with quote

Sumit, No rush. All the best.
Back to top
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Tue Sep 30, 2014 4:05 pm
Reply with quote

Thanks Again to All, for you valuable response !!

I have done it in below way

STARTBR on H Record then ENDBR and STARTBR Again on D record and loop til lthe last matched record and ENDBR.

It is working fine now ..

We have a common I/O routine in our application which is used by almost al lthe online programs to access the online files there is some conditions in that program for the file which I want to access which makes it not working.

So I written my own start and read commands in the program instead oaf accessing that routine and it is working fine now.

Thanks a Lot again for the help.. I need one more suggestions/help

When My process is completed then I am sending a message to the screen in the message area to notify that process was successful but the data which was entered by user is still on that screen .. I want that data to be clear and display my message only do we have an option ion send command for it .. Please let me know .. Thanks

regards
Sumit
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Tue Sep 30, 2014 8:44 pm
Reply with quote

Initialize all 'O' variables of the Map and then just populate only the message field(O) and send it.

If above is not what you want then look for "cics send text".
Back to top
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Wed Oct 01, 2014 12:09 pm
Reply with quote

Thank you so Much Rohit !!

This is what I wanted and it worked fine ..Thanks
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 HILITE on Browse mode? TSO/ISPF 2
No new posts Using API Gateway from CICS program CICS 0
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
Search our Forums:

Back to Top