View previous topic :: View next topic
|
Author |
Message |
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
|
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
and how would You process under windows a packed number ?
can be done naturally... but ? |
|
Back to top |
|
|
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
IMNSHO understanding EBCDIC is reasonably easy, not the same for PACKED data |
|
Back to top |
|
|
|