Page 1 of 1

Record level properties

Posted: Fri Sep 08, 2006 8:46 am
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)

Posted: Fri Sep 08, 2006 8:56 am
by kumar_s
If it is fixed width, whats the point having delimiter, or the vise versa?
Can you give some example.

Posted: Fri Sep 08, 2006 9:51 am
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 ?

Posted: Fri Sep 08, 2006 12:14 pm
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.

Posted: Fri Sep 08, 2006 1:54 pm
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.,

Posted: Sun Sep 10, 2006 2:49 am
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.