Working with HEX data

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
cyh
Participant
Posts: 18
Joined: Tue Jan 20, 2004 3:23 am

Working with HEX data

Post by cyh »

I have define a fields to be char(2), and use it to store data generated from mainframe.

The data looks like this (in hex representation) : \x0001

Is it possible to extract the content '0001' to another string?

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

Post by ray.wurlod »

Explore the Iconv function with conversion codes like "MX0C" and "MY" in the on-line help. Select the one that is most likely to suit your needs.

Because you specify \x0001 is being loaded into CHAR(2), I'm assuming you're using ASCII or some other single-byte character set.

Beware of two problems.
  • \x00 is NUL which is a string terminator character. This would not load anything into the first character position - the result of loading \x0001 would be a one-character string containing \x01.

    \x01 through \x1F are non-printing characters.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
cyh
Participant
Posts: 18
Joined: Tue Jan 20, 2004 3:23 am

Post by cyh »

I'm not quite sure about Iconv function, is it for Sequential Stage or PX ?
It is available in Transformer in a PX job?

I got some hint from my fx, for example

Convert(Chr(0),"0000",AAA)

Any idea about this function?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Iconv() and its partner function Oconv() are primarily for server jobs.
You posted your query in what it intended to be the server jobs forum; I know you are aware of the parallel jobs forum because you also post there.
These BASIC functions are available in PX (parallel jobs) but only in limited circumstances - though there are more opportunities to use BASIC expressions for control in version 7.5 parallel jobs.
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