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
 

 

retreive from table and sequential file to generate a Report

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

New User


Joined: 20 Jan 2006
Posts: 6
Location: bangalore

PostPosted: Thu Aug 03, 2006 12:37 pm    Post subject: retreive from table and sequential file to generate a Report
Reply with quote

Here is a sinario please help me out :

1>

I have a sequential file : inputfile

Contains :

Cust ID
Invoice no
Date
Quantity occurs 5 times
Items occurs 5 time

2>

I have a DB2 table 1 : Cust_table

Contains :

Cust ID
Cust name

3>

I have another DB2 table: Price_table

Contains :

Item name
Price (Unit price)

Now I need to generate a report in the following format

------------------------------------------------------------------------------------

Cust ID Name Invoice No item quantity price total

12333 ssssss 11111 pen 2 10 20
book 1 20 20


Grand total : 40
------------------------------------------------------------------------------------

plpease send me the program for this with clear exlanation.
cn also send it to my mail ID :<<E-Mail ID Removed>> Read Forum Rules.Thank you
Back to top
View user's profile Send private message

anamikak

New User


Joined: 10 May 2006
Posts: 64
Location: Singapore

PostPosted: Fri Aug 04, 2006 1:24 pm    Post subject:
Reply with quote

Just wondering, if you have given it a try? icon_rolleyes.gif
Back to top
View user's profile Send private message
cramakrishnan

New User


Joined: 30 Jul 2006
Posts: 3

PostPosted: Fri Aug 04, 2006 1:48 pm    Post subject: Re: retreive from table and sequential file to generate a Re
Reply with quote

I am not clear with the output...
Here is my doubt on this...

The input file has a occurs clause on the quantity and the price, But the output report doesnt contain the 5 occurs of the input...

The output report must be like...
Cust ID Name Invoice No item q1 q2 a3 a4 a5 p1 p2 p3 p4 p5 total

If there is no occurs, the below solution might work...

Using DSNTIAUL download the cust table and price table to a dataset...
Use the splice operator of the sort to merge the records of the input file to the cust table and price table datasets to get the desired output...

Before using splice operator move the cust id and item fields appropriately to match the columns in the input file...

Hope this helps...

On the other hand you could take this file to the cobol program. Move it to a temporary table. Join with the cust table and price table to get the desired output...
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 Data replication from multiple Db2 ta... kishpra DB2 1 Mon Mar 27, 2017 9:58 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 3 Mon Mar 27, 2017 3:59 pm
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm


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