Count of Delimiter(special character) in a Record

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
senthilt1
Participant
Posts: 134
Joined: Mon Nov 19, 2007 2:17 am

Count of Delimiter(special character) in a Record

Post by senthilt1 »

Hi All,

I am having the records with delimiter as ascii value \013.

I wanted to find out the number of delimiter(\013) available in the single record.

I tried it using Count(Inputfield,"\013") but its checking for \013 in the record not for the delimiter.

so if my delimilter is of some special characters, then how to find out the counts in a record?

Could anyone tell me the solution for this?

Thanks,

Senthil P
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am

Post by ArndW »

Code: Select all

Count(InputField,CHAR(13))
should do the trick for you.
<a href=http://www.worldcommunitygrid.org/team/viewTeamInfo.do?teamId=TZ9H4CGVP1 target="WCGWin">
Image</a>
senthilt1
Participant
Posts: 134
Joined: Mon Nov 19, 2007 2:17 am

Post by senthilt1 »

Hi ArndW,

My Delimiter is Vertical tab. I want to know the count of my Delimiter in a record. i used Count(InputField,CHAR(13)) as you suggested. But its not working.

Please let me know about this.

Thanks,

Senthil P
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am

Post by ArndW »

The vertical tab ASCII character is 11, not 13.
<a href=http://www.worldcommunitygrid.org/team/viewTeamInfo.do?teamId=TZ9H4CGVP1 target="WCGWin">
Image</a>
senthilt1
Participant
Posts: 134
Joined: Mon Nov 19, 2007 2:17 am

Post by senthilt1 »

HI ArndW,

You are correct!!!

Now Count(InputField,CHAR(11)) to find out the vertical tab delimiter is working fine.

13 is the octal value for the vertical tab. 11 is the decimal value for the vertical tab

Thanks a lot.

Senthil P
nagarjuna
Premium Member
Premium Member
Posts: 533
Joined: Fri Jun 27, 2008 9:11 pm

Post by nagarjuna »

Now Its time to mark this topic as resolved :D
Nag
Post Reply