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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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