View previous topic :: View next topic |
Author |
Message |
Bithead Advanced
Joined: 03 Jan 2003 Posts: 550 Topics: 23 Location: Michigan, USA
|
Posted: Wed Apr 13, 2005 12:40 pm Post subject: FTP Line Break Problem |
|
|
I have been asked to get a file to the mainframe from a Windows machine. The problem is the file is being created with line feeds but no carriage returns so I am losing the line formatting. Does anyone know how to correct this? Note that the file is variable length. |
|
Back to top |
|
|
superk Advanced
Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Thu Apr 14, 2005 9:11 am Post subject: |
|
|
The only solution I see, other than fixing the file, is to FTP the file, in binary mode, to a dataset allocated with RECFM=VB.
Then, pass the dataset through a data-mapping engine (Gentran, Mercator, Cloverleaf), telling the engine to:
- use the Line Feed (hex '0A') as the segment terminator.
- translate the text from ASCII to EBCDIC.
- write one segment per record to the output, truncating the Line Feed character as it does so. |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Thu Apr 14, 2005 9:29 am Post subject: |
|
|
I'm not certain I've had the exact problem with FTP you mentioned, but
one way I've dealt with situations like this is to copy the file on the Windows box beforehand using somethng simple like:
type c:\badfile > c:\goodfile
and then upload goodfile. It basically converts Unix format to Windows format. If that doesn't change anything else (tabs, blank lines, unusual characters) then it may work for you.
Or you could get one of the ports of the unix2dos command for win32. |
|
Back to top |
|
|
Bithead Advanced
Joined: 03 Jan 2003 Posts: 550 Topics: 23 Location: Michigan, USA
|
Posted: Thu Apr 14, 2005 10:55 am Post subject: |
|
|
Thanks for the reponses. I an going to use WRAPRECORD in the FTP and write a quick program to format the record. |
|
Back to top |
|
|
|
|