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

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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.
 
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?
 
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
 
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.
 
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
 
Back
Top