Page 2 of 3

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

PostPosted: Fri Dec 23, 2011 8:30 pm
by NicC
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'.

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

PostPosted: Fri Dec 23, 2011 8:58 pm
by GuyC
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)

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

PostPosted: Sat Dec 24, 2011 10:57 am
by gabbar
@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?

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

PostPosted: Sat Dec 24, 2011 11:40 am
by gabbar
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 ?

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

PostPosted: Sun Dec 25, 2011 9:21 am
by dick scherrer
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.

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

PostPosted: Mon Dec 26, 2011 5:27 pm
by gabbar
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

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

PostPosted: Tue Dec 27, 2011 11:30 am
by dick scherrer
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?

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

PostPosted: Tue Dec 27, 2011 5:35 pm
by GuyC
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
...

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

PostPosted: Wed Dec 28, 2011 9:49 am
by gabbar
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 :)

Re: REGARDING MULTIPLE RECORD READING FROM DB2 USING CICS

PostPosted: Wed Dec 28, 2011 9:55 am
by gabbar
@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