MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cursor in cobol

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
sateesh_gontla
Beginner


Joined: 23 Jan 2004
Posts: 40
Topics: 16
Location: Bangalore

PostPosted: Wed Aug 08, 2007 12:39 pm    Post subject: Cursor in cobol Reply with quote

I have the following requirement :

DB2 Table : Region_tab

Fields :
--------
Region
Member
Sel_opt
Score

If the input is given as From Region as :10 & To Region as :20

In the cobol program we need to do this using CURSORS:

Select all the members of Region 10 where Sel_opt = 'Y' and update the same member in Region 20 with score if that member exists in Region 20.


The 2nd requirement :

Fields in Table :

Region
Div
Member
Score
Limit

If any members score = Limit then make the score = 0 by Div wise and By Region wise. basically we need to read under a Region all the Division and under each Division all the members.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Aug 08, 2007 1:14 pm    Post subject: Reply with quote

sateesh_gontla,

what exactly do u want us to do here?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sateesh_gontla
Beginner


Joined: 23 Jan 2004
Posts: 40
Topics: 16
Location: Bangalore

PostPosted: Wed Aug 08, 2007 1:24 pm    Post subject: Reply with quote

will you able to help getting the sql's ?
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
sateesh_gontla
Beginner


Joined: 23 Jan 2004
Posts: 40
Topics: 16
Location: Bangalore

PostPosted: Wed Aug 08, 2007 5:53 pm    Post subject: Reply with quote

Any HELP !!!!
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Aug 09, 2007 8:00 am    Post subject: Reply with quote

sateesh_gontla,

Do NOT demand a solution. angry We are just helping in our part time. Just because you posted a question that does NOT mean that we drop everything and spoon feed you. We have a job of our own.

1.Solution for rqmt # 1

Cursor definition

Code:

SELECT MEMBER
      ,SCORE
 FROM TABLE
WHERE REGION  = 10
  AND SEL_OPT = 'Y'


Code:

1.open cursor
2.fetch cursor
3.perform update

repeat steps 2 & 3 till the end of cursor


Code:

UPDATE TABLE
   SET SCORE   = :WS-SCORE-FETCHED-FROM-CURSOR
 WHERE MEMBER  = :WS-MEMBER-FETCHED-FROM-CURSOR
 
 EVALUATE SQLCODE
     WHEN +0
     WHEN +100
          CONTINUE
     WHEN OTHER
          PERFORM ABEND
 END-EVALUATE     


2.Solution for rqmt # 2.
Code:

  UPDATE TABLE
     SET SCORE = 0
   WHERE SCORE = LIMIT
 


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sateesh_gontla
Beginner


Joined: 23 Jan 2004
Posts: 40
Topics: 16
Location: Bangalore

PostPosted: Thu Aug 09, 2007 9:02 am    Post subject: Reply with quote

Mr.Kolusu,

I never demand any thing, I said "will you able to help" , hope you understand (my) english... if you are willing or don't have time no one here asked/demand anything .....

It's only Request.... Also the solution that you gave me was not correct, please look at my requirements, it is a self join....However thank for your kind help !!!!!
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Aug 09, 2007 9:15 am    Post subject: Reply with quote

Quote:

I never demand any thing, I said "will you able to help" , hope you understand (my) english... if you are willing or don't have time no one here asked/demand anything .....

sateesh_gontla,

Well Now I need an english lesson from you. bonk bonk

Why are you bumping the thread ? Isn't it like demanding?
Quote:

Also the solution that you gave me was not correct, please look at my requirements, it is a self join....However thank for your kind help !!!!!


what is a self join? And I may be wrong but that is what I deciphered from your detailed requirement description

Either way you are free to seek solutions from other board

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Thu Aug 09, 2007 9:31 am    Post subject: Reply with quote

"Also the solution that you gave me was not correct, please look at my requirements,..."
What have you tried so far?
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Aug 09, 2007 9:10 pm    Post subject: Reply with quote

sateesh_gontla,

I just happened to look at your previous posts and it seems you always have an attitude. angry you never post feed back or provide detailed information on requirements for the people who are trying to help you.

ex: this topic

http://www.mvsforums.com/helpboards/viewtopic.php?t=8254

Here are all the topics you started and see how many of them you provided a feed back or got back to provide details

http://www.mvsforums.com/helpboards/search.php?search_id=usertopics&user=1197

Honestly you don't even deserve an answer on this board.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
aquarian
Beginner


Joined: 28 Sep 2005
Posts: 66
Topics: 17
Location: Mars

PostPosted: Mon Aug 13, 2007 4:51 am    Post subject: Reply with quote

Seems some serious issue here Smile
_________________
cheers,
Aquarian
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
sateesh_gontla
Beginner


Joined: 23 Jan 2004
Posts: 40
Topics: 16
Location: Bangalore

PostPosted: Tue Aug 21, 2007 9:14 am    Post subject: Reply with quote

Hi Kolusu,

Please remove all my posts here and Thanks for all your support. I will not disturb you any more !!!

PLEASE REMOVE MY POSTS. Thanks for your help.\
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue Aug 21, 2007 9:45 am    Post subject: Reply with quote

Quote:

Please remove all my posts here and Thanks for all your support. I will not disturb you any more !!!

PLEASE REMOVE MY POSTS. Thanks for your help

sateesh_gontla,

The post canNOT be removed as some of the posts have solutions.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Aug 21, 2007 10:09 am    Post subject: Reply with quote

Many years ago, I received a card which said: 'you are not completely useless, you do serve as a good 'Bad example'. I have found someone to whom I can pass this card!
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group