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
 

 

Browse VSAM in CICS.

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

Active User


Joined: 24 May 2013
Posts: 129
Location: INDIA

PostPosted: Mon Sep 22, 2014 5:22 pm    Post subject: Browse VSAM in CICS.
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: 129
Location: INDIA

PostPosted: Mon Sep 22, 2014 5:39 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Mon Sep 22, 2014 11:37 pm    Post subject:
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: 129
Location: INDIA

PostPosted: Tue Sep 23, 2014 3:02 pm    Post subject:
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: 1715
Location: UK

PostPosted: Tue Sep 23, 2014 6:09 pm    Post subject: Reply to: Browse VSAM in CICS.
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: 1219
Location: Israel

PostPosted: Tue Sep 23, 2014 7:33 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Tue Sep 23, 2014 11:40 pm    Post subject:
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: 129
Location: INDIA

PostPosted: Fri Sep 26, 2014 3:41 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Fri Sep 26, 2014 8:01 pm    Post subject:
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: 129
Location: INDIA

PostPosted: Tue Sep 30, 2014 4:05 pm    Post subject: Reply to: Browse VSAM in CICS.
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Tue Sep 30, 2014 8:44 pm    Post subject:
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: 129
Location: INDIA

PostPosted: Wed Oct 01, 2014 12:09 pm    Post subject:
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    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 CICS START AND CANCEL blayek CICS 1 Wed Dec 07, 2016 3:27 am
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm


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