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
 

 

Fetching and computing para until sql code=100

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
nadeemahmed
Currently Banned

New User


Joined: 17 Jan 2008
Posts: 5
Location: Chennai

PostPosted: Fri Feb 08, 2008 9:24 pm    Post subject: Fetching and computing para until sql code=100
Reply with quote

Hi frnz..
Iam workin on a CICS+COBOL+DB2 program...
Iam designing an online examination system..
So my requirement is i have to fetch the questions from a table and display in a map and once user gives the answer at tat moments it has to be evaluated and computed at the background and then the next question must be displayed to him waiting for his option..
In this process iam successful in first instant but the program doesn fetch and display the second ques though i have used cursors..iam looping this fetching and computing para until sql code=100 in a perform..Require your inputs and help on how it could be done..
Thanks in Advance..
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Feb 08, 2008 9:41 pm    Post subject:
Reply with quote

?
Code:
Fetch first row
Send first screen
Perform until 100
 Fetch next row
  If not 100
   Read current screen
   Send next screen
   Evaluate current answer
  End if
End perform
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sat Feb 09, 2008 12:52 am    Post subject:
Reply with quote

NOTE: This is conversational cics programming that is not allowed at many sites. It also is incorrect in that the last answer would never be processed.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sat Feb 09, 2008 2:17 am    Post subject: Re: Fetching and computing para until sql code=100
Reply with quote

Craq Giegerich wrote:
NOTE: This is conversational cics programming that is not allowed at many sites.
Your point?
nadeemahmed wrote:
..iam looping this fetching and computing para until sql code=100 in a perform..

Quote:
It also is incorrect in that the last answer would never be processed.
BFD, he didn't define or open the cursor, initialize storage, or include the GOBACK either.....
Back to top
View user's profile Send private message
nadeemahmed
Currently Banned

New User


Joined: 17 Jan 2008
Posts: 5
Location: Chennai

PostPosted: Sat Feb 09, 2008 9:54 pm    Post subject:
Reply with quote

Thanks alot for all ya quick response..i was successful in displayin the questions one by one from the table by fetching..i have 4 modules of ques papers like J001,C001,D001,I001 each having 5 ques each..the user will choose one of the modules to write the test..this info is stored in a registration table..i have to fetch this module for which the user has registered from the registration table and then correspondingly i have to fetch the questions from the question table..the challenge iam facing is tat the cursor fetches the rows one aftr the other and displays all q.papers..so iam stuck as to how i could initially point ma cursor to the row in q.paper table which has the module for which user has registered and from there i have to loop it 5 times..
In simple words i have to initially point ma cursor dynamically to tat row of the table which has been seleceted by the user and from there i have to fetch 5 ques..I know tat i could achieve this by using scrollable cursors but the prob is i have NO ACCESS FOR THAT..so guys plz suggest me as to wat r the possible ways..
Thank u guys again for all ya inputs.. icon_sad.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Sat Feb 09, 2008 10:12 pm    Post subject:
Reply with quote

nadeemahmed wrote:
I know tat i could achieve this by using scrollable cursors but the prob is i have NO ACCESS FOR THAT..
A very big ?
What is the restriction on a cursor that you have no access?
Back to top
View user's profile Send private message
nadeemahmed
Currently Banned

New User


Joined: 17 Jan 2008
Posts: 5
Location: Chennai

PostPosted: Mon Feb 11, 2008 10:02 am    Post subject: @ William
Reply with quote

Iam a beginner so they havent given access to tat..i too dunno the reson y..thatsy am finding alternatives for tat!!!
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts CA Workload Automation event code help vinu78 CA Products 10 Wed Mar 01, 2017 10:05 am
No new posts MAX-RC 88 and Return code 606 in DFH0... lind sh CICS 2 Tue Jan 24, 2017 1:23 pm
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 2 Thu Jan 12, 2017 12:02 pm


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