View previous topic :: View next topic
|
Author |
Message |
George Tillmon
New User
Joined: 22 Mar 2010 Posts: 27 Location: Montgomery, AL
|
|
|
|
Hi.
I am trying to transfer a file on my pc to the mainframe.
The file is a text file that is downloaded from a website. The record length is 460.
I then ftp it to the mainframe.
However, when I browse the file on the mainframe it only has one line in it. The file shows beinf VB with a record length of 256.
I need the file to have a length of 460 and break correctly so that I can use a program to to generate a report.
I have tried the LOCSITE command with RDW, TRAIL.
I have tried MODE E, A and B.
Nothing works.
HELP!!!!!
Thanks,
George |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Assuming you're starting the transfer on your PC, try this:
Code: |
QUOTE SITE LRECL=460 RECFM=FB BLKSIZE=27600 |
|
|
Back to top |
|
|
George Tillmon
New User
Joined: 22 Mar 2010 Posts: 27 Location: Montgomery, AL
|
|
|
|
Robert Sample wrote: |
Assuming you're starting the transfer on your PC, try this:
Code: |
QUOTE SITE LRECL=460 RECFM=FB BLKSIZE=27600 |
|
Thanks for the information.
I am transferring from the pc to the mainframe using ftp on the mainframe. I have tried Filezilla on the pc but it does not work either.
Thanks again. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
The SITE and LOCSITE commands are used for the remote system and local system respectively. Which you would use depends upon whether the maifnrame is initiating the connection or not. The QUOTE prefix tells the local machine to pass the rest of the command to the other side without parsing it, which is needed when Windows machines don't know what an LRECL is (for example). |
|
Back to top |
|
|
George Tillmon
New User
Joined: 22 Mar 2010 Posts: 27 Location: Montgomery, AL
|
|
|
|
Robert Sample wrote: |
The SITE and LOCSITE commands are used for the remote system and local system respectively. Which you would use depends upon whether the maifnrame is initiating the connection or not. The QUOTE prefix tells the local machine to pass the rest of the command to the other side without parsing it, which is needed when Windows machines don't know what an LRECL is (for example). |
I used the LOCSITE command and it built the mainframe as specified. However, it is still only placing one record in the file. I get a message that the data was truncated. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Is the data in ASCII or EBCDIC on the PC? I'm assuming the file has fixed length records, but could you confirm that? If the file is ASCII text on the PC, what are the line ending character(s)? Getting the FTP options right can be challenging, depending upon the characteristics of the data in the file. |
|
Back to top |
|
|
George Tillmon
New User
Joined: 22 Mar 2010 Posts: 27 Location: Montgomery, AL
|
|
|
|
Robert Sample wrote: |
Is the data in ASCII or EBCDIC on the PC? I'm assuming the file has fixed length records, but could you confirm that? If the file is ASCII text on the PC, what are the line ending character(s)? Getting the FTP options right can be challenging, depending upon the characteristics of the data in the file. |
The ftp automatically assumes it is ASCII.
150 Opening ASCII mode data connection for APP\GT\CR110129.TXT(23050 bytes).
There are 50 records in the file. All I get is the header record and this:
EZA2802I Data was truncated. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Did this data come from a Unix machine, perchance? If so then the line terminator is probably the line feed character (as opposed to the Windows default of carriage return/line feed) -- hence the 461 bytes per line (50 bytes per record).
Assuming this is the case, add SBSENDEOL=LF to your SITE (or LOCSITE) command to change the line termination sequence. |
|
Back to top |
|
|
George Tillmon
New User
Joined: 22 Mar 2010 Posts: 27 Location: Montgomery, AL
|
|
|
|
Thanks, however, it still does not work.
This is what I get after executing the jcl:
EZA1460I Command:
EZA1736I LOCSITE RECFM=FB LRECL=460 BLKSIZE=23460 SBSENDEOL=LF
EZA1460I Command:
EZA1736I GET APP\GT\CR110129.TXT 'GT.CMS.CLAIM.RESP' (REPLACE
EZA1701I >>> PORT 10,143,14,11,4,233
200 PORT command successful.
EZA1701I >>> RETR APP\GT\CR110129.TXT
150 Opening ASCII mode data connection for APP\GT\CR110129.TXT(23050 bytes).
226 Transfer complete.
EZA1617I 23050 bytes transferred in 0.005 seconds. Transfer rate 4610.00 Kbytes
EZA2802I Data was truncated.
EZA1460I Command:
EZA1736I QUIT generated by unexpected end of file
EZA1701I >>> QUIT
221
Here are the pertinent lines from the mainframe ftp:
000009 //INPUT DD *
000010 LOCSITE RECFM=FB LRECL=460 BLKSIZE=23460 SBSENDEOL=LF
000011 GET APP\GT\CR110129.TXT 'GT.CMS.CLAIM.RESP' (REPLACE
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
I think at this point your best bet is to set up an FB file with LRECL 23050 and transfer the file in BINARY to the mainframe, then use ISPF to view the file and see what is at the end of each line. If the data is ASCII, you may have to do some research into the character translation, but the 51st (and 102nd and ...) bytes should be the same and will be the line termination character.
Quote: |
The ftp automatically assumes it is ASCII.
150 Opening ASCII mode data connection for APP\GT\CR110129.TXT(23050 bytes). |
FTP assumes ASCII transfers as the default. This does not mean the data file is text -- it merely means the transfer automatically translates text when going to the mainframe. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
George, before you even attempt to FTP the file, open it up with a hex editor (or use the DOS DEBUG command) and make sure it has the necessary end-of-line and end-of-file characters that are mandatory for z/OS. If not, you'll have to, as Robert suggested, transfer it in BINARY, or have the entity that produces the file fix it. |
|
Back to top |
|
|
George Tillmon
New User
Joined: 22 Mar 2010 Posts: 27 Location: Montgomery, AL
|
|
|
|
Robert, I did as you suggested and here is what I found.
The supposed last character is a "." (period or dot).
When I do a hex display on it it shows as 25.
Like this:
.
2
5 |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
EBCDIC defines hex '25' as LF so it is a line feed character. A couple of things that might work:
1. FTP to a Unix System Services file and use OGET to transfer from USS to z/OS.
2. use an FTP translate table to translate the X'0A' ASCII into an X'15' EBCDIC. |
|
Back to top |
|
|
George Tillmon
New User
Joined: 22 Mar 2010 Posts: 27 Location: Montgomery, AL
|
|
|
|
Thank you JESUS!!!!!
I got it guys.
I used PSPad to change it form UNIX to DOS and set the length to 460 and it worked!!!!
Thank you all for your time ans assistance.
George |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Very good to hear you got it resolved! |
|
Back to top |
|
|
Hank Watson
New User
Joined: 25 Nov 2010 Posts: 6 Location: Miami, FL
|
|
|
|
Regarding Robert Sample's reply:
Quote: |
EBCDIC defines hex '25' as LF so it is a line feed character. A couple of things that might work:
1. FTP to a Unix System Services file and use OGET to transfer from USS to z/OS.
2. use an FTP translate table to translate the X'0A' ASCII into an X'15' EBCDIC.
|
Does this mean there is no "native" way to do an FTP get from a *NIX system such that the *NIX x'0A' is recognized as an EOL character?
I'm currently wrestling with trying to get data from a Unix system. I ran across this quote in the User's Guide:
Quote: |
The z/OS FTP server supports only the CRLF value for incoming ASCII data. |
When I look at that and Robert's reply, I get the gut-sinking feeling that the quote from the IBM User's Guide is literally true. That leaves me wondering how to solve it.
Tx
Hank |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
One thing to try would be to pre-allocate the receiving file (fixed length) on the mainframe so that the lrecl includes the x'0A'.
This worked for us when transferring files created on HP-UX to MVS.
If this doesn't work, post some details and we can see. . . |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
FTP it in binary (i.e. keep the data in its raw ASCII format). Then, once you have it stored in a dataset, translate it into EBCDIC and strip off the LF characters. |
|
Back to top |
|
|
Hank Watson
New User
Joined: 25 Nov 2010 Posts: 6 Location: Miami, FL
|
|
|
|
That's what I finally stumbled across. I was concerned because in one instance of the file on the Unix box, there were newpage (x'0C') characters every 60 lines. With those thrown in the mix, I couldn't retrieve the file. But when Unix file creation was modified to put out only the data records, then this is what works for me:
Code: |
LOCSITE BLOCKSIZE=0 LRECL=133 WRAP RECFM=FB PRI=1 SEC=1 CYL
get unix_file.txt 'HLQ.MAINFRAME.FILE' (replace |
When experimenting, I ran across WRAP, and that seems to "force" to the LRECL.
I'm just stunned that the IBM FTP client is so block-headed that only CRLF is recognized.
Thanks for the reply. Let's me know I'm not crazy [IMHO] |
|
Back to top |
|
|
|