COBOL file decimal read as 0.0

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
caltog
Premium Member
Premium Member
Posts: 39
Joined: Thu May 22, 2003 7:32 am

COBOL file decimal read as 0.0

Post by caltog »

Hello,
I'm using a job reading a COBOL file PxCFF.
I read a column PIC 9(13)V9(4) COP-3.
Metadata for this columns are defined as follow 'Decimal (17,4)' in DataStage and in the DB.

When I read the COBOL file I retrieve only 0000000000000.0000 even if there is different data in the file!?

I've an other field Decimal (15,6) which works fine.

Any one as an Idea if there is a parameter to set or anything else?

Thanks for the help,

Tony
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Does your copybook read
PIC 9(13)V9(4) COP-3.
or

Code: Select all

PIC 9(13)V9(4) COMP-3. 
?

The COMP-3 is a type of BCD encoding where 2 digits are packed into each byte. What does your source file look like in this column - it should contain what looks like unreadable characters.
caltog
Premium Member
Premium Member
Posts: 39
Joined: Thu May 22, 2003 7:32 am

Post by caltog »

Sorry my mistake on the COBOL is reading COMP....
I misstyped when creating the post.

The source file is containing only numbers. No special chars

Tony
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If there are only numbers in your file, then the column was not exported as a COMP-3 field. You need to correct either the file or the COBOL definition.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If there are only numbers in your file, then the column was not exported as a COMP-3 field. You need to correct either the file or the COBOL definition.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Try removing the COMP-3 from your copybook definition; but if you are using a fixed-width file definition this will change your field lengths/positions.

"PIC 9(13)V9(4) COMP-3" uses 7 Bytes in the file,
"PIC 9(13)V9(4)." uses 13 Bytes in the file.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

ArndW wrote:"PIC 9(13)V9(4) COMP-3" uses 7 Bytes in the file,
"PIC 9(13)V9(4)." uses 13 Bytes in the file.
Sorry, but that's not correct. The COMP-3 field will take 9 bytes in physical storage, and the DISPLAY field (default when no other qualifiers are in the PIC clause) will take 17 bytes.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

FranklinE - you are absolutely correct, I looked at the 13 and neglected the 4 decimal places. Thanks for correcting that.
Post Reply