Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Problem EBCDIC-ASCII conversion

Problem EBCDIC-ASCII conversion

Problem EBCDIC-ASCII conversion

I FTP'd a file, containing numbers and characters, from MVS OS/390 to a webfocus server using "binary" option. When I try to read the file, only numbers are readable. If I use "ascii" FTP option for transfert : only characters are readable.
I am affraid Webfocus try to read the ebcdic file as if it was an ascii file.
What should I do?

Thank you

RE: Problem EBCDIC-ASCII conversion

How was the file on MVS created? If by Focus, then you want a HOLD FORMAT ALPHA or SAVE, so that all the values are 'human readable'. Then, you can FTP the file, not as BINARY, but as ASCII.

If you created the file as HOLD or SAVB, the characters are in text, while the numbers are in 'internal format'. If you use FTP with BINARY, you'll only be able to read INTEGERS, as DOS and MVS have a different way of storing floating point (D or F) numbers. Packed will probably work, as well, because WEBFocus handles packed format on the PC (it's not a 'native' format).

If, on the other hand, you FTP'd the file as ASCII, FTP wouldn't KNOW how to transfer the numbers in internal format, but COULD translate the alpha fields.

RE: Problem EBCDIC-ASCII conversion

The file was created using a cobol program. So the numeric numbers are PIC S9(14)V9(4) COMP-3 , PIC 9(11) ,...

You are right.
If the file is ascii FTPed :
   - I can read alpha fields using Webfocus but I am not able to read the numeric fields.

If the file is binary FTPed :
   - I can read numeric and packed numeric using Webfocus but I am not able to read the alpha fields (which are EBCDIC coded on the PC because of the binary transfer). it should be great whether Webfocus could read them using EBCDIC encoding winky smile  ).

The solution I found is to unpack (with JCL) the numeric fields before FTP transfer. But I am not sure to be able to do that. Do you see an other way?

RE: Problem EBCDIC-ASCII conversion

There are several options available, depending on how much effort and dollars you want to invest.

The easiest to say (but perhaps the most difficult to implement) is to change the Cobol program, so numeric fields are NOT COMP-3. Then, as character strings, everything can be FTP'd, as ASCII.

If you have Focus on MVS, you can have Focus re-write the file, converting the internal format to 'external' (ALPHA) format, then FTP it as above.

As you pointed out, I'm SURE there's some IBM utility, which can convert EBCDIC to ASCII. The only problem is, I'm not sure it can do it on a column by column selection.

There's also IBI's Data Migrator. it may give you what you need.

RE: Problem EBCDIC-ASCII conversion

Thank you for your help,

We decided to use a Cobol program to make the file "FTPable".

FYI : A IBM Utility called IceTool could have been used too.


RE: Problem EBCDIC-ASCII conversion

there's the FTOA and PTOA functions, converting floating point to alpha and packed to alpha, in the focus language.
might that work for you at all?


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close