MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Convert IMS Data Formats to DB2 Formats

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS
View previous topic :: View next topic  
Author Message
jayram99
Beginner


Joined: 16 Aug 2004
Posts: 52
Topics: 21
Location: falls church.va,usa

PostPosted: Tue Mar 28, 2017 8:44 pm    Post subject: Convert IMS Data Formats to DB2 Formats Reply with quote

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.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jayram99
Beginner


Joined: 16 Aug 2004
Posts: 52
Topics: 21
Location: falls church.va,usa

PostPosted: Tue Mar 28, 2017 9:25 pm    Post subject: Reply with quote

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,
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Mar 29, 2017 11:11 am    Post subject: Reply with quote

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   

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jayram99
Beginner


Joined: 16 Aug 2004
Posts: 52
Topics: 21
Location: falls church.va,usa

PostPosted: Wed Mar 29, 2017 2:42 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Mar 29, 2017 4:06 pm    Post subject: Reply with quote

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
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group