Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Packed decimal format in Windows PC

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Sumeendar

New User


Joined: 31 Jan 2006
Posts: 37

PostPosted: Tue Aug 14, 2012 5:28 pm    Post subject: Packed decimal format in Windows PC
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Aug 14, 2012 5:31 pm    Post subject: Reply to: Packed decimal format values
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: 1715
Location: UK

PostPosted: Tue Aug 14, 2012 5:33 pm    Post subject:
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: 37

PostPosted: Tue Aug 14, 2012 5:55 pm    Post subject: Reply to: Packed decimal format values
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Aug 14, 2012 5:57 pm    Post subject: Reply to: Packed decimal format values
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: 37

PostPosted: Tue Aug 14, 2012 6:09 pm    Post subject: Reply to: Packed decimal format values
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: 7913
Location: Bellevue, IA

PostPosted: Tue Aug 14, 2012 6:39 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Tue Aug 14, 2012 6:53 pm    Post subject: Reply to: Packed decimal format values
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    Post subject: Re: Reply to: Packed decimal format values
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

Site Director


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

PostPosted: Tue Aug 14, 2012 8:03 pm    Post subject:
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: 1715
Location: UK

PostPosted: Wed Aug 15, 2012 9:11 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Aug 15, 2012 2:29 pm    Post subject: Reply to: Packed decimal format values
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm
This topic is locked: you cannot edit posts or make replies. output data in CSV Format janmejay DFSORT/ICETOOL 3 Sat Oct 15, 2016 2:16 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us