Using CFF stage / reading complex flat files.

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
eldonp
Participant
Posts: 47
Joined: Thu Jun 19, 2003 3:49 am

Using CFF stage / reading complex flat files.

Post by eldonp »

I have a interesting file that I want to read in. I would like to know if there's a way to read in this kind of file.... Here's a few lines from the file. You'll see that there are spaces, empty lines and data in various formats with different number of columnsm types and lengths.


Account Pricing Plan List Mapping
=================================
Import Account Pricing Plan List Map To Account Pricing Plan List


Subscriber Pricing Plan List Mapping
====================================
Import Subscriber Pricing Plan List Map To Subscriber Pricing Plan List
500 VC:Plan 500 (Per Sec)
REQ VC:Plan Frequent (Per Min)


CDR Pricing Plan List Mapping
=============================
Import CDR Pricing Plan List Map To CDR Pricing Plan List


Call Type Mapping
=================
Import Call Type Map To Call Type
ROA Roaming
SPE Services
MOB Cell. to Cell.
NAT National


SubType Mapping
===============
Import SubType (1) Import SubType (2) Map To SubType
ROA ANY ANY
SPE 121 121
MOB VOD VOD
NAT LOC LOC
MOB MTN MTN
INT 905 905
SPE SMS SMS
SPE GEN GEN
INT 904 904
NAT LON LON



I am interested in the data in the following sections only:

1. Subscriber Pricing Plan List Mapping.
2. Call Type Mapping.
3. SubType Mapping.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This is beyond the capacity of CFF stage.

You need to create a job, routine or script to pre-process this file into three files/streams containing the data you require.

If you write a routine, you can load the data directly into hashed files.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As noted, this isn't a Complex Flat File... it's a report. Roll your own.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Or read as varchar, check for first few digits for "Subscriber" or "Call" or 'Sub" and based on it you can divert it into different stream.
And ignore the first 2 lines.
And this should be done untill an empty space. Guess it is the end of that paragraph.
You can use stage variable and flag for this to accomplish.
Or simply use routines or any scripts for this.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply