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
 

 

how to implement code for this logic in DB2 cobol program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sureshbabu.jv

New User


Joined: 11 Apr 2006
Posts: 41
Location: Chennai

PostPosted: Fri May 05, 2006 1:49 pm    Post subject: how to implement code for this logic in DB2 cobol program
Reply with quote

I am using 2 cursors in this program ,each cursor will generate seperate report. How do i implement code for the below logic. Could you please tell me..................
Open the first output file.
Declare the cursors.
Open the first cursor, check the SQLCODE.
Get the first row.

Process until SQLCODE = 100
Process the row.
Write a record to the report.
Fetch the next row.

Close the first cursor.
Close the first output file.

Open the second cursor.
Open the second output file.
Get the first row.

Process until SQLCODE = 100
Process the row
Write a record to the report.
Fetch the next row.

Close the second cursor
Close the second output file.


Thanks,
Suresh
Back to top
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Fri May 05, 2006 8:37 pm    Post subject: Re: how to implement code for this logic in DB2 cobol progra
Reply with quote

Suresh,

I'm not sure exactly what you?re asking for, the Pseudo code you have looks reasonable for a start. Refine it and come back

Dave
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Sat May 06, 2006 1:14 am    Post subject: Re: how to implement code for this logic in DB2 cobol progra
Reply with quote

Hello

1) open u r i/p an o/p files.
2)declares u r cursors
3) fetch rows till sql code =100
if sql code = 0 fetch data into host variables
based on the data fetched do any manipulatios u require and move the variables to u r o/p(report fields).This where u r requirements should be coded to obtain the desired report.
4) close u r files
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


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