Operating System - HP-UX
1824934 Members
3784 Online
109678 Solutions
New Discussion юеВ

UNIX to read a mainframe file

 
SOLVED
Go to solution
Dewa Negara_4
Regular Advisor

UNIX to read a mainframe file

Hi All,

Can anyone help to answer this question?

Can a UNIX device read a variable length mainframe file with packed data from a mainframe tape?

Thanks and Best Regards,
Negara

Santos
7 REPLIES 7
Steven E. Protter
Exalted Contributor
Solution

Re: UNIX to read a mainframe file

Shalom,

It depends how the tape was created.

I have my doubts, but there are cross platform utilities designed to facilitate this.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Peter Godron
Honored Contributor

Re: UNIX to read a mainframe file

Patrick Wallek
Honored Contributor

Re: UNIX to read a mainframe file

Variable length may be difficult. If the file were fixed length, you might be able to accomplish this with 'dd' and IBC, OBC and CONV options.

I have done this in the past, but it has been a while.
A. Clay Stephenson
Acclaimed Contributor

Re: UNIX to read a mainframe file

I've certainly done this in the past but for variable length records, you are going to have to write a program because utilities like dd cannot do this. Your first task is to have a very tightly defined description of the data layout. Your task is actually in two parts: 1) Reading the data 2) Converting the data (e.g. EBCDIC to ASCII for string fields, one binary format or BCD to another).

Typically variable length data contains a record length in the first few bytes of a file and you read that to then determine the length of the current record and the next record begins just beyond the current record.

If it ain't broke, I can fix that.
Dewa Negara_4
Regular Advisor

Re: UNIX to read a mainframe file

Hi All,

Thanks alot for those information. My conclusion is that it is still difficult to do with a varible length and packed data.

Best Regards,
Negara
Santos
Steven E. Protter
Exalted Contributor

Re: UNIX to read a mainframe file

Good conclusion.

If you could get the data via ftp, you would avoid OS issues but still need to write a custom program to access the data.

Good luck,

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: UNIX to read a mainframe file

Negara, you have a very good grasp for the obvious. If possible, I would turn the problem around and request a fixed-length, unpacked, version of the data, preferably with any binary data converted to text, any text converted from EBCDIC to ASCII, and each record ending with a linefeed. Even in this case, you are still left with data conversion problems but now a script will suffice and you can use a host of standard utilities whereas before your only choices were a real program (C,C++,COBOL,FORTRAN,Pascal, etc.) or Perl.

If it ain't broke, I can fix that.