cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

reading COMP3 data through Cobol CopyBook

0 Kudos
1,010

Hi All,

We’re currently working on  a customer project, where in we are getting mainframe data in .txt extract files.

BODS is reading all columns through cobol copybook nicely but not COMP-3 data type. Values are changing unexpectedly 

Attached are sample data and copybook files (Please rename layout.txt to layout.cpy; as I cant attach .cpy file here).

Please help me out how to read this in BODS

Really appreciate your help.

Thanks and regards,

Roshan

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Roshan

Your data file has a 0D0A at the end of each record as if it was "pretending" to be a windows txt file. Try adding a 2 byte filler to the end of the cpy book. That should stop your data drifting off by 2 bytes every record.

Your comp-3 (packed decimal) data looks a little strange to me. In the first record at offset +x'91' the first of the comp-3 is fine as x'000000000C' ( = 0), but after that I see x'00009C9325'. This does not look right as the last half byte in a comp-3 would normally be a C or D.

Former Member
0 Kudos

Hi Roshan,

If the source is .txt file, y are you using cobol copy book to load it? Any particular reason y you are not using flat file text format editor for loading?

Thanks,
Arun

0 Kudos

Hi Arun,

Have you gone through the source file ? Problem is, when I read this file in BODS, it shows some extra characters. But if I use COBOL Copybook, file seems to be clean but with alternate blank lines and wrong data in COMP3 columns.

Let me know if any way to read same file with proper values of COMP3 columns and without using copybook.

anzari_abu6
Explorer
0 Kudos

I know this is a very old post. But by chance do you remember the solution?

We are also having COMP3 fields and BODS is not able to read those fields correctly. What format did you use for your input file with COMP3 values?