Page 1 of 1

Reading Signed Decimal Data ( COBOL) through Sequential File

Posted: Wed May 26, 2004 2:28 am
by Inquisitive
I am trying to read a COBOL file through a sequential file in Datastage (7.0).

It has few Signed Decimal Fields ( PIC S9(7)V9(2) ).

When I read it through sequential file Stage ( Parallel Job Ver 7.0) it was giving some arbitrary values.

When we tried samething with the CFF Stage in Server Job we are able to view proper Data.

How can we read signed data through Sequential File?

Any solution for this problem would be helpful.

Posted: Thu May 27, 2004 12:55 am
by vmcburney
I assume you are reading it in as a fixed width text file (which cobol files normally are). Try reading it in as a varchar field and then transform it into a decimal field in a transformer. Sequential file stages are pretty straight forward, it is going to the same position on the line every time and pulling off nine characters.

If you are getting arbitrary characters it could be that you need to take into account the structure of the cobol file and the different record types that could be on each line. Having you got a constraint in your transformer to check that the current row has a signed decimal field at that column position?

Posted: Thu May 27, 2004 1:50 am
by Amos.Rosmarin
I alway start with looking at the file with vi to see how the data looks like,
it will give you a lot of information that will help you read the file. Make sure that you are not dealing with COMP-3 data.

HTH,
Amos