MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Packed Format

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Other Technical Topics
View previous topic :: View next topic  
Author Message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Thu Feb 20, 2003 7:59 am    Post subject: Packed Format Reply with quote

Hi,

I just needed to know whether it is possible to read and interpret packed data outside mainframe. What I mean is that suppose I have a seq dataset containing packed data and I download it to my local PC in a text file. Is it possible to convert the packed data to character format using any sort of Xref. Is there any such Xref available using which I can convert the packed data to its corresponding character format.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Thu Feb 20, 2003 10:39 am    Post subject: Reply with quote

The problem is that a TEXT download of data requires a translation from EBCDIC to ASCII, and that requires tables that vary depending on what mechanism / vendor package is being used to do the download. Since packed data can consist of data bytes with EBCDIC hex values from 00-09, 10-19, 20-29, etc., as well as 1C, 1D, 1F, 2C, 2D, 2F, etc., you would need to know exactly what ASCII hex values those would translate to during the download.

Ron
_________________
A computer once beat me at chess, but it was no match for me at kick boxing.
Back to top
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Fri Feb 21, 2003 3:29 am    Post subject: Reply with quote

Hi Ron,

There is no problem in conversion of EBCDIC to ASCII. Almost all the FTP packages can handle that. As far as I understand, what you mean to say is that if we know exactly the ASCII hex values(that the FTP transalates to) that correspond to the EBCDIC hex values in the mainframe, we can write a generic routine that can read the data byte by byte and convert it to text.
Please confirm this assumption of mine.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Fri Feb 21, 2003 11:45 am    Post subject: Reply with quote

Right you are, Manas. E.G. if EBCDIC x'12' always translates to ASCII x'b2' then all that is needed is to 'untranslate' x'b2' to = text '12'. Be sure to allow for the last byte having a sign - e.g. if EBCDIC x'4d' always translates to ASCII x'ed', then it must be 'untranslated' as text '4' AND the numeric value of the entire 'untranslated' field must be negated.

Ron
_________________
A computer once beat me at chess, but it was no match for me at kick boxing.
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Sat Feb 22, 2003 1:08 pm    Post subject: Reply with quote

Nope. One of the translations that FTP does in a text download (ascii, ebcdic, whatever), is modification of the carriage return line feeds. If your packed data happens to look like a carriage return or line feed, it may be changed or lost completely. You'll have to use binary. It doesn't make sense to take a binary field. translate it to ascii and back. Not only are special characters lost, but use of a different code page will destroy other characters.
Back to top
View user's profile Send private message Visit poster's website
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Mon Feb 24, 2003 1:49 am    Post subject: Reply with quote

Actually, the best bet would be to change those packed fields to unpacked on the mainframe and then transfer the dataset. You can use sort or other utilities to do this. Like semigeezer says, otherwise you will have to transfer binary and do all the work translating to ascii on your pc, which will be a hassle.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Other Technical Topics All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group