With the introduction of the IMS Catalog in version 12 DBD statements for COBOL copybook and PL/I include information were introduced. This enrichment of DBDs allows to store these information within the IMS Catalog. DFSCASE and DFSMAP are used to define different field layouts for segments with variable length. There are a lot of IMS databases out there, having such a segment layouts. With DFSCASE you are able to define a case on a specific value of a DBD defined field. Based on this case you are able to define a field mapping with DFSMAP and directly following FIELD statements. The problem with this is, that you are not able to define the same field on different mappings.
For instance: a database contains a segment storing transaction information. There are different types of transactions like deposits, withdrawals, transferals, credits, debits and so on. So the segment has a variable length and different layout. Since transferals, credits and debits do also affect another account, you have to store information like account number and bank identifier of the transaction partner. For deposits and withdrawals these information are not needed. Because of this you may have a layout like this for the segment:
Database ACCOUNT - dependent segment TRANS
DBD definied fields:
TXNO - transaction number
TXTIME - transaction date and time
TXTYPE - transaction type (values: deposit, withdrawal, transferal, credit, debit, ...)
TXAMOUNT - transaction amount
Additional COBOL copybook or PL/I include fields based on TXTYPE = 'deposit' or 'withdrawal':
ATMNO - number of the ATM used for the deposit or withdrawal
...
Additional COBOL copybook or PL/I include fields based on TXTYPE = 'transferal':
TXPBANK - bank identifier of the transaction partner
TXPACCNO - account number
TXPHLDR - account holder
PURPOSE - information about the intended purpose of the transferal
EXECDATE - execution date (necessary if not executed immediatly)
...
Additional COBOL copybook or PL/I include fields based on TXTYPE = 'credit':
TXPBANK - bank identifier of the transaction partner
TXPACCNO - account number
TXPHLDR - account holder
PURPOSE - information about the intended purpose of the credit
...
Additional COBOL copybook or PL/I include fields based on TXTYPE = 'debit':
TXPBANK - bank identifier of the transaction partner
TXPACCNO - account number
TXPHLDR - account holder
MANDATE - debit advice mandate
...
Actually you are not able to map this for the IMS Catalog because field names under a mapping must be also unique within the whole DBD. It is the same with EXTERNALNAMEs. That is a problem for SQL access to such databases, because if you want to process this database with SQL you do not want to name for instance the BANKID field different for transferals and for debits. You want to have a SQL query and you want to get a result set, that looks like the following one (also attached as a text file):
SELECT * FROM ACCOUNT.TRANS WHERE ACCOUNT_ACCNO=1234567890 AND TXPHLDR='HumanLife Insurance Ltd'
| ... | TXTYPE | ... | TXPBANK | TXPACCNO | TXHLDR | MANDATE | PURPOSE | EXECDATE | ...
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ... | debit | ... | ZECBDEFF001 | 2375687253 | HumanLife Insurance Ltd | health insurance #98317573 | NULL | NULL | ...
2 | ... | transferal | ... | ZECBDEFF001 | 2375687254 | HumanLife Insurance Ltd | NULL | back pay, bill #81739616136 | 2015-01-13 | ...
3 | ... | debit | ... | ZECBDEFF001 | 2375687257 | HumanLife Insurance Ltd | accident insurance #38248713 | NULL | NULL | ...
4 | ... | debit | ... | ZECBDEFF001 | 2375687253 | HumanLife Insurance Ltd | health insurance #98317573 | NULL | NULL | ...
5 | ... | credit | ... | ZECBDEFF001 | 2375687251 | HumanLife Insurance Ltd | NULL | refund, doctor's bill #134916575 | NULL | ...
6 | ... | transferal | ... | ZECBDEFF001 | 2375687254 | HumanLife Insurance Ltd | NULL | life insurance #4232582, initial payment | | ...
'...' marks values that are not relevant for this example.
The mapping with DFSCASE and DFSMAP should be able to map something like this, because this is not a designed singular case. It should be possible to have the same field mapped within different cases. The support for this should cover both Java SQL support and COBOL SQL support.
Dear Mr. Recknagel:
Thank you for submitting this IMS enhancement request.
After a comprehensive review, we regret to inform you that we have determined that at this time this request will not be a candidate for inclusion in an upcoming release because request has a high implementation cost with a low relative value. Hence, we have rejected this request.
We appreciate your input to the IMS development team.
Sincerely,
Jeff Fontaine
IMS Database Development
Due to processing by IBM, this request was reassigned to have the following updated attributes:
Brand - Information management
Product family - IMS
Product - IMS Database Manager
Component - Application Development
Operating system - IBM z/OS
Source - Other
For recording keeping, the previous attributes were:
Brand - Servers and Systems Software
Product family - zBLC family
Product - zBLC
Component - zBLC Requirements
Operating system - IBM z/OS
Source - zBLC
Attachment (Description): Example SQL query and result set