Page 1 of 1

Extract COBOL file data using CFF

Posted: Fri Mar 24, 2006 4:44 pm
by LNarayana
Can any one give suggestion how to extract data from EBCDIC file with multiple redefines columns. Does Datastage CFF support this type of structure?

Thanks
Narayana

Posted: Fri Mar 24, 2006 5:11 pm
by ray.wurlod
Pre-process the file by reading it as a single column (or maybe two, if the record type is in the first position), using a Transformer stage to split the stream according to record type.
There are various techniques for preprocessing EBCDIC to ASCII.

Re: Extract COBOL file data using CFF

Posted: Fri Mar 24, 2006 5:41 pm
by shawn_ramsey
LNarayana wrote:Can any one give suggestion how to extract data from EBCDIC file with multiple redefines columns. Does Datastage CFF support this type of structure?

Thanks
Narayana
This is exactly what the CFF does. It is best if you have a COBOL copybook to import the file definitions from. The stage is a little odd to work with but it runs much faster than using using a sequential stage and performing the conversion in a transform.

Posted: Fri Mar 24, 2006 6:08 pm
by LNarayana
Thanks for your quick response.
We have cfd file which has COBOL definition. and used to import table definition and used that definition in CFF stage in source columns tab.
I checked the column definitions by "Edit Row" and found that 5 columns are redefined.
I selected all the columns except groups in to the select columns.
then I tried to view the data. data is ok upto the column which is prior to redefined column. and after that column we have some tabs or data is disturbed. Is it due to redefined columns or due to column lengths.
Can anyone give clear idea how to approach to extract the complete file.

Once again thanks
Narayana

Posted: Sat Mar 25, 2006 4:12 am
by kumar_s
Is the layout includes the redifines?
How you imported the COBOL layout? Did you specified 'As Is' option while importing the layout. If it was imported correctly, then you can try to comment the feilds under the redefine and just allow the prime column to be meta data and check.
Also try to write into a Seq file and check.

Posted: Sat Mar 25, 2006 7:48 am
by chulett
From what I've read here, comments seem to confuse it... best to remove them, especially around an area of redefines.

Posted: Fri Mar 31, 2006 8:39 am
by thurmy34
Hi,
Like Chulett said the comments realy confuse the CFF stage.
It's better to delete then.
I had some troubles with redefine in occurs too.
The redefines column was set to the first occurs.

Posted: Fri Mar 31, 2006 9:19 am
by crouse
The CFF stage will do everything you need, without commenting out anything.

The reason there are REDEFINES is because there are multiple record types/layouts in your data.

(if you're thinking of commenting out lines of the cfd, you better off just deleting them, but I don't believe you'll want/need to do either one)

You comment about viewing data and it looking right up to a point is "normal". You probably included all the columns from all the REDEFINES in ONE output link. Only data for a particular layout (REDEFINEd section) looks correct.

You'll probably want to create several output links from the one CFF stage that reads the file. On each output link you'll select ONLY the columns that relate to that link (probably some fixed data at the front of the layout, and the respective REDEFINE that defines a particular record type).

On each row, in the fixed data portion that is usuually in the first part of the record layout, will be a column that says what kind of record it is (i.e. HDR, TLR, DETAIL, etc...)

On the output links, you'll specify the column to interrogate that will indicate what rows will go out that output link.

Without writing a book, do understand what I'm getting at?

-Craig