writing Null field on a fixed width sequential file
Moderators: chulett, rschirm, roy
writing Null field on a fixed width sequential file
All,
Before posting this actually i did a little search on the available forums and tried the something on the Job.
But nothing is success full,
We need to write a Null field value(Nullable = yes) on a fixed width sequential file.i.e
if col1 is varchar(10) then I hope i can give Null field value property
as ' '(10 spaces).
but if i have more columns or the length is more for each columns
then this will be a overhead.
Anybody have an idea on this?
While searching i found some patch like APT_IMPEXP_ALLOW_ZERO_LENGTH_FIXED_NULL
is this necessary to achieve this?
thanks in advance,Edi
Before posting this actually i did a little search on the available forums and tried the something on the Job.
But nothing is success full,
We need to write a Null field value(Nullable = yes) on a fixed width sequential file.i.e
if col1 is varchar(10) then I hope i can give Null field value property
as ' '(10 spaces).
but if i have more columns or the length is more for each columns
then this will be a overhead.
Anybody have an idea on this?
While searching i found some patch like APT_IMPEXP_ALLOW_ZERO_LENGTH_FIXED_NULL
is this necessary to achieve this?
thanks in advance,Edi
SOrry DSguru!
JOb failed saying like
"liability_column_rename: Error when checking operator: When binding output schema variable "outRec": When binding output interface field "OID" to field "LIABILITY_OID": Implicit conversion from source type "decimal[31,0]" to result type "string[31]": Not enough room in string for decimal[31,0]. [api/interface_rep.C:6257]"
Any idea?
FYI,now I haven't specify any of the "Edit columns" Property.
Thanks,Edi
JOb failed saying like
"liability_column_rename: Error when checking operator: When binding output schema variable "outRec": When binding output interface field "OID" to field "LIABILITY_OID": Implicit conversion from source type "decimal[31,0]" to result type "string[31]": Not enough room in string for decimal[31,0]. [api/interface_rep.C:6257]"
Any idea?
FYI,now I haven't specify any of the "Edit columns" Property.
Thanks,Edi
Kumar,
I am just doing a direct writing into a file
file should be fixed width (no delimiter required)
i/p example
then output in fixed width file should be like
Hope this could explain the need better.
thanks,Edi
I am just doing a direct writing into a file
file should be fixed width (no delimiter required)
i/p example
Code: Select all
Record 1
col1(decimal 5) = 1234 & col2varchar(4) = abcd & col3 decimal(2) = 12
record 2
col1(decimal 5) = 4568 & col2varchar(4) = Null & col3 decimal(2) = 78
record 3
col1(decimal 5) = 0345 & col2varchar(4) = wxyz & col3 decimal(2) = Null
Code: Select all
1234abcd12
4568 78
0345wxyz
thanks,Edi
Well when I said 'Specify it as char', I meant specify it as char and take care of the explicit conversion. On second thought, if you leave the decimal values as decimal and specify the fill character as 0 you should be fine. This way for decimal(4) if you get 123, you will actually write 0123 to the file. You should be able to find this property in extended properties.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Thanks DS!
I am just writing the data onto a sequential file!
if i neeed to do an explicit conv then i need a transformer which i can't use!
need to write the buidop code for that.
so i am trying to avoid transformer.
so.the final answer is if i want to write the decimal field which may have null value into a fixed length file then we should be specifying the nul field value as the spaces like ' '.
is that right?
thanks,edi
I am just writing the data onto a sequential file!
if i neeed to do an explicit conv then i need a transformer which i can't use!
need to write the buidop code for that.
so i am trying to avoid transformer.
so.the final answer is if i want to write the decimal field which may have null value into a fixed length file then we should be specifying the nul field value as the spaces like ' '.
is that right?
thanks,edi
Try with that, I dont know if you will get four spaces. Thats why I advised to use char in the first place. I know for sure with char you will get four spaces. You can also use modify stage for explicit data type conversions.
Otherwise you can specify x number of zeros where x is the length of your decimal field.
Otherwise you can specify x number of zeros where x is the length of your decimal field.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sorry Ds!
I mean to say if col1 length of 5 then
null field value property like'five spaces'
the reason for not using modify is
it's breaking the metadata mapping & also i need to rename most of the columns.so for each and every column,i need to write a specification.
anyway..thanks for your time DS.
Kumar any thoughts?
thanks,Edi
I mean to say if col1 length of 5 then
null field value property like'five spaces'
the reason for not using modify is
it's breaking the metadata mapping & also i need to rename most of the columns.so for each and every column,i need to write a specification.
anyway..thanks for your time DS.
Kumar any thoughts?
thanks,Edi
I am reading data from a datasetkumar_s wrote:What is your current job design (What is your source)?
Why can't you use Transformer? ...
Renaming the columns
Writing on to the fixed width sequential file (no delimiter)
Transformer!! ?? I dono how i am going to write buidop code for all transformation rules...thinking about convince my Lead!
Thanks, Edi