Record level properties

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
psriva
Participant
Posts: 44
Joined: Fri Aug 11, 2006 8:40 am

Record level properties

Post by psriva »

I have a ouptut file with fixed width fields and variable length pipe delimited fields.
How should my record level properties be ?

Initially when I had a fixed width file I would say record_length=fixed and when I had a variable length file I do delim='|' but now that I have a combination of both how should I treat this ?

I was thinking maybe I should use record_format={type=implicit}. Can someone please guide me on this ?

(FYI: I am using a paralle writer stage as output and am using the option output schema file to specify the output)
ps
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If it is fixed width, whats the point having delimiter, or the vise versa?
Can you give some example.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
psriva
Participant
Posts: 44
Joined: Fri Aug 11, 2006 8:40 am

Post by psriva »

What I mean is that when I had a fixed width file I specify record_length=fixed only,

and

when I have a a variable length file I specify delim='|' .

Now my question is what should I do when I have a combination of both fixed and variable length fields in my file ?
ps
seanc217
Premium Member
Premium Member
Posts: 188
Joined: Thu Sep 15, 2005 9:22 am

Post by seanc217 »

Implicit should work. I have a file that has a variable piece to it. In front of the variable pieces are the legth of that field. By specifying that byte as the prefix, DataStage will know how to handle it.
psriva
Participant
Posts: 44
Joined: Fri Aug 11, 2006 8:40 am

Post by psriva »

Can you please give some example. I will be very thankful.

For eg:

I have the following columns (I have put them in a schema format)

record
nullable {record_format={type=implicit}, charset="ISO8859-1}
(
fname:string[max=15] {width=15}; //fixed width field

lname:string[max=20] {width=20}; //fixed width field

add_id:string; //variable length pipe delimited
field.
)


Does the above schema look right to you. Are there any other properties I need to add like mentioning that the variable width fields are pipe delimited,etc.,
ps
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Declare the fixed-width columns as being of type Char with an appropriate precision, but as soon as you have even one delimiter character, you must describe the record structure as delimited. If there are no delimiters between the "fixed-size" fields, you must read them as one and parse them within the job design.
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