#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2002
    Posts
    6
    Rep Power
    0

    C program for unpacking packed data from mainframe (Urgent)


    Hi,
    Can someone help me with a C program on Unix(Or with any site where I can get one) to unpack packed data from mainframe.

    Please reply ASAP.

    Thanks,
    VSK
  2. #2
  3. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    Any specific reason why this has to be a C program? Why not just use a shell script?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2002
    Posts
    6
    Rep Power
    0
    Anything is fine shell script, perlscript or a c program.
    The data that we are getting in the file from Mainframe contains both character data as well as packed data .

    I tried dd if=file1 of= file2 conv=ascii but am not able to get the o/p.


    Thanks,
    VSK
  6. #4
  7. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    What kind of file is it?
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2002
    Posts
    6
    Rep Power
    0
    Its a data file wherein the data format looks like this inside the file
    field1filed2field3.packed1packed2field4packed3

    where
    field1,field2,filed3,field4 are character data
    packed1,packed2,packed3 are packed binary data from mainframe some COMP3 format and these fields contain the amount.

    Thanks,
    VSK
  10. #6
  11. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    so you are saying that the file is compressed in COMP 3 format?
    Do you have a utility that can uncompress this format?
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2002
    Posts
    6
    Rep Power
    0
    No I dont have any utilityto uncompress.
    As per my knowledge the file is not compressed in COMP-3 format .
    It is the data that is compressed.
    And the file contains a mixture of both character data and packed binary data as mentioned in the earlier reply.

    Thanks,
    VSK
  14. #8
  15. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    What are you/they using to create the file with?
  16. #9
  17. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2002
    Posts
    6
    Rep Power
    0
    I am not aware as to what they are using to generate the file.
    I tried to get that information but the system which generates the file is mainframe and we have no contact with those guys.
    Isn't there any generalized program to unpack the data.

    We need this to be done on an urgent basis.

    Thanks,
    VSK
  18. #10
  19. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    I really don't know, especially without knowing what kind of file it is.
    You will have to contact the people who produce the file and find out what they use to compress it.
    This would be easy enough if it was in tar, zip, bzip2 or any of the other common compression utilities, but I am at a loss as to what kind of file format this is.

IMN logo majestic logo threadwatch logo seochat tools logo