Fixed Width Flat File Stage

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
pietrangeli
Participant
Posts: 8
Joined: Mon Jun 02, 2003 8:42 am

Fixed Width Flat File Stage

Post by pietrangeli »

I have a flat text file that I want to use as input and output. This is not a delimited file, nor is each column the same fixed length. Each column is in its own positions(ie: Emp#=Pos1..6 SSN=Pos 7-17 Salary=Pos18..30).

From what I can see a sequential stage cannot handle this type of file definition unless I read/write as one column and use substring functions. I see in the help files a Fixed-Width Flat File stage which looks like it is what I want, but I dont have it in my Designer anywhere. Is it a plugin that needs to be installed seperately? Do I need to purchase it seperately?

Any help is appreciated?

Thanks,
Frank P.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

It's a check box in the sequential file stage. You should use the DS Manager client and walk thru importing metadata from the file. It has a preview button that will allow you to fiddle the settings and keep preview'ing until you get it right.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
if col1 is from char1 to 6, col2 is from char 7-16 ...
then it will be ok to use fixed file with 0 spaces between columns and declare col1 char(6) col2 char(10) .. and so on

be aware that fixed files really use the display attribute of the column to position the columns and determine how many characters go in to the column and not the length attribute as one might think :!:

IHTH
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
pietrangeli
Participant
Posts: 8
Joined: Mon Jun 02, 2003 8:42 am

Post by pietrangeli »

Thanks......THis is my first DS job and the help files led me to believe that every field would need to be the same length. It also made reference to a completely different stage to use.

I've got it working.

Thanks again.
Frank.
Marley777
Premium Member
Premium Member
Posts: 316
Joined: Tue Jan 27, 2004 3:26 pm

non delimited file

Post by Marley777 »

kcbland wrote:It's a check box in the sequential file stage. You should use the DS Manager client and walk thru importing metadata from the file. It has a preview button that will allow you to fiddle the settings and keep preview'ing until you get it right.
:oops:
I am also using a flat file that is not delimited, but I can't seem to read the file into DS PX. I have tried using a Seq stage and a Dataset stage.
The file exist and has been verified, we just can't get it into datastage. What stage is recommended when reading a non delimited flat file? also, could you elaborate on using DS Manager for importing meteadata?

Thanks for your time.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

All of this documentation is available on your Start Menu --> Ascential DataStage --> Online documentation. Look at Manager client documentation.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Marley777
Premium Member
Premium Member
Posts: 316
Joined: Tue Jan 27, 2004 3:26 pm

Post by Marley777 »

kcbland wrote:All of this documentation is available on your Start Menu --> Ascential DataStage --> Online documentation. Look at Manager client documentation.

:?:

I did as you suggested and used the online manual. In DS Manager I go to Import=> Table definitions=> Sequential File Definitions => browse for my file select the file then click IMPORT. I get the following error. Have you ever seen this error? Thanks for your time.


DSR.MetaGeta(GET.SEQ.SAMPLE): OPENSEQ of /dlz1/cst/coml_stat_1998_prt1.data took ELSE clause, STATUS()=0
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

My guess is a permissions error. Make sure you can see this file internally, not just from a directory listing. Also, you can vi a sample file and just experiment with how importing works.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply