Issue with reading a EBCDIC Cobol file - Complex file stage

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

devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Issue with reading a EBCDIC Cobol file - Complex file stage

Post by devidotcom »

Hi All,

I am trying to read a EBCIDIC file using a CFF stage. I get the following error:

Complex_Flat_File_0,0: Short read encountered on import; this most likely indicates one of the following possibilities:
1) the import schema you specified is incorrect
2) invalid data (the schema is correct, but there is an error in the data). [new-impexp/file_import.C:3227]

Also some more details before this fatal error
Complex_Flat_File_0,0: Field "WMM_CROSS_RFRN_ACCT_NR" has import error and no default value; data: {0c 00 0c 00 0c L 00 00 0c @ @ @ @ @ @ @}, at offset: 33 [impexp/group_comp.C:7679]

Following are the options set

Record type: Fixed
Byte-order: Native-Endian
character set: EBCDIC
Data format: Binary
Record delimiter:
Separator: Project default

I renamed the copied the copybook as .cfd and imported the same as As Is.

Could any one help to find out the reason please

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

Post by ArndW »

Your imported copybook metadata does not match that in the file. Did you get any warnings or error while importing the copybook? At the moment your metadata is longer than the actual data.
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Post by devidotcom »

Thank you for reply. No I did not get any warnign with importing the metadata.

How can I check if the file is data is shorter than the metadata? If it is then I can remove the extra columns from the metadata.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Unfortunately this often ends up being an iterative process. With big copybooks I will delete all but the first 20 columns or so, replacing it with a big VarChar filler field then check with "view data" to see if the columns are parsed correctly. When that is fixed, I will make a copy of the original and use the first 40 columns to check the next 20 for validity, and so on.

Often the errors come from COMP-3 columns not being interpreted correctly, or OCCURS being flattened incorrectly. Do you have either of these in your copybook?
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Post by devidotcom »

Yes I do have many Comp-3 columns.
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Post by devidotcom »

Should I try using the flattened pattern option instead of As Is option. This could be a reason right?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Does it ask you about flattening?
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Post by devidotcom »

Yes it does when I import the metadata into the stage. What do I choose there. Flatten selective arrays or Flatten all arrays?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Flatten all would be best. Do you have arrays ("OCCURS" or "OCCURS DEPENDING ON") or just group level, i.e. "10 SUB-GROUP." with no pictures?
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Post by devidotcom »

I have " OCCURS 2 TIMES" mentioned in the copy book. I really dont understand about the other terms you asked for. What is the difference when I say flatten all arrays?
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Post by devidotcom »

I have " OCCURS 2 TIMES" mentioned in the copy book. I really dont understand about the other terms you asked for. What is the difference when I say flatten all arrays?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Flatten all arrays. the OCCURS 2 times will be flattened.
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Post by devidotcom »

No it did not work.
Our my settings set correctly?
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Post by devidotcom »

When I flatten the arrays. The nubmer of warning I got was few. But the job aborted due to the same reason.

Complex_Flat_File_0,0: Short read encountered on import; this most likely indicates one of the following possibilities:
1) the import schema you specified is incorrect
2) invalid data (the schema is correct, but there is an error in the data). [new-impexp/file_import.C:3227]

Also I receive the same warnings as below before I get this fatal error:
Complex_Flat_File_0,0: Field "WMM_CROSS_RFRN_ACCT_NR" has import error and no default value; data: {@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @}, at offset: 33 [impexp/group_comp.C:7679]
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try setting APT_STRING_PADCHAR to a single space, rather than its default 0x00, which is usually displayed as ^@.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply