Char(0) being stored in Sequential file

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
rsadevelopers
Premium Member
Premium Member
Posts: 8
Joined: Wed Nov 16, 2011 2:11 pm

Char(0) being stored in Sequential file

Post by rsadevelopers »

Hi All, we have a simple job that at times writes rows with x00 to a sequential file. The job does not abort and seems to complete successfully. If we find x00 in the file we re-run the job and it works fine. Each column in the basic transformer calls a routine that removes special characters.

Job Design:

Dataset---->Filter---->Basic Transformer---->Sequential File

Here is the code for the routine that we call for each column:

Code: Select all

Ans=Ereplace(Convert(char(160)," ",Convert(char(162)," ",Convert(char(172)," ",Convert(char(194)," ",Convert(char(199)," ",Convert(char(201)," ",Convert(char(204)," ",Convert(char(233)," ",Convert(char(13)," ",Convert(char(10)," ",Convert(char(63)," ",Convert(char(0)," ",Convert("`"," ", RawString))))))))))))),'"','""')

if Index(Ans,'"',1) > 0 or Index(Ans,'|',1)>0 
then Ans = '"':trim(trim(Ans," ","L")," ","T"):'"'

Ans = trim(trim(Ans," ","L")," ","T")
Anyone know what might be going on?

Thanks in advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard.

If you are using Char data type, then DataStage will pad these to the designated length using the character specified in APT_STRING_PADCHAR, the default value of which is 0x00.

If you want it to pad Char data types with space, change the value of APT_STRING_PADCHAR to space, or to 0x20.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rsadevelopers
Premium Member
Premium Member
Posts: 8
Joined: Wed Nov 16, 2011 2:11 pm

Post by rsadevelopers »

Hi Ray, APT_STRING_PADCHAR is already set to 0x20

It's strange in that if we find nulls in the file We re-run and file look fine.

There are many jobs running at the same as the files are being created and I/O is very heavy. Not sure if this could be the cause.
Post Reply