CFF stage issue with OCCURS and blank default values

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
vpatel10
Participant
Posts: 2
Joined: Thu Feb 12, 2009 10:35 pm

CFF stage issue with OCCURS and blank default values

Post by vpatel10 »

We are using -

CFF stage to read EBCDIC file.
Fixed width file.
File has record types header/detail/trailer.
Detail record has column with OCCURS of type PIC S9(3)V9(4) COMP-3
CFF stage 'Records ID' defined for each record type.
CFF stage 'Record options' - Default values defined as '0' for decimal/integer.
This is working ok.

But when we remove Default values '0' for decimal/integer and make it blank, stage fails reading any record.
This works if input file doesn't have any array (OCCURS) defined in it.

How can we keep blank default values and still read file using CFF stage with OCCURS defined in file?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can't. Blank is not a legal value for decimal and integer data types.

You might try changing the data type to Char.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vpatel10
Participant
Posts: 2
Joined: Thu Feb 12, 2009 10:35 pm

Re: CFF stage issue with OCCURS and blank default values

Post by vpatel10 »

Thanks Ray. So how can we read null/empty decimal values without specifying any default values in CFF stage?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What part of "you can't" was unclear?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Ray, the problem is that the CFF stage is forcing the use of defaults even if they are not required. Defaults in CFF can be dodgy - defaulting an empty Decimal or integer to 0 can cause trouble - for example default a flag field to 0 when it is blank or empty implies the wrong thing. The CFF is forcing the use of defaults and it is impossible to work out afterwards which rows were defaulted. It is forcing this behaviour due to the way it parses the OCCURS statement. Data without OCCURS is not complaining about missing defaults, data with OCCURS is.

Is it possible to set a decimal value to NULL in the CFF default field instead of 0?
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Default processing on EBCDIC data is always a problem. The mainframe COBOL perspective -- a hard standard that teaches a quick lesson when ignored -- is to only ever default alphanumeric fields to spaces and display (non-packed) numerics to zeroes. Binary storage fields in general follow the standard with a numeric zero as the default, with packed decimal being the sore thumb that always sticks out: the storage format permits a numeric zero in each half-byte, with two consecutive zeros translating to ASCII null but should not be read as such.

The only correct solution is to go back to the process that creates the EBCDIC data and impose the standards, and not tolerate anything else. Otherwise, DataStage jobs will be rife with custom code just to handle them.

Unsolicited advice: when your upstream developers complain that you are making them do more work, you can use my rule-of-thumb: if you make me do it in DataStage, it will cost the project two or three times as much as having them do it. Make sure a manager with budget power is within earshot. Works every time for me. 8)
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
jzajde1
Premium Member
Premium Member
Posts: 21
Joined: Wed Jan 07, 2015 8:10 am

Post by jzajde1 »

In the CFF Stage under 'Record Options' Tab there is a default values column. Enter 0.0 as a default.
Post Reply