length of text file truncated...

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
srinath51
Participant
Posts: 61
Joined: Wed Aug 31, 2011 10:47 am
Location: United States

length of text file truncated...

Post by srinath51 »

Hi All,

i am generating a text file as an Output with the SIze as 1200Bytes.

i have data for the 444 bytes of data and as per the Req I have to append 756 bytes of remaining data with Spaces.

My question is when i hard-code the 756 bytes of data with the Spaces and Run the job and see the text file then in the final text file,i am getting the data truncated.
so in the final output text file instead of getting 1200 bytes of data i get only 953 bytes of data ,somehow the last 247 bytes are being truncated...

Please Help me on how i can see the 1200 byte data as per req...
Sri.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

What is your output schema?

How are you populating the additional spaces? In a transformer? What is the derivation?

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
srinath51
Participant
Posts: 61
Joined: Wed Aug 31, 2011 10:47 am
Location: United States

Post by srinath51 »

Hi Jwiles,

i am writing the output to a Sequential file.

i am populating the Additional Spaces i.e; 756 within the transformer.

the Derivation is - Space(756)
Sri.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

What is your output schema (i.e. metadata), especially for the new data? Hint: Sequential File stage is NOT a schema...

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
srinath51
Participant
Posts: 61
Joined: Wed Aug 31, 2011 10:47 am
Location: United States

Post by srinath51 »

HI JWILES,

I didnt understand the question...
Do you mean the format for the output file ??

the output file has 2 predefined fields named "fixedrec1" & "fixedrec2"

the format is varchar.
Sri.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

As a Datastage developer, you should understand the question...it is common terminology for DataStage and is discussed during DS training and constantly here on the forums.

Yes..the layout/format of the file. As in:

Code: Select all

Field1  VarChar(250)
Field2  VarChar(250)
Your answer tells me there are two varchar fields, but tells me nothing about defined lengths (if any), leaving me and others to either make assumptions (which can often be incorrect and is dangerous) or to pry further details from you to build a complete picture of the situation and job design.

As you are apparently working with fixed-length records (is this correct?), have you tried defining the columns as Char instead of VarChar?

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
srinath51
Participant
Posts: 61
Joined: Wed Aug 31, 2011 10:47 am
Location: United States

Post by srinath51 »

Hi Jwiles,
i am a junior Datastage developer,learning ...

Here is the layout for the fields:
i didnt define the lengths of the fields below,they are fixed lengths.

fixedrec1 varchar
fixedrec2 varchar

i tried using the char,but still getting the truncated data for the last 247 bytes of data...
Sri.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

No worries...we all have to start somewhere.

In IS 8.5 I can successfully create a 1200 byte record using the method you described. I'm not aware of a limitation within 7.5 concerning the data length and have no way to test in that version.

Do your input records (containing only one column?) ALWAYS contain exactly 444 bytes of data? Are they in a sequential file or coming from another data source such as a database? If your incoming data is short (<444 bytes), then you probably need to make up the difference in your job so that your output is 1200 bytes.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
srinath51
Participant
Posts: 61
Joined: Wed Aug 31, 2011 10:47 am
Location: United States

Post by srinath51 »

hi jwiles,

now i defined the lengths as 444 and 756 respectively for the fields and i am getting the 1200 bytes data.

thanks for your suggestions....
Sri.
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

A simpler way may just be to have one output column of type char and length 1200 setting the pad character to space
Post Reply