REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS



Support for CICS/ESA, CICS/TS & Transaction Gateway, CICS Configuration Manager and CICS Performance Analyzer

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

Postby NicC » Fri Dec 23, 2011 8:30 pm

Caught me there, Guy! But it must be possible to save the data in the cursor to somewhere because, surely, other progs do it for 'scrolling'.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

Postby GuyC » Fri Dec 23, 2011 8:58 pm

Some use tdq or tsq (my cics knowledge is a bit rusty).
But inside DB2 AFAIK there is no way

Within DB2 it is a matter of specifying a restart criteria in your where-clause (as in my previous post)
I can explain it to you, but i can not understand it for you.
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

Postby gabbar » Sat Dec 24, 2011 10:57 am

@guyc
i understand that sql statement you put up, where do i move those ordered by values? to a queue and then implement the values in queue to display the value on my cics map.
am i right is that what you tell?
gabbar
 
Posts: 12
Joined: Fri Dec 23, 2011 11:49 am
Has thanked: 0 time
Been thanked: 0 time

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

Postby gabbar » Sat Dec 24, 2011 11:40 am

what i am planning to do is use @guyc 's statement in a cursor, move the values to a queue and then use it to display it in the cics map one by one.
is it ok ?
gabbar
 
Posts: 12
Joined: Fri Dec 23, 2011 11:49 am
Has thanked: 0 time
Been thanked: 0 time

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

Postby dick scherrer » Sun Dec 25, 2011 9:21 am

Hello,

If you do it correctly, yes, it would work.

Suggest you try it and post back to let us know if it worked for you or if there are questions/issues.

It better to try the code rather than asking if it would work.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

Postby gabbar » Mon Dec 26, 2011 5:27 pm

yes i implemented the idea. i am able to write the records required to the queue now :)

the problem is while reading the queue to display the records from the queue on to the map
it is not reading the first record , instead it is reading from the second record and the first record is read last
i am trying to solve this problem
any help would be good
thank you
gabbar
 
Posts: 12
Joined: Fri Dec 23, 2011 11:49 am
Has thanked: 0 time
Been thanked: 0 time

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

Postby dick scherrer » Tue Dec 27, 2011 11:30 am

Hello,

How did you confirm that the first record is actually in the queue?

From what you have posted, it sounds like there could be a missing record or there could be an "extra" read?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

Postby GuyC » Tue Dec 27, 2011 5:35 pm

I don't think you need a queue nor a cursor, just some fields in the communication area.
first time you would receive an issue-id and account-id=-1 (<= this is probably your problem with not displaying first account-id, it should be set to -1 or -9999, you probably have it set to 0 )
thus a simple select (see previous post) would receive info for issue-id and account > -1 this would be 0
the next time the same select would receive info for account > 0 , this would be 1
the next time the same select would receive info for account > 1 , this would be 2
...
I can explain it to you, but i can not understand it for you.
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

Postby gabbar » Wed Dec 28, 2011 9:49 am

i was using the cedf facility to see if it was getting written into the queue.

by the way i have done the program now and it works perfectly thanks for the help :)
gabbar
 
Posts: 12
Joined: Fri Dec 23, 2011 11:49 am
Has thanked: 0 time
Been thanked: 0 time

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

Postby gabbar » Wed Dec 28, 2011 9:55 am

@guyc yes that logic works perfectly , but what happened was my attributes had to be changed from one to many to many to many relationship. so it becomes difficult to implement that logic and i had to use cursors due to that reason exactly
thanks for giving the idea though :)

i used a cursor, i fetched the records required based on matching attributes, when a match occurs i move them into a group variable which i move into a queue after writing all the matches have been entered into the queue , i read the queue and send the values one by one to the map and aid key enter being pressed
gabbar
 
Posts: 12
Joined: Fri Dec 23, 2011 11:49 am
Has thanked: 0 time
Been thanked: 0 time

PreviousNext

Return to CICS

 


  • Related topics
    Replies
    Views
    Last post