IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

FTP File Transfer from PC to Mainframe


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
George Tillmon

New User


Joined: 22 Mar 2010
Posts: 27
Location: Montgomery, AL

PostPosted: Wed Feb 02, 2011 8:24 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Feb 02, 2011 8:34 pm
Reply with quote

Assuming you're starting the transfer on your PC, try this:
Code:
QUOTE SITE LRECL=460 RECFM=FB BLKSIZE=27600
Back to top
View user's profile Send private message
George Tillmon

New User


Joined: 22 Mar 2010
Posts: 27
Location: Montgomery, AL

PostPosted: Wed Feb 02, 2011 9:07 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Feb 02, 2011 9:21 pm
Reply with quote

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
View user's profile Send private message
George Tillmon

New User


Joined: 22 Mar 2010
Posts: 27
Location: Montgomery, AL

PostPosted: Wed Feb 02, 2011 9:25 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Feb 02, 2011 9:37 pm
Reply with quote

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
View user's profile Send private message
George Tillmon

New User


Joined: 22 Mar 2010
Posts: 27
Location: Montgomery, AL

PostPosted: Wed Feb 02, 2011 9:55 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Feb 02, 2011 10:13 pm
Reply with quote

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
View user's profile Send private message
George Tillmon

New User


Joined: 22 Mar 2010
Posts: 27
Location: Montgomery, AL

PostPosted: Wed Feb 02, 2011 10:20 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Feb 02, 2011 10:32 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Feb 02, 2011 10:50 pm
Reply with quote

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
View user's profile Send private message
George Tillmon

New User


Joined: 22 Mar 2010
Posts: 27
Location: Montgomery, AL

PostPosted: Wed Feb 02, 2011 11:32 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Feb 03, 2011 12:46 am
Reply with 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.
Back to top
View user's profile Send private message
George Tillmon

New User


Joined: 22 Mar 2010
Posts: 27
Location: Montgomery, AL

PostPosted: Thu Feb 03, 2011 1:03 am
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Feb 03, 2011 1:08 am
Reply with quote

Very good to hear you got it resolved!
Back to top
View user's profile Send private message
Hank Watson

New User


Joined: 25 Nov 2010
Posts: 6
Location: Miami, FL

PostPosted: Fri Feb 25, 2011 10:36 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Feb 25, 2011 10:53 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Feb 25, 2011 11:24 pm
Reply with quote

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
View user's profile Send private message
Hank Watson

New User


Joined: 25 Nov 2010
Posts: 6
Location: Miami, FL

PostPosted: Fri Feb 25, 2011 11:25 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
Search our Forums:

Back to Top