Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
report based upon input file

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

New User


Joined: 08 Jan 2007
Posts: 53
Location: Chennai

PostPosted: Wed Oct 29, 2008 11:15 pm    Post subject: report based upon input file
Reply with quote

Guys,
Need some information for my project. Bit urgent !!!!!!!

Craker Table (DB2) contains the following fields and values:
Code:
cracker_code       Stock       shop_code
---------------      ---------      ------------
C001                    100           SH001
C002                    200           SH002
C003                    300           SH001
C001                    400           SH002
C002                    500           SH003
Note : cracker_code and shop_code are COMPOSITE key.

I am getting one input file. Input file can have any number of cracker_codes. Just for example, here I have given 2 values in the input file, which contains the following field and values:
Code:
cracker_input_file
--------------------
C001
C002

Requirement:
Need to generate a report for the given set of craker_code (refer cracker_input_file). Report should contain the stock at each shop contains. Output report file should be a PS file.

Output report PS file should have the following values:
Code:
cracker_code       Stock       shop_code
---------------      ---------      ------------
C001                    100           SH001
C001                    400           SH002
C002                    200           SH002
C002                    500           SH003

Any better solution for this ?? It would be really great if you provide the code also
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Oct 30, 2008 12:00 am    Post subject:
Reply with quote

Hi,

There can be many approches to this, one among those canbe:

1. "Unload" the DB2 table to QSAM (PS), while unloading you can ORDER BY "cracker_code".
2. Compare the other input, file with cracker_codes, with this unload file. before compairing, SORT your input file also on cracker_code.

If the DB2 Table is smaller one then you can directly "search" the table, but i usually prefer the above method.

Please notice your post is been edited to add the code tags, leran to use BBcode - they make the post rather readable.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Oct 30, 2008 12:03 am    Post subject:
Reply with quote

Quote:
It would be really great if you provide the code also
This is something over expectations.

BTW, when you say
Quote:
Any better solution for this ??
were you already using some other way to accomplish it ? And it didn't work out the way you needed...?
Back to top
View user's profile Send private message
RamsIBM

New User


Joined: 08 Jan 2007
Posts: 53
Location: Chennai

PostPosted: Thu Oct 30, 2008 12:49 am    Post subject:
Reply with quote

Hi Anuj,

Thanks for your reply.

Can you please tell me how to download the DB2 table within a program?

Please provide more info.

I was planning to do by using cursor for each and every input by using host variable. But it requires, close and open cursor many times.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Oct 30, 2008 12:54 am    Post subject:
Reply with quote

Hello,

Quote:
Can you please tell me how to download the DB2 table within a program?
Typically this is done with a db2 utility and not within some application program.
Back to top
View user's profile Send private message
RamsIBM

New User


Joined: 08 Jan 2007
Posts: 53
Location: Chennai

PostPosted: Thu Oct 30, 2008 1:17 am    Post subject:
Reply with quote

Hi,

Can you please provide me the utility info?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Oct 30, 2008 1:57 am    Post subject:
Reply with quote

Hello,

You can use BMCADM utility or IKJEFT01 to do that, here is a similar thread:

http://ibmmainframes.com/viewtopic.php?t=21198&highlight=ikjeft01
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Oct 30, 2008 2:00 am    Post subject:
Reply with quote

RamsIBM wrote:
I was planning to do by using cursor for each and every input by using host variable. But it requires, close and open cursor many times.
I believe, for the type of comparison you are looking for this approach would slow down the whole process significantly.
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us