Problem reading a COBOL file using DS

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
mavrick21
Premium Member
Premium Member
Posts: 335
Joined: Sun Apr 23, 2006 11:25 pm

Problem reading a COBOL file using DS

Post by mavrick21 »

Hi,

We have a COBOL file which is pushed from MAINFRAME to UNIX using FTP program in MAINFRAME. I am able to import the copy book into DS and also read the contents of the file(pushed from Mainframe) on UNIX using Complex flat file stage. The data in the non COMP columns are being displayed correctly.

I am facing problem while reading columns which are COMP fields.
Here is the description of the column in CFF stage -> Columns.
<Column name> Disp_QTY
<Native type> BINARY
<Length> 4

Few values displayed for the COMP fields when i click on VIEW DATA in DS is correct. For values like -1, 34 , 79 etc it is displaying some other numeric value.

Can you post your valuable suggestions/comments regarding this ?

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

WHAT "other numeric value"? Pi?

Your question currently falls into "there a red light on on my dashboard". More information is needed for cogent diagnosis.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Check if there were any redefined that in case were not imported properly in metadata. Do post the actual value that you see from View data. Rather that relying on view data, write it into a sequential file and verify the output.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
mavrick21
Premium Member
Premium Member
Posts: 335
Joined: Sun Apr 23, 2006 11:25 pm

Sorry for the delayed reply.

Post by mavrick21 »

Hi,

Here are the details -

The source file is directly FTP'ed from mainframe to UNIX (Sun OS) without any reformatting.

I am using 2 stages, one being the Complex Flat file stage to read the source file in UNIX and the other being a sequential file to collect the output.
==================================
The details in CFF stage for COLUMN 1 -
Columns Tab ->
Level Number - 03
Column Name - ITEM
Native Type - Binary
Length - 4
Scale - 0
Sign Indicator - Signed
Usage - COMP
Record Options Tab ->
Byte Order - Native Endian
Character Set - ASCII
Data format - Binary
Record Delimiter - \n

Copy Book for this column
10 ITEM 2/BI 31(31 is the value stored)

The details in Sequential file stage for the above column(COLUMN 1)-
Columns Tab ->
Level Number - 05
Column Name - ITEM
SQL Type - Integer
Length - 4
Nullable - No

Here are the results of View data in Sequential file and/or CFF stage-
31 [Value when viewed in Mainframe is 31. So this is correct]
63 [Value when viewed in Mainframe is 34 which is incorrect in DS]
124 [Value when viewed in Mainframe is 79 which is incorrect in DS]

-------------------------------------------------------

The details in CFF stage for COLUMN 2 -
Columns Tab ->
Level Number - 03
Column Name - ISALES
Native Type - Binary
Length - 9
Scale - 0
Sign Indicator - Signed
Usage - COMP
Record Options Tab ->
Byte Order - Native Endian
Character Set - ASCII
Data format - Binary
Record Delimiter - \n

Copy Book for this column
10 SALES 4/BI 13(13 is the value stored)

The details in Sequential file stage for the above column(COLUMN 2)-
Columns Tab ->
Level Number - 05
Column Name - SALES
SQL Type - Integer
Length - 9
Nullable - No

Here are the results of View data in Sequential file and/or CFF stage-
1061109567 [Value when viewed in Mainframe is -1 which is incorrect in DS]
63 [Value when viewed in Mainframe is 8 which is incorrect in DS]
==================================

Hope the details given above is sufficient to solve the issue. Please let me know if you require any more details.

Awaiting your response.
Thank You
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Please post the COBOL layout and the record schema, which you can copy from the Layout tab of the table definition.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mavrick21
Premium Member
Premium Member
Posts: 335
Joined: Sun Apr 23, 2006 11:25 pm

Issue has been resolved.

Post by mavrick21 »

Hi,

Thanks Kumar and Ray.

The issue has been resolved by FTP'ing files from Mainframe to UNIX box in Binary Mode.

Thanks.
Post Reply