Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem EBCDIC-ASCII conversion

Status
Not open for further replies.

polo022

Programmer
Mar 14, 2006
15
0
0
LU
Hello,
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
 
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.
 
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 ;-) ).

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?



 
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.
 
Hello,
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.

Tks
 
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?

-SUSANNAH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top