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

DB2, write report based on query output value


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
subhadrasn

New User


Joined: 01 Mar 2022
Posts: 2
Location: India

PostPosted: Thu May 19, 2022 6:40 pm
Reply with quote

I have to create a report by combining multiple tables, matching my condition.

Now my problem is, I have to write down the mail id in the report. For a particular customer, we can have multiple mail IDs, say personal mail id, secondary mail id, Customer mail id and few more options.
When 2 or more mail ids are there, i have to chose Primary mail first and if primary is not available, then say secondary and if that is also not available, then Customer mail id.
Mail IDs are in a single column, Mail id code to define primary or sec is another column.
Basically i need to check the Mail_id_code value and based on that write the mail id from other column into report.

How should i query this now please.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 1492

PostPosted: Thu May 19, 2022 7:14 pm
Reply with quote

subhadrasn wrote:
I have to create a report by combining multiple tables, matching my condition.

Now my problem is, I have to write down the mail id in the report. For a particular customer, we can have multiple mail IDs, say personal mail id, secondary mail id, Customer mail id and few more options.
When 2 or more mail ids are there, i have to chose Primary mail first and if primary is not available, then say secondary and if that is also not available, then Customer mail id.
Mail IDs are in a single column, Mail id code to define primary or sec is another column.
Basically i need to check the Mail_id_code value and based on that write the mail id from other column into report.

How should i query this now please.

I personally did not understand: who is who, and what is what?

1. Please, try to explain your problem more clearly.

2. Besides of this, please demonstrate what did you try so far by yourself?

3. Do not forget to emphasize all your samples of data, and of code. You have to use the Code button to do this.

Without presenting all 1-2-3 to the forum, there is a very little chance to get any answer.
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 Output LREC based on specific character DFSORT/ICETOOL 22
No new posts Discrepancy between source code and o... COBOL Programming 7
No new posts Splitting group records based on deta... DFSORT/ICETOOL 8
No new posts Beautifying the SPUFI output DB2 5
No new posts Copy next subsquent records based on ... DFSORT/ICETOOL 5
Search our Forums:

Back to Top