Page 1 of 1

Load into Fixed length file

Posted: Wed Jun 09, 2010 2:30 am
by sureshreddy2009
Hi,

I have a delimited file , I am reading that through sequential file stage after that I am using aggregator,lookup and transformer as a part of transformation process, Finally I want to load into a fixed length file , How can I load into this file and what are the options to select in sequential file stage at target level.

Re: Load into Fixed length file

Posted: Wed Jun 09, 2010 2:35 am
by antonyraj.deva
If the file's table definition is defined as fixed length columns, then the load will be automatically done.

Firstly, Did you try loading data in to the target file? :?:

Thanks,
Tony

Posted: Wed Jun 09, 2010 2:47 am
by sureshreddy2009
The job is running successfull and the data is also loaded into file but not in the format i expected.
As you said there is no option directly saying that fixed length, there are 8 columns in my output, the sum of length of all columns is 112, so i mentioned 112 as a value in the option record length which is there in the format tab of sequential file stage, still the data is not coming as expected.
The data is coming like this.
Batch_ID file_name stage_count target_count status
1 address 23 34 success
2 client 34 23 failure

But i need the data like

Batch_ID file_name stage_count target_count status
1 address 23 34 success
2 client 34 23 failure

Posted: Wed Jun 09, 2010 2:54 am
by sureshreddy2009
My expected file is like the following
I am pasting again as the format in previous post is not proper
even if null is coming in any value it has to give spaces equal to length

Posted: Wed Jun 09, 2010 3:34 am
by ArndW
Change your output sequential file stage format to fixed-width fields and no delimiters.

Re: Load into Fixed length file

Posted: Wed Jun 09, 2010 3:38 am
by antonyraj.deva
antonyraj.deva wrote:If the file's table definition is defined as fixed length columns, then the load will be automatically done.
In the table definition if the length of the columns are specified exactly, then the nulls also will have spaces equal to the length mentioned.
sureshreddy2009 wrote:The data is coming like this.
Batch_ID file_name stage_count target_count status
1 address 23 34 success
2 client 34 23 failure

But i need the data like

Batch_ID file_name stage_count target_count status
1 address 23 34 success
2 client 34 23 failure

Is there any difference between the requirement and the current output... :?

Thanks,
Tony

Posted: Wed Jun 09, 2010 4:13 am
by ray.wurlod
And, as noted, the Null Field Value for fixed width must contain the same number of characters as are defined for the field.

Posted: Wed Jun 09, 2010 5:57 am
by sureshreddy2009
But Null Filed Value () option will take the value common for all , Here i have different length for different columns so, How can I mention the null field value specific to fields.I am stilll working on it to get desired output.

Basically my need is i am creating a file using datastage and that file contians 8 columns ,first one is batchid and next 5 columns are count columns and last 2 columns are varchar fields .
after datastage one script is running to mail the contents of this mail as body in the mail, the body in the mail is in jumbled format and not in a readable format.so I decided to load in a fixed length format to view the report perfectly when we get the mail , this is a audit balance report for checking the record count

Posted: Wed Jun 09, 2010 5:59 am
by sureshreddy2009
But Null Filed Value () option will take the value common for all , Here i have different length for different columns so, How can I mention the null field value specific to fields.I am stilll working on it to get desired output.

Basically my need is i am creating a file using datastage and that file contians 8 columns ,first one is batchid and next 5 columns are count columns and last 2 columns are varchar fields .
after datastage one script is running to mail the contents of this mail as body in the mail, the body in the mail is in jumbled format and not in a readable format.so I decided to load in a fixed length format to view the report perfectly when we get the mail , this is a audit balance report for checking the record count

Posted: Wed Jun 09, 2010 1:39 pm
by vinnz
How can I mention the null field value specific to fields.
In your target Sequential File stage, go to the Columns tab, right click on a column and choose 'Edit Row'. Then specify the Null Field Value for each column under the Nullable properties. As noted, specify the null field value for each column with the same number of characters as the length