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

retreive from table and sequential file to generate a Report


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Load new table with Old unload - DB2 DB2 6
Search our Forums:

Back to Top