Extract COBOL file data using CFF

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
LNarayana
Participant
Posts: 5
Joined: Tue Jan 27, 2004 7:00 am
Contact:

Extract COBOL file data using CFF

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
shawn_ramsey
Participant
Posts: 145
Joined: Fri May 02, 2003 9:59 am
Location: Seattle, Washington. USA

Re: Extract COBOL file data using CFF

Post 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.
Shawn Ramsey

"It is a mistake to think you can solve any major problems just with potatoes."
-- Douglas Adams
LNarayana
Participant
Posts: 5
Joined: Tue Jan 27, 2004 7:00 am
Contact:

Post 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
Lakshmi Narayana A.
Decision Support Systems
RELIANCE INFOCOMM.
B Block, Ground Floor ,DB11
Dhirubhai Ambani Knowledge City
Koparkhairane,Navi Mumbai-400709.
INDIA
Phone Number:30380241
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

From what I've read here, comments seem to confuse it... best to remove them, especially around an area of redefines.
-craig

"You can never have too many knives" -- Logan Nine Fingers
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post 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.
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post 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
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
Post Reply