'depends' clause in complex flat file (CFF) stage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
bigpoppa
Participant
Posts: 190
Joined: Fri Feb 28, 2003 11:39 am

'depends' clause in complex flat file (CFF) stage

Post by bigpoppa »

DS Server, 6.0r3 on SUN
-----------------------
I am trying to turn the following record into a 'table' using the CFF stage:
-------
4a0123c
-------

The fields are:

Field d, dec (1) - the 4
Field a, char(1) - the 'a'
Field b, char(1) - the '0,1,2,3', occurs up to 4 times, depends on field 'd'.
Field c, char(1) - the 'c'.

The result of the cff should be
-------
d a b c
-------
4 a 0 c
4 a 1 c
4 a 2 c
4 a 3 c

When I use the cff stage, my column definitions are
----------
lvl field
----------
05 d
05 a
05 b occurs 4, depends on d
05 c

The result of the CFF stage is:
-------
d a b c
-------
4 a 0 c
4 a 1 c
4 a 2 c
4 a 3 c
4 a c c
4 a c
4 a c
4 a c
4 a c
4 a c

Why is it giving me 10 records? The first 4 are right, the last 6 are wrong. Has anyone encountered this issue? If I change the number of occurs to '5' for field b, then all of the "c"s in the output turn into '?'s. If I change the # of occurs to 3, then all of the "c"s turn into '3's. If I change the # of occurs to 20, DataStage thinks that the data source is empty. This is weird, right?

Any help is appreciated,
BP
bigpoppa
Participant
Posts: 190
Joined: Fri Feb 28, 2003 11:39 am

Post by bigpoppa »

Thanks for the input.

We solved the problem by padding the occurs field with spaces until the field was the size of MAX_NUM_OCCURENCES * LENGTH OF FIELD. Then we sent the padded file thru the CFF stage, and we get the table with a lot of NULLs in the occurs field. Oh well..

It seems like ASCL should grey out the 'depending' on drop down if it doesn't work.
Post Reply