Page 1 of 1

Using CFF stage / reading complex flat files.

Posted: Tue Jul 11, 2006 4:47 am
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.

Posted: Tue Jul 11, 2006 5:41 am
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.

Posted: Tue Jul 11, 2006 6:37 am
by chulett
As noted, this isn't a Complex Flat File... it's a report. Roll your own.

Posted: Tue Jul 11, 2006 5:51 pm
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.