Page 1 of 1

^M characters in Zip file

PostPosted: Thu Nov 13, 2008 11:36 pm
by satlab
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

Re: ^M characters in Zip file

PostPosted: Fri Nov 14, 2008 4:40 am
by dick scherrer
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 ;)

Re: ^M characters in Zip file

PostPosted: Fri Nov 14, 2008 5:41 am
by MrSpock
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.

Re: ^M characters in Zip file

PostPosted: Fri Nov 14, 2008 5:43 am
by MrSpock
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?

Re: ^M characters in Zip file

PostPosted: Fri Nov 14, 2008 10:51 pm
by satlab
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

Re: ^M characters in Zip file

PostPosted: Sat Nov 15, 2008 7:18 am
by dick scherrer
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. . .