Convert IMS Data Formats to DB2 Formats
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> IMS

#1: Convert IMS Data Formats to DB2 Formats Author: jayram99Location: falls church.va,usa PostPosted: Tue Mar 28, 2017 8:44 pm
    —
What is the correct process to convert Segment Datatype to Table Structure.

IMS Datatype.

Ex: ZD09.
PD04.
PD03.05

What is the max value PD04 Can store and also convert to DB2 Datatype.


Appreciate your Help.

#2:  Author: jayram99Location: falls church.va,usa PostPosted: Tue Mar 28, 2017 9:25 pm
    —
I am correcting Below IMS Datatypes.


Ex: N 009.
P 004.
P 003.05.

What is the max digits P 004 can store(6 or 7 or 8 Digits) and also want to know help me to find equivalent data type in DB2(Deciaml(6,0) or Decimal(7,0) or Decimal(8,0)).

Thank you,

#3:  Author: kolusuLocation: San Jose PostPosted: Wed Mar 29, 2017 11:11 am
    —
jayram99 wrote:
Hi Kolusu,

I am correcting Below IMS Datatypes.


Ex: N 009.
P 004.
P 003.05.

What is the max digits P 004 can store(6 or 7 or 8 Digits) and also want to know help me to find equivalent data type in DB2(Deciaml(6,0) or Decimal(7,0) or Decimal(8,0)).

Thank you,


Jayram99,

This is one of the elementary question. They are not truly IMS database data formats, you are showing us what file-aid/file-manager formatted the data formats for you.

N = zoned decimal aka COBOL PIC 9(n) type
P = packed decimal aka COBOL PIC COMP-3 type
p. ss = Precision and scale decimal aka COBOL PIC COMP-3 type

Code:

IMS FM         COBOL                        DB2                LENGTH
=======        ======                       ===========        ======
N 009.         PIC 9(9)                     NUMERIC(9)           9   
P 004.         PIC S9(4) COMP-3             DECIMAL(4,0)         3   
P 003.05.      PIC S9(3)V9(5) COMP-3        DECIMAL(8,5)         5   

#4:  Author: jayram99Location: falls church.va,usa PostPosted: Wed Mar 29, 2017 2:42 pm
    —
Thanks Kolusu for your reply.

Initially, This is how we did analysis and made changes to our programs.
Code:

IMS FM  COBOL                DB2                       LENGTH
P 004    S9(6) COMP-3     DECIMAL(6,0)         4

We received value(Ex :1234567) from IMS and write to File (Which can store 7 Digits) but while loading to DB2, we are having issue as it can store only 6 Digits.

I don't know how you calculated as S9(4) COMP-3 and DECIMAL(4,0).

After making below changes, we could load data from IMS to DB2.

IMS FM COBOL DB2 LENGTH
P 004 S9(7) COMP-3 DECIMAL(7,0) 4

I need help on 1. can field defined as P 004 store 7 Digits or 8 Digits in IMS? 2. How to we convert IMS Packed Datatype to DB2 Decimal Datatype and I will use DCLGEN utility to generate COBOL Datatype.

Thank you

#5:  Author: kolusuLocation: San Jose PostPosted: Wed Mar 29, 2017 4:06 pm
    —
jayram99,

jayram99 wrote:
Thanks Kolusu for your reply.

Initially, This is how we did analysis and made changes to our programs.
Code:

IMS FM  COBOL                DB2                       LENGTH
P 004    S9(6) COMP-3     DECIMAL(6,0)         4

We received value(Ex :1234567) from IMS and write to File (Which can store 7 Digits) but while loading to DB2, we are having issue as it can store only 6 Digits.

I don't know how you calculated as S9(4) COMP-3 and DECIMAL(4,0).


As I mentioned earlier, you are showing the File-aid/manager format data types which is NOT how IMS datatypes are defined.

Here is the list of Data types for fields in IMS segments

https://www.ibm.com/support/knowledgecenter/en/SSEPH2_13.1.0/com.ibm.ims13.doc.sur/ims_fieldstmt.htm

jayram99 wrote:

I need help on 1. can field defined as P 004 store 7 Digits or 8 Digits in IMS? 2. How to we convert IMS Packed Datatype to DB2 Decimal Datatype and I will use DCLGEN utility to generate COBOL Datatype.


Go look at the IMS DBD/PSB to find out the exact definition of the fields instead of looking File-aid/file manager and then use the following table to convert the various fields

https://www.ibm.com/support/knowledgecenter/en/SSEPEK_11.0.0/apsg/src/tpc/db2z_equivalentcoboldatatypes.html



MVSFORUMS.com -> IMS


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group