^M characters in Zip file



Post anything related to mainframes (IBM & UNISYS) if not fit in any of the above categories

^M characters in Zip file

Postby satlab » Thu Nov 13, 2008 11:36 pm

Hi,

I am creating a zip file with two files in it in mainframe and ftp'ing the zip file to Unix server. When i open the file after unzipping it in Unix server with Vi editor, there are ^M characters at the end of each and every line.

I cannot use shell scripting in Unix server because the zip file that we are creating in mainframe would be ftp'ed to external vendor and they are not ready to change the process on their end. Is there any way that we can eliminate these ^M characters in zip file.
Can we replace the carriage return with spaces before zipping the file in mainframe? But when i view the file in HEX ON mode, it is showing up as follows.

<?xml version="1.0" encoding="UTF-8"?>
46A994A89A89977F4F748989889877EEC6F766
CF74305592965EF1B0F055364957EF43608FFE
 -----------------------------------------------------------------------------
<RequestPackage batchID="2008111202" id="1" name="RUA5BC02" seq="1"
4D89A8AAD889888488A88CC77FFFFFFFFFF748877F74989877DECFCCFF74A8977F7
C9584523713217502133894EF2008111202F094EF1F05145EF94152302F0258EF1F
 -----------------------------------------------------------------------------
    xmlns="http://www.visa.com/ROLSI"
4444A999A778AA9766AAA4A8A848996DDDEC7
000074352EF8337A11666B5921B364196329F

How do i find out the carriage return here.

Please help me.

Thanks
satlab
 
Posts: 12
Joined: Tue Oct 07, 2008 11:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ^M characters in Zip file

 

Re: ^M characters in Zip file

Postby dick scherrer » Fri Nov 14, 2008 4:40 am

Hello,

Suggest you look in the pk documentation (or open a trouble call to pkware support) for a way to suppress the newline insertion. It may happen on the zip or the unzip.

You've noticed that there are no "control characters" in the mainframe data - they are being added by pkzip or unzip. When the binary file is transfered, ftp does not know where the records start/end, so ftp would not be the cause of the inserted control characters.

Also, please notice that your data has been "Code"ed - which makes a big difference for readability ;)
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: ^M characters in Zip file

Postby MrSpock » Fri Nov 14, 2008 5:41 am

The PKZIP software lets you choose which ASCII values are included for End-Of-Line (EOL) and End-Of-File (EOF). They can be set to Carriage-Return (CR), Line-Feed (LF), Ctrl-Z (CZ) or nothing. The Unix System Administrators should be telling you what value(s) to specify for their system.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: ^M characters in Zip file

Postby MrSpock » Fri Nov 14, 2008 5:43 am

Not sure this topic is appropriate for an IBM mainframe forum. :?

And, I just noticed, haven't we already dealt with these same topics in your other posts?
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: ^M characters in Zip file

Postby satlab » Fri Nov 14, 2008 10:51 pm

I found out a way of removing ^M characters while ftp'ing a zip file from mainframe to unix server. There are options that we can use while zipping a file in mainframe. I used them and it is working fine now.

Thanks to all of you for your help.

Thanks
satlab
 
Posts: 12
Joined: Tue Oct 07, 2008 11:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ^M characters in Zip file

Postby dick scherrer » Sat Nov 15, 2008 7:18 am

Hello,

Good to hear it is working - thanks for letting us know :)

I found out a way of removing ^M characters while ftp'ing a zip file from mainframe to unix server.
I suspect this is inaccurate as i'm sure you did not accomplish this while ftp'ing a compressed file. . . (which you als mention).

If you want, i'll remove that part of your post as well as this reply. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to All other Mainframe Topics

 


  • Related topics
    Replies
    Views
    Last post