View previous topic :: View next topic |
Author |
Message |
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Fri May 07, 2010 1:50 pm Post subject: Can the Load utility load comp-3 data |
|
|
I need to load a VSAM file that contains amounts in S9(5)V99 COMP-3 format. I've searched the manual and found nothing that seems to work. I have tried DECIMAL PACKED like this:
Code: |
POSITION(055) DEC PACKED
|
The field looks like this S9(5)V99 COMP-3
Code: |
5---
F---
5---
----
..&.
0050
020C
|
Any help is appreciated. _________________ Thanks,
NASCAR9 |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri May 07, 2010 2:11 pm Post subject: Re: Can the Load utility load comp-3 data |
|
|
NASCAR9 wrote: | I need to load a VSAM file that contains amounts in S9(5)V99 COMP-3 format. I've searched the manual and found nothing that seems to work. I have tried DECIMAL PACKED like this:
Code: |
POSITION(055) DEC PACKED
|
The field looks like this S9(5)V99 COMP-3
Code: |
5---
F---
5---
----
..&.
0050
020C
|
Any help is appreciated. |
Are you loading the contents of vsam cluster into DB2 table?
Kolusu |
|
Back to top |
|
|
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Fri May 07, 2010 2:39 pm Post subject: |
|
|
Hi kolusu,
Right now I'm just testing loading COMP-3 data. We are slowly converting from VSAM to DB2. Does this answer your question? _________________ Thanks,
NASCAR9 |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri May 07, 2010 4:11 pm Post subject: |
|
|
NASCAR9 wrote: | Hi kolusu,
Right now I'm just testing loading COMP-3 data. We are slowly converting from VSAM to DB2. Does this answer your question? |
Nascar9,
If your DB2 table column is defined as DECIMAL(7,2) or NUMERIC(7,2) you should be ok. Remember that you if your VSAM cluster is variable cluster you might want to add the positions correctly.
Can you copy the vsam cluster data to a seq file and re-load it? |
|
Back to top |
|
|
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Fri May 07, 2010 4:29 pm Post subject: |
|
|
kolusu,
The file is a seq. file I sorted off a few records to test with. The file is fixed length. I only included the prortion of the load I'm have problems with. We typically would define a Decimal DB2 column that will contain dollars as DEC(9,2).
The VSAM files are old, when storage was expensive they were defined small. Enough rambling.
the type of data I need to load is like this:
S9(3)V99 COMP-3
S9(5)V99 COMP-3
S9(7)V99 COMP-3
In DB2 they will be DEC(9,2).
The load has NOT worked yet. _________________ Thanks,
NASCAR9 |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri May 07, 2010 5:01 pm Post subject: |
|
|
NASCAR9,
You need to change the load card to specify the length where the PD field ends
for ex s9(3)V99 takes 3 bytes so you need to specify the ending position. Assuming the seq file has the COMP-3 field at pos 55 you would have load card as
Code: |
POSITION(055 : 057 ) DEC PACKED
|
for S9(5)V99 COMP-3 it would be
Code: |
POSITION(055 : 058 ) DEC PACKED
|
for S9(7)V99 COMP-3 it would be
Code: |
POSITION(055 : 059 ) DEC PACKED |
Kolusu |
|
Back to top |
|
|
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Fri May 07, 2010 5:46 pm Post subject: |
|
|
Kolusu,
Once again you've come thru!
Thank You for all your help! _________________ Thanks,
NASCAR9 |
|
Back to top |
|
|
|
|