EBCIDIC to ASCII Conversion and low values

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
phyllis
Participant
Posts: 34
Joined: Wed Jan 14, 2004 4:07 pm

EBCIDIC to ASCII Conversion and low values

Post by phyllis »

I'm trying to convert a mainframe file from EBCIDIC to ASCII and it appears to be failing due to low values. What happens in DataStage when an EBCIDIC to ASCII conversion hits low values? What would be the resulting output - null? Zeros?

The entire field may not be low values, for example:

The conversion being used is:
DataTypeEbcdicToAscii(filename.M_NUM)

M_NUM char(5) is being converted to varchar(5) and written to an Oracle table.

Example "normal" field input would be Q3205

The input field being processed is an input text column with all binary zeros (hex 00).
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There are fewer code points in EBCDIC than in 8-bit ASCII. The first thing to do is to verify that the "low values" you're getting are, indeed, legal EBCDIC encodings. (Find a table of EBCDIC values, for example here and you will see, for example, that 008 and 009 are not code points in EBCDIC.

Characters "0" through "9" are represented by bytes 240 through 249 (F0 through F9 in hex) in EBCDIC. Get a hex editor and look at your data to make sure that this really is what's there.

The underlying BASIC function ASCII (which you can find in your DataStage BASIC manual), has been around for more than 20 years, so any bugs in it have long since been resolved.

Also make sure that your data do not contain NULL.
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