Operating System - HP-UX
1820636 Members
1850 Online
109626 Solutions
New Discussion юеВ

EBCDIC to ASCII excluding packed fields; help in installing fcopy

 
Ernie De Guzman
Advisor

EBCDIC to ASCII excluding packed fields; help in installing fcopy

I searched the forum and I found one that directly relates to my problem but it was from Sept. of 2000. The resolution was to install tcl that will include fcopy and then use fcopy to convert EBCDIC to ASCII excluding packed fields. I downloaded different versions of tcl and they are with .depot extension. I did not find any instructions on how to install them so I assumed I will use swinstall. I was able to install the different versions but I still could not find fcopy. My machine is a HP9000 running HPUX 11.0. Hope somebody out there can help me. Thanks.
5 REPLIES 5
Rory R Hammond
Trusted Contributor

Re: EBCDIC to ASCII excluding packed fields; help in installing fcopy

Not sure if I can help but. I get files from our VM system that are ebcdic. I convert them using dd


dd if=vmfile.txt of=ascii.txt file conv=ascii

In a previous life I have used
dd if=vmfile.txt of=ascii.txt conf=ibm

man on dd will help.
There are a 100 ways to do things and 97 of them are right
A. Clay Stephenson
Acclaimed Contributor

Re: EBCDIC to ASCII excluding packed fields; help in installing fcopy

Dd won't work because it's all or nothing. When you convert any string data to ASCII, you will instantly clobber any binary/packed data at the same time.

I don't know nothing about no fcopy but I did make one forum customer happy with a Perl solution. There is also a reference to a commercial utility called "FilePort" but Perl's Convert::EBCDIC makes this rather easy.

http://forums1.itrc.hp.com/service/forums/parseCurl.do?CURL=%2Fcm%2FQuestionAnswer%2F1%2C%2C0xefcfd7d96cbad711900a0090279cd0f9%2C00.html&admit=716493758+1066770268199+28353475
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: EBCDIC to ASCII excluding packed fields; help in installing fcopy

Uh-oh Debbie:

It looks like when the Forums were migrated to the new Oracle/HP-UX environment my square brackets were mangled. I copied it back down and fixed the strange characters. I'll attach the Perl example script; that will also have the desired effect of preserving formatting so that the code is more readable.

If it ain't broke, I can fix that.
Ernie De Guzman
Advisor

Re: EBCDIC to ASCII excluding packed fields; help in installing fcopy

Thanks guys. Clay, I will try your solution and thanks for the perl code as I don't really have a knowledge of it. I know I installed Perl 5 last year but don't have the programming side of it. I will give you guys some feedback after I tried the solution.
Bill Hassell
Honored Contributor

Re: EBCDIC to ASCII excluding packed fields; help in installing fcopy

fcopy is likely the HP 3000 (MPE operating system) program that understands dozens of filetypes and can perform smart data conversion. I've not seen fcopy ported to any Unix system as it would involve a significant rewrite. The world of Unix is easy...no filetypes except specials like fifo, device, directory, etc. Otherwise, the file is defined by the program that created it...all files are simply a series of characters.

The mainframe and commercial opsystem world (like MPE) are very different. There are fixed record and blocking factors like 80x10, EBCDIC, packed decimal, ASCII header formats, and the list gets really long. Generally, few mainframe file formats are portable even among other mainframes.

So you'll need an exact definition for all the records on the media (tape, LAN, ftp, etc) including headers and trailers, then write a program that can read the raw data, break up the fields and exclude the ones you don't want and output the result in a format useful on HP-UX.


Bill Hassell, sysadmin