IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Packed decimal format in Windows PC


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Tue Aug 14, 2012 5:28 pm
Reply with quote

Hi

I have a file containing packed decimal (COMP-3) values . Further I downloaded this file (using FTP) to Windows PC in TEXT format (ASCII).

There are 2 questions for me on this regard:-
1) How can I ensure the packed decimal format (COMP-3) values are downloaded correctly in Windows PC. Is there any way for the verification.

2) Now if I upload this file (in TEXT format) back to Mainframe environment, they are showing different values (when HEX ON is enabled). What could be reason for this?

Any help appreciated..
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Aug 14, 2012 5:31 pm
Reply with quote

the packed decimal format will never be <transmitted> correctly with a text format...

packed decimal contains is not TEXT readable so translating it to ascii will simply result in garbage.


exchanging data between different platform requires TEXT ( aka readabel data
generally
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Tue Aug 14, 2012 5:33 pm
Reply with quote

As has been stated many times in the six years that you have been a member, presumably reviewing new posts on a regular basis to keep yourself informed and to avoid errors that you have just described, you should unpack all numbers before FTPing as FTP does conversion but FTP does not know the difference between character 1C and packed number 1C.
Back to top
View user's profile Send private message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Tue Aug 14, 2012 5:55 pm
Reply with quote

Thanks for the response

but I would like to know is there in way we can download packed format records to window PC,...Will binary format support? .. .let me know...

Thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Aug 14, 2012 5:57 pm
Reply with quote

and how would You process under windows a packed number ?

can be done naturally... but ?
Back to top
View user's profile Send private message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 39

PostPosted: Tue Aug 14, 2012 6:09 pm
Reply with quote

I just want to know if there is way for it... or is that it is not possible at all...

Just want to know..
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Tue Aug 14, 2012 6:39 pm
Reply with quote

You can, of course, download a file with packed decimal fields to a PC as a binary file. However, unless you have something like SAS on the PC (which supports use of S370FPDx. formats to read packed decimal EBCDIC data on the PC) there will be very little, if anything, you can do with the resulting file. It cannot be processed by any software I am aware of on the PC (other than SAS, of course). Conversion of the data would be messy since you would have to convert characters from EBCDIC to ASCII, plus read each byte of each packed dimcal value and create the actual value from the binary bytes, and so forth. And if the file has variable length records instead of fixed length, you can forget everything since the mainframe and PC use completely different methods for handling variable length records and it is quite difficult to deal with EBCDIC variable length binary records on the PC.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Aug 14, 2012 6:53 pm
Reply with quote

Don't send anything other than USAGE IS DISPLAY, in terms of Cobol.

Otherwise you have a big task to get you to the point you would have been at just after the transfer of the file which is DISPLAY only.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 14, 2012 7:07 pm
Reply with quote

Sumeendar wrote:
I just want to know if there is way for it... or is that it is not possible at all...

Just want to know..


the rest of the quote is as follows:

then I will know at least one thing!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Tue Aug 14, 2012 8:03 pm
Reply with quote

Hello,

You should download data from the mainframe to the pc using data-delimited text files. The Tab character (x'05') works very well.

Unless you have someone available who has converted packed-decimal, binary, etc on an ascii system, suggest you do not even try. Yes, it can be done but the effort is basically wasted. There are several "integrated" products that can handle this - but if you are not using one of them . . .

MicroFocus COBOL supports Packed-Decimal, but it is not the exact same as on the mainframe (at least it was different on UNIX).

Both Win-based systems and *nix do well with delimited data and there is no cause for jumping thru hoops.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Wed Aug 15, 2012 9:11 am
Reply with quote

There are a couple of editors on the PC that understand EBCDIC - SPFLite and SPF/Pro. Also the z390 cross-assembler understands EBCDIC and so I suspect that the associated zCOBOL does as well. But actual things like Office and Open Office do not - as far as I am aware.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed Aug 15, 2012 2:29 pm
Reply with quote

IMNSHO icon_biggrin.gif understanding EBCDIC is reasonably easy, not the same for PACKED data
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Help required to reset decimal points... DFSORT/ICETOOL 5
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
No new posts small int to zoned decimal conversion DFSORT/ICETOOL 3
No new posts Format Binary file to EBCDIC JCL & VSAM 4
Search our Forums:

Back to Top