CFF Stage issues

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
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

CFF Stage issues

Post by clarcombe »

I have to import a Cobol text file and structure into Datastage.

The structure has multiple occurs in, some of which are nested

Code: Select all

Fields
     Occurs 30
     Occurs 6
     Occurs 140
         Occurs 5
Fields
I am experiencing several issues

1) I had to import the decimals e.g. +00568 as strings as they were blank otherwise. Is this usual ?

2) I seem to be getting a cartesian product as I have about 35 rows, which when read, creates about 160,000 lines. I can only guess this must be 35x30x140. Again is this usual ?

3) I am having to read the sub records into one field in a separate file with the key and then reprocess them to extract the fields, then link them to the header file. Is there a better way ?

4) Are there any better alternatives than using the CFF file ?

I am unable to use the enterprise version as we only have the 7.5 server license.

Thanks
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You could read the entire line as a single string using Sequential File stage, and insert CRLF strings where you want them (and maybe commas) before writing back to a file. Then read from that file.

For example, if you have PIC XX OCCURS 30 you can read a 60 character string. Use Fmt() or Fold() function to split it into two-character substrings and then convert the delimiter (@TM for Fmt() or @FM for Fold()) into CRLF using Ereplace() function. Tip: initialize stage variable svCRLF to Char(13):Char(10) and use that as the "to" argument in Ereplace()
Last edited by ray.wurlod on Fri Jun 29, 2012 5:43 am, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bhargav_dd
Premium Member
Premium Member
Posts: 57
Joined: Tue Jun 30, 2009 9:38 am

Post by bhargav_dd »

There is no alternative option than using CFF stage as it reads these records and does the required output
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I disagree, as I explained above.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

Thanks Ray,

An interesting alternative which I began to implement then stopped.I really want to avoid the counting and substring techniques as the structure may well change and would make it difficult to maintain.

So it appears then, that the multiplication of lines in CFF is normal. Luckily the CFF runs rapidly so the job completes quickly.

Regards
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

This is a note to all those who have speed issues with the CFF. If there are multiple nested structures in the file, don't try and take them all out in one go. Use the row key and take them out separately and rejoin them

Thus
Key
Structure A
Structure B
Structure C

Use three CFF stages instead of one to create three files
Key
Structure A
Key
Structure B
Key
Structure C

Using one CFF stage will make a cartesian product of the result
i.e. Rows x Structure A occurences x Structure B occurences x Structure C occurences.
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
Post Reply