Extract Mainframe File

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Extract Mainframe File

Post by ds2000 »

Getting a flat file from mainframe in the following format (fixed length). an have the schema as follows. How to handle this data.

Schema:
---------
type char(20)
code char(10)
effdate date
language char(1)
office smallint
mainoff smallint
prov char(2)


Data:
-----
ADDR_PROV 99 0000000000000000E001070ON
OFF_CODE CMP 0000000000000000E001070ON
OFF_CODE 43A 0000000000000000E001070ON
TRAN_TYPE 1 0000000000000000E001070ON
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Complex Flat File stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
shamshad
Premium Member
Premium Member
Posts: 147
Joined: Wed Aug 25, 2004 1:39 pm
Location: Detroit,MI

Post by shamshad »

Design 2 step process.

(1) Step 1: Download the file as "Binary" as only 1 column for the whole
row. For example if everyrow is 800 characters long in total
in transformer/ or FT plug in stage define only 1 column
like getdate=CHAR(800) rather than defining each and every
column individually. Dump the data in a .TXT or dataset.

(2) Step 2: Use the .TXT /dataset as Source and then apply the CFF stage
and here give all column definition of your source.
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Post by ds2000 »

File is already downloaded and exist in .txt format. Any specific columns format needs to be defined ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You should have said so.
Column widths are stored as "Display width" in the table definition.
Import the table definition of the text file, check the "fixed width" check box, and enter 20,10,8,1,6,6,2 in the column widths field. Edit the date column definition to specify that 00000000 is the representation of NULL (you have to do this because 00000000, which occurs in your data, is not a valid date).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply