Unable to read packed overpunched field in CFF

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
sachinnilose
Premium Member
Premium Member
Posts: 12
Joined: Wed Jul 29, 2009 2:47 am
Location: Germany

Unable to read packed overpunched field in CFF

Post by sachinnilose »

Hello,

I am using CFF stage for reading a multiformat file.
File type is binary.
Char set is EBCDIC as FTPd from mainframe.

I need to unpack data of a packed decimal field from a binary file.

The field takes 5bytes. I have used data-type as DECIMAL(9) in CFF stage and I can see it's cobol format shows as PIC 9(9) COMP-3 and it takes 5byes only.

When I try to view data it is giving me below error.

##I IIS-DSEE-TFSC-00001 14:46:16(013) <main_program> APT configuration file: /applications/IBM/InformationServer/Server/Configurations/default.apt
##W IIS-DSEE-TFIG-00201 14:46:16(000) <Complex_Flat_File_7,0> Field "C01KTO" has import error and no default value; data: {01 00 & Q 00 80}, at offset: 45
##W IIS-DSEE-TOIX-00154 14:46:16(001) <Complex_Flat_File_7,0> Import warning at record 0.
##W IIS-DSEE-TOIX-00018 14:46:16(002) <Complex_Flat_File_7,0> Import unsuccessful at record 0.
##W IIS-DSEE-TFIG-00201 14:46:16(003) <Complex_Flat_File_7,0> Field "C01KTO" has import error and no default value; data: {01 07 1 3 00 20}, at offset: 45
##W IIS-DSEE-TOIX-00154 14:46:16(004) <Complex_Flat_File_7,0> Import warning at record 1.
##W IIS-DSEE-TOIX-00018 14:46:16(005) <Complex_Flat_File_7,0> Import unsuccessful at record 1.
##W IIS-DSEE-TFIG-00201 14:46:16(006) <Complex_Flat_File_7,0> Field "C01KTO" has import error and no default value; data: {01 08 & 9 00 @}, at offset: 45
##W IIS-DSEE-TOIX-00154 14:46:16(007) <Complex_Flat_File_7,0> Import warning at record 2.
##W IIS-DSEE-TOIX-00018 14:46:16(008) <Complex_Flat_File_7,0> Import unsuccessful at record 2.
##W IIS-DSEE-TFIG-00201 14:46:16(009) <Complex_Flat_File_7,0> Field "C01KTO" has import error and no default value; data: {01 08 & 9 00 @}, at offset: 45
##W IIS-DSEE-TOIX-00154 14:46:16(010) <Complex_Flat_File_7,0> Import warning at record 3.
##W IIS-DSEE-TOIX-00018 14:46:16(011) <Complex_Flat_File_7,0> Import unsuccessful at record 3.
##W IIS-DSEE-TFIG-00201 14:46:16(012) <Complex_Flat_File_7,0> Field "C01KTO" has import error and no default value; data: {01 08 p 7 00 02}, at offset: 45


When I check the file on unix machine in hex format i can see the values like:

0100265100
0107313300
and so on.

I see the same value on mainframe. Except on the mainframe PIC 9(9) comp-3 is stored in 5 bytes packed but there is no sign at the end.

I checked the forum and found that possibility of mainframe decimals are stored without sign (overpunched) :( But not sure as not a mainframe guy.

Please let me know how can I handle packed data without sign nibble. Or do we need to use some external routine.

any suggestion would be of great help.

Thanks,
sachin
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Packed is packed with or without a sign, an overpunched sign is something different. And this really isn't mainframe stuff as much as it is COBOL stuff.

Not anywhere where I can check but you should be able to simply tell the CFF stage that is is 'packed' and it should handle it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

the values of "01 00 & Q 00 80" do not look like a valid COMP-3 field value, regardless of whether it has a leadin or trailing sign. Are you certain that you haven't done an EBCDIC to ASCII conversion here?
sachinnilose
Premium Member
Premium Member
Posts: 12
Joined: Wed Jul 29, 2009 2:47 am
Location: Germany

Post by sachinnilose »

ArndW wrote:the values of "01 00 & Q 00 80" do not look like a valid COMP-3 field value, regardless of whether it has a leadin or trailing sign. Are you certain that you haven't done an EBCDIC to ASCII conversion here?
Thanks Arnd.

I have not done any EBCDIC to ASCII conversion. Input file is FTPd from mainframe to Unix in BI mode.
I have checked the values on the mainframe and found that these are not comp-3 either. (check digit is missing)
I tried to read as CHAR(5) [C01KTO PIC x(5)] in datastage though I can able to import but can't able to convert these to decimals.

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

Re: Unable to read packed overpunched field in CFF

Post by ArndW »

sachinnilose wrote:...When I check the file on unix machine in hex format i can see the values like:

0100265100
0107313300
and so on....
Is this Hex 0x01 0x00 0x26 0x51 0x00 for the first row? If so, something is wrong. Do you have the actual COBOL picture definition for this column?
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

Did you import the actual COBOL Copybook? If not, that should be your first step.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
sachinnilose
Premium Member
Premium Member
Posts: 12
Joined: Wed Jul 29, 2009 2:47 am
Location: Germany

Re: Unable to read packed overpunched field in CFF

Post by sachinnilose »

ArndW wrote:
sachinnilose wrote:...When I check the file on unix machine in hex format i can see the values like:

0100265100
0107313300
and so on....
Is this Hex 0x01 0x00 0x26 0x51 0x00 for the first row? If so, something is wrong. Do you have the actual COBOL picture definition for this column?
thanks again Arnd.

Yes these are Hex values 0x01 0x00 0x26 0x51 0x00 for the first row and so on.
In Mainframe there is no picture clause for this datatype as they use some native application interpreter to understand the field value. Because in mainframe they have removed the check digit ( XF, XC, XD and so on) and used that space to store the value.

My requirement is to import the value which is EbCDIC to datastage where I can transform to appropriate datatype in datastage.

Is there any possibbility I read binary input as hex (As it is packed) in CFF or any other stage.

OR other suggestion is welcome.

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

Post by ArndW »

What is the corresponding value that the field "0x01 0x00 0x26 0x51 0x00 " should have? DataStage has no problem reading binary values.
Post Reply