Posted: Wed Mar 02, 2005 7:24 am Post subject: Report Printing
Hi,
Is it possible to produce formated reports with JCL using any of the utilities:
I need to do a read on DB2 and sum up some amounts and print that in the report.
Report Name 2 should occur in a New page and after decimal there should be 4 digits.
For Report Name 2 under Type Of Transaction there are about 24 different Transaction Types and I should print only those that have a dollar value of more than 0.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Mar 02, 2005 11:57 am Post subject:
DFSORT has extensive reporting capabilities. If you want more specific help with your reports, you need to show an example of your input records (with actual values for relevent fields), and exactly what you want the output report to look like with actual values. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Second Output should look like and this should start in the Next page and if there are more than one page each page should have the header and the page number:
Code:
<Report Name 2> Page n
<Run date and Time>
Type of Transaction Amount
C1 1.3451
C2 2.2222
C3 3.1234
First Report will always fit in a page. But the Second report will follow to the next page. So for the second report, I have to print page numbers also.
Frank, are the above details OK? If not please let me know.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Mar 03, 2005 11:34 am Post subject:
Some questions:
1) You refer to table1 and table2. Are these actually two input files with the records shown? What is the RECFM and LRECL of the input files?
2) You show amounts like 100 and 95.1567. Are these the actual character strings in the records? Or is 100 really 100.0000? Or are the actual fields in some numeric format (e.g. PD, BI)? If they are in a numeric format, what is the format? If you don't know, just show what the 100 and 95.1567 values look like in hex. Also, what is the starting position and length of each field?
3) In the second report, the input file has C4, but the output file doesn't. Do you want to omit records with an amount of 0? _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
2) SUM function of DB2 is used to arrive at the values for Earned, Reserved, Expired and Used amount. and the values for this are obtained by summing along all the column values for each of them (Earned, Reserved, Expired and Used) for Report1 and
3)For Report2 we just print all the values that have NON-ZERO dollar amount in the respective Reports with the required header.
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
Posted: Fri Mar 04, 2005 10:56 am Post subject:
sakreg, I'm not sure but I don't think you can read a DB2 table with Sort of any flavor. You could run a SPUFI Query and output the results to a file. Then use Sort and create your report. If this is a one shot request, this may be the best approach. If it is a frequently run job, you will need to write a program.
BTW - I do many requests this way, I run a SPUFI query to get my desired rows then use sort to create an Excel friendly file and FTP it to our LAN. _________________ Thanks,
NASCAR9
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Fri Mar 04, 2005 11:18 am Post subject:
sakreq,
DFSORT can only read input files - it can't read DB2 tables directly. So unless you can produce files from the DB2 tables, I can't help you. If you can produce files, then you should format the records so that each field is in a "normalized" form, for example:
Can you create a file like that? If so, I can show you how to use DFSORT to get the reports you want. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Type of Transaction Amount
ABCD 2111
EFGH 4222
IJKL 6333
MNOP 8444
For Report 2, if in the Input file, the first 4 characters are equal, then while writing to the file, they are summed up and produced as a single row for that particular transaction type. Hope this is clear.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Mon Mar 07, 2005 11:44 am Post subject:
Sakreg,
Here's a DFSORT/ICETOOL job that will give you the reports you asked for. I assumed that your input files are RECFM=FB, that the values in input file1 are 9-byte ZD values and that you have more than one record in input file1 (if not, the job could be simplified).
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
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