IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Fetching and computing para until sql code=100


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 3156
Location: Tucson AZ

PostPosted: Fri Feb 08, 2008 9:41 pm
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
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: 2146
Location: At my coffee table

PostPosted: Sat Feb 09, 2008 2:17 am
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
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: 3156
Location: Tucson AZ

PostPosted: Sat Feb 09, 2008 10:12 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
This topic is locked: you cannot edit posts or make replies. Programa para Realiza Operaciones sob... JCL & VSAM 3
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top