EBCDIC to ASCII --part2--

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

EBCDIC to ASCII --part2--

Post by admin »

Ok.
It seems to be converting the EBCDIC to ASCII but there are the following problems:
- Do you use the sequential file !?! The mainframe EBCDIC file is binary.
- When do you know when the next row starts?

I created the job like this:

[[[MAINFRAME_FILE(ebcdic)]]] ----> [TRANSFORMER] -----> [[OUTPUT_FILE(ascii)]]

In the transformer I have the following :

TheString Varchar 5000 --------------------> ASCII(OUTPUT_FILE.TheString1)

I can look at the data, but not everything looks right!?

Any suggestions... ?
Pieter





-----Original Message-----
From: Ray Wurlod [mailto:ray.wurlod@Informix.Com]
Sent: Thursday, October 11, 2001 12:13 PM
To: datastage-users@oliver.com
Subject: RE: EBCDIC to ASCII


There are two complementary functions.
ASCII(x) will convert from EBCDIC to ASCII.
EBCDIC(x) will convert from ASCII to EBCDIC.

HOWEVER-----
Beware that there is more than one variant of EBCDIC. (This is particularly true in Japan.)


-----Original Message-----
From: Brundyn, Pieter [mailto:pbrundyn@metropolitan.co.za]
Sent: Thursday, 11 October 2001 19:38
To: datastage-users@oliver.com
Subject: EBCDIC to ASCII


Is there a function in datastage that will convert EBCDIC to ASCII !?

thanks
pieter
NOTICE:

This message contains privileged and confidential information intended only for the person or entity to which it is addressed.

Any review, retransmission, dissemination, copy or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient, is prohibited.

If you received this message in error, please notify the sender immediately by e-mail, facsimile or telephone and thereafter delete the material from any computer.

The New Africa Capital Group, its subsidiaries or associates do not accept liability for any personal views expressed in this message.
NOTICE:

This message contains privileged and confidential information intended
only for the person or entity to which it is addressed.

Any review, retransmission, dissemination, copy or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient, is prohibited.

If you received this message in error, please notify the sender immediately by e-mail, facsimile or telephone and thereafter delete the material from any computer.

The New Africa Capital Group, its subsidiaries or associates do not accept liability for any personal views expressed in this message.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

"Brundyn, Pieter" wrote:

> It seems to be converting the EBCDIC to ASCII but there are the following problems:
> - Do you use the sequential file !?! The mainframe EBCDIC file is binary.
> - When do you know when the next row starts?

My understanding is that if you have packed decimals in the file, you cannot do file-level conversion (otherwise, you could use any binary->ascii functionality such as in FTP products). Here is what we do. It may not be best practice, so I will be following other answers that you
get:

We get the field layout for the EBCDIC file.
We treat the EBCDIC file as a sequential file.
We use the file to determine the column lengths and then create the meta data for the sequential file. We write a transformer to map straight EBCDIC columns into a hash file using the ASCII() function. We use the appropriate compressed decimal function to map any packed values to the hash file in this same transformer. We examine the data in the hash file to make sure we have accommodated the correct row length.

Once we understood the process, it has been very straight-forward...

Dan Paolini
State of NJ
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Be also aware of the potential for pure binary integers, which also might be
in the file, amongst the other character EBCDIC data. The Packed fields
are COMP-3, if cobol is the source, and COMP fields are pure binary (so you need to use the DataTypePicComp transform instead of the DataTypePicComp3 function.

Ernie

-----Original Message-----
From: Dan Paolini [mailto:daniel.paolini@oit.state.nj.us]
Sent: Thursday, October 11, 2001 9:56 AM
To: datastage-users@oliver.com
Subject: Re: EBCDIC to ASCII --part2--


"Brundyn, Pieter" wrote:

> It seems to be converting the EBCDIC to ASCII but there are the
> following
problems:
> - Do you use the sequential file !?! The mainframe EBCDIC file is
binary.
> - When do you know when the next row starts?

My understanding is that if you have packed decimals in the file, you cannot do file-level conversion (otherwise, you could use any binary->ascii functionality such as in FTP products). Here is what we do. It may not be best practice, so I will be following other answers that you
get:

We get the field layout for the EBCDIC file.
We treat the EBCDIC file as a sequential file.
We use the file to determine the column lengths and then create the meta data for the sequential file. We write a transformer to map straight EBCDIC columns into a hash file using the ASCII() function. We use the appropriate compressed decimal function to map any packed values to the hash file in this same transformer. We examine the data in the hash file to make sure we have accommodated the correct row length.

Once we understood the process, it has been very straight-forward...

Dan Paolini
State of NJ
Locked