View previous topic :: View next topic |
Author |
Message |
shakkia Beginner
Joined: 05 Apr 2006 Posts: 9 Topics: 3 Location: India
|
Posted: Mon Feb 19, 2007 6:42 am Post subject: FTP Issues with end of line |
|
|
Hello,
I need help with this. I tried few things myself and searched many topics in this forum.
I have a ascii(.DAT) text file, created by a third party vendor. I need to FTP this to mainframe. In FTP'ing from a server to the mainframe, the end-of-line characters ( \10 \13 ) are dropped, rather than converting to an EBCDIC end-of-line. A file with normal end-of-line behavior on the windows server, appears as one very long line on the mainframe.
Apart from notepad, if I open this ASCII file using other editors, records are perfectly displayed. But notepad doesn't seem to do so. It is similar with mainframe. If I open this with wordpad and save it as Non-DOS format file before FTP-ing, ftp results are perfect.
Questions
1. Is there a way to write a BAT code to say open with wordpad and save it as .TXT file?
2. I have declared a PS, with large blocksize(32,750) and recfm = U, into which data is FTPed without truncation. The ascii end-of-line in the dataset is represented as x'25'. Can I use sort utility to split this single record into multiple records by taking x'25' as a delimitter ? If yes, how.
This file in the current format cannot be opened in edit/view mode.
The file in mainframe looks like
------------------------------------------------------------------------------
88,015,0,,Z/.88,040,0,,Z/.88,045,0,,Z/.88,072,0,,Z/.88,074,0,,Z/.88,100,0,0,Z/.8
FF6FFF6F66E62FF6FFF6F66E62FF6FFF6F66E62FF6FFF6F66E62FF6FFF6F66E62FF6FFF6F6F6E62F
88B015B0BB91588B040B0BB91588B045B0BB91588B072B0BB91588B074B0BB91588B100B0B0B9158
------------------------------------------------------------------------------
Thanks
Shakkina _________________ SBA |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon Feb 19, 2007 7:40 am Post subject: |
|
|
1. Notepad - there is an option (from the menu) that allows you to toggle from/to a view that provides end-of-line and a view that is one big line. More sophisticated 'word - processing' applications will break the line based on margines. Either view the txt file with a sophisticated field/codes display option or look at a hex image - if you want to see what the file contains.
2. When you FTP to the mainframe, you have options to add the CR/LF (0a0d); the FTP process will insert these characters as well as performing the ASC to EBC conversion.
3. Where, by the way, are the X'25's? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
advoss Beginner
Joined: 23 Aug 2005 Posts: 26 Topics: 0
|
Posted: Mon Feb 19, 2007 11:47 am Post subject: |
|
|
I thought it was supposed to be \13\10 _________________ Alan Voss |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon Feb 19, 2007 1:10 pm Post subject: |
|
|
that's why i always say CRLF - i never remember if it is 1310 or 1013 - _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
vak255 Intermediate
Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Mon Feb 19, 2007 3:33 pm Post subject: |
|
|
Try this.. download Ultraedit from www.ultraedit.com.
You can try trial version first to see whether it solves ure purpose. |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Mon Feb 19, 2007 10:01 pm Post subject: |
|
|
Can you please post the Hex version of the 1st 80 bytes or so from the PC, (upload in binary, cut from ISPF HEX mode and use [code] and [/code] tags)? |
|
Back to top |
|
|
shakkia Beginner
Joined: 05 Apr 2006 Posts: 9 Topics: 3 Location: India
|
Posted: Mon Feb 19, 2007 10:50 pm Post subject: |
|
|
Kiran,
Any editors apart from notepad including ultra edit works fine. Since I need to FTP the file through a scheduled batch job, I cannot open/edit the test file and save it as .TXT file before FTP. CUrrently if I do this and run a job, it works fine.
Dick,
The CRLF characters are present already. But when FTPed to mainframe it is not treated as a CRLF. Anyway I will try to check out options of adding it as an option during FTP. If you know it, could you please share it?
Alan,
I was not sure if it is /10/13 or /13/10. Thanks for correcting.
Shakkina |
|
Back to top |
|
|
shakkia Beginner
Joined: 05 Apr 2006 Posts: 9 Topics: 3 Location: India
|
Posted: Mon Feb 19, 2007 11:28 pm Post subject: FTP End of Line |
|
|
semigeezer,
I FTPed the file in binary mode to a 80 byte predefined datatset. The hex mode is attached below. Honestly, I could not make much out of a binary mode. I hope this is what you asked for. I have mdofieid some sensitie data in TXT file before FTPing it.
Binary Mode - Hex format (Pos 1- 80)
X'25' is the CRLF in TXT file
[code:1:e90d7ab607] ------------------------------------------------------------------------------
... |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue Feb 20, 2007 4:06 am Post subject: |
|
|
I am not the brightest spark in the firework but here goes...
why are you uploading a non-binary file as binary? _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Tue Feb 20, 2007 4:52 am Post subject: |
|
|
He isn't . I asked for the binary representation to verify that it was just the ASCII-EBCDIC translation that change the end of line to a x'25'.
The problem here is that the file has Unix end of line, not DOS. (cr instead of crlf) and FTP to MVS doesn't handle that well. The way around this is to either convert the file to DOS format using dos2unix (or a port thereof) or to first FTP the file to the Unix file system in USS, and then copy it over to the MVS file system. For example, the following Windows command file does this: Code: | @echo off
echo //USER1XYZ JOB 'USER1',CLASS=A,MSGCLASS=H>jcl
echo //COPY EXEC PGM=BPXBATCH>>jcl
echo //STDPARM DD *>>jcl
echo sh cp /u/user1/test.file "//'user1.test.file'"; >>jcl
echo rm /u/user1/test.file; >>jcl
echo //STDOUT DD SYSOUT=*>>jcl
echo open mvs040>cmds
echo user user1 password>>cmds
echo !echo Sending file to host>>cmds
echo ascii>>cmds
echo cd />>cmds
echo put test.file /u/user1/test.file>>cmds
echo !echo Submitting JCL to copy the file to MVS>>cmds
echo quote site filetype=jes>>cmds
echo put jcl>>cmds
echo quit>>cmds
ftp -n <cmds
del cmds jcl | This is an abbreviated command file that doesn't verify that the transfer was successful, but it works. It is possible to get the job output and verify that everything worked by using a few more FTP commands and grep or find on the output. |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue Feb 20, 2007 6:40 am Post subject: |
|
|
Shakkia wrote in the post immediately prior to mine:
Quote: |
I FTPed the file in binary mode
|
_________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Tue Feb 20, 2007 10:32 am Post subject: |
|
|
2 posts before that is where I asked him to do that, just for purposes of posting it here. |
|
Back to top |
|
|
taltyman JCL Forum Moderator
Joined: 02 Dec 2002 Posts: 310 Topics: 8 Location: Texas
|
Posted: Tue Feb 20, 2007 5:54 pm Post subject: |
|
|
what about ftping it to a USS file on the mainframe? |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Wed Feb 21, 2007 1:53 am Post subject: |
|
|
Since no one is paying attention anyway, it must be time for a popular literary reference. With apologies to Charles Dickens...
THE PLUMP SISTER
Is it a horse?
FRED
No!
NIECE
Is it an ass?
At this, Fred roars with laughter; and is so inexpressibly tickled, that he
doubles over and stamps his foot.
FRED
No!
SEMIGEEZER SCROOGE
Is it a Unix file?
The Spirit gives Semigeezer Scrooge a look as if to say: "They can't hear you..." and
Semigeezer Scrooge scowls as if to say: "Shut up. I'm being a geek." |
|
Back to top |
|
|
shakkia Beginner
Joined: 05 Apr 2006 Posts: 9 Topics: 3 Location: India
|
Posted: Wed Feb 21, 2007 5:46 am Post subject: |
|
|
Hi,
Sorry if I got you upset. I had few other stuff to completed and tried out your solution. Since I had never used BPXBATCH, I read a brief intro about it.
First let me admit, I didn't understand most of the commands. But I followed it to the T substituting user1 wiht my mainframe ID, password with my mainframe password, test.file with actualfilename.TXT. It gave erros saying PASS command failed, Login failed, JCL errored out in mainframe as it did not have steps. There was another error which said unable to write /u/userid/fileanme.TXT.
I could have gone worng in several places. I am trying out some options.
Would it be possible, time permitting to explain the options. I executed all the commands from the directory where the file to be ftped is located.
sorry...i could not take this lead further
Thanks a Ton
Shakkina _________________ SBA |
|
Back to top |
|
|
|
|