How to read byte by byte in DS

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
Shree0410
Participant
Posts: 70
Joined: Tue Nov 29, 2005 7:25 pm

How to read byte by byte in DS

Post by Shree0410 »

How to read a string byte by byte in a job
For example my input string will have a value of SACHIN, I want to read S first, A second, C third so on..
I want to take S character convert into binary, take A, convert into binary and add both binary numbers and take C convert into binary add the value to previous so on..The lenght of the input string is not fixed, I may get N number of bytes.
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

Shree0410,

So what ever is the length of the string , you want to add all the character values in binary and the result of total sum also in Binary ?????

AND PLEASE MOVE THIS POST to PX
Shree0410
Participant
Posts: 70
Joined: Tue Nov 29, 2005 7:25 pm

Post by Shree0410 »

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

Post by ray.wurlod »

Surely this is the simplest of C functions to write?

Initialize a integer to 0, step through your string from postion 0 to len-1 taking the character value and incrementing your integer.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply