How to generate a report.

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
amolpawar
Member
Posts: 25
Joined: Mon Jun 29, 2009 2:52 pm

How to generate a report.

Post by amolpawar » Tue Aug 03, 2010 2:01 pm

HI,

Using a cobol program i am updating some tables, I want to create a report which contains the changes made.

Please help me.


Thanks.
Amol Pawar

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Post by Natarajan » Tue Aug 03, 2010 3:22 pm

Please let us know, what exact help you required.

I assume, your question, shold go to DB2 Forum.
Natarajan
Chennai

amolpawar
Member
Posts: 25
Joined: Mon Jun 29, 2009 2:52 pm

Post by amolpawar » Tue Aug 03, 2010 3:53 pm

I am having one cobol program which executes some queries ( values hardcoded)
after execution and table updation I want to create a report which contains the query details and what all are the changes that made by query.

Please help me,

Thanks,
Amol Pawar

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Wed Aug 04, 2010 3:28 pm

May be writing the details from table to file1 before update and to file2 after update will give you enough information later to create a report.
Regards,
Anuj

amolpawar
Member
Posts: 25
Joined: Mon Jun 29, 2009 2:52 pm

Post by amolpawar » Thu Aug 05, 2010 1:54 pm

HI,

I am having a cobol program in which one table gets updated.

Query

UPDATE ABC
SET
APP_CDE = '200',
ROW_TM = '%TIMESTAMP%'
UID = '%USER_ID%',
WHERE
BUS_CDE = 200;

This program runs daily with different update queries I want to create a report on the basis of this query.

How to get all the details, what is updated in the table.


Thanks,
Amol

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Post by Natarajan » Thu Aug 05, 2010 7:51 pm

if you have only this query.. then it is clear that rows updated where BUS_CDE = 200.. you can write the same in the report.

if you want to write what is the previous state of data base , before updation.. then first use select based on BUS_CDE = 200.. write it to o/p.

do update...

select the records again with BUS_CDE = 200 .. write it to 0/p.

value 200, may change based on input...
Natarajan
Chennai

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Post by Natarajan » Thu Aug 05, 2010 7:55 pm

If you have latest version of DB2.. you can write one query.. contains.. select... and update.. in this statement.. update will happen to database.. and it will select all updated records.
Natarajan
Chennai

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Thu Aug 05, 2010 8:35 pm

How to get all the details, what is updated in the table.
what you mean to say is:
how to obtain the before data.

as Natarajan has suggested,
use an update cursor,
FETCH (to obtain before values) - output your details
update current
loop to fetch
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others