how do i set up a Cobol Comp-3 data field in Excel?

G

Guest

I transfer a file from the mainframe to text. Several data fields are comp-3
(s9(13)v99). These compress data fields are not readable under Excel and/or
Access. What can I do to get them to numeric fields?
 
D

Dave Peterson

Any chance you could convert the numbers on the mainframe side?

IIRC, lots of FTPs from mainframe to pcs will translate characters when they do
the transfer (broken vertical bar becomes a vertical bar, for example.)

If you're unlucky enough to get a combination of in one of your bytes that does
that conversion, your data could be screwed up.
 
D

Dave Peterson

Tom Ogilvy responded in a different thread:

If you specify a binary transfer they shouldn't.

==========
I don't have access to a mainframe anymore, but IIRC, not all the text came
through correctly.

Am I mis-remembering?
 
T

Tushar Mehta

I transfer a file from the mainframe to text. Several data fields are comp-3
(s9(13)v99). These compress data fields are not readable under Excel and/or
Access. What can I do to get them to numeric fields?
No, the packed decimal fields are not readable by anything but COBOL!
For some options search google. You'll find several hits including
http://www.room42.com/store/computer_center/packed_decimal.shtml

Your best bet it would appear would be to do the translation with a
COBOL program on the mainframe.

As Dave implied a text transfer of the file will almost certainly
corrupt it. I imagine you could do a binary transfer, open the
transfered file as a binary file in a VB(A) program, and do the
translation that way but it would be a lot of work.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
D

David McRitchie

Packed Decimal (COBOL COMP-3) is not recognized on PC
or other ASCII machines, so you will you will have to convert them
to Picture strings in COBOL and preferably you have all positive
numbers.

Packed Decimal is part of the IBM 360 instruction set so it is
recognized in a variety of languages not just COBOL. Since the poster
mentioned COBOL it would most like be that the file layout has only
been defined in COBOL and certainly best handled in the same language
on a mainframe.
 
T

Tushar Mehta

I was afraid someone might call me on that "COBOL only" bit but I
figured my phrasing had more of an impact. {grin}

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top