Text files in Unix System Services are supposed to have hex '15' as 
newline characters. If you want to translate an ASCII file with CRLF 
hex '0d0a' newlines to EBCDIC, you want the output file to have hex '15', 
not '0d0a' or '0d15', so you should delete the '0d' before or after the 
iconv. This command will delete ALL hex '0d' characters:

tr -d '\015' <infile >outfile

The \015 is octal notation, equivalent to hex '0d'.

I don't understand why you would want an EBCDIC file with CRLF as newline, 
but if that's really what you want, you can translate the hex '0d15' back 
to '0d0a' with this command:

tr '\025' '\012' <infile >outfile

which translates ALL hex '15' to hex '0a'.

Your description is confusing to me. You talk about converting to ASCII, 
but then you use a command that converts to EBCDIC. Where and how does 
converting to ASCII get involved here?

Bill Godfrey 

On Mon, 26 Jun 2006 19:44:51 -0400, Taylor, Clarence B wrote:

>I am attempting to transfer a binary file for my pc to a uss file and
>then convert it to ascii.  There is a little issue, in that the CRLF
>sequences x'0d0a' are getting converted to '0d15'.  When I ftp with
>ascii they get translated to '0D0A'.
>
>I do the translation in USS via the iconv utility, this causes the 0D15
>sequence.
>
>iconv -f ISO8859-1 -t IBM-1047 asm.sh  > ../asm.sh
>
>I have also tried IBM-037.
>
>The short version as to why, is that I am creating an archive file on
>the PC (actually a WAR file via ANT) and then doing the binary transfer,
>so that the un-waring (JAR -XF file.ext) creates the identical build
>directory structure under uss as I had on the PC.  I then need to go
>thru and convert specific files that are ascii, to ebcdic.
>
>Depending upon the USS utility that is being used, it may or may not
>recognize the '0D15' as being the same as '0D0A'.  I could write a
>custom utility to convert the '0D15' to 0D0A, but was kinda hoping there
>was a standard utility to do this.
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to