View previous topic :: View next topic
|
Author |
Message |
sathyajes
New User
Joined: 02 Mar 2006 Posts: 35 Location: Chennai
|
|
|
|
Our requirement is that we need to pull file from windows server. While doing this, we are getting error “Data was truncated” in FTP step.
We are using below sample FTP code to fulfill the requirements. Same below code is working fine when we pull file from UNIX server. Could you please confirm solution on how to do for windows? Please share if you have sample code
Code: |
Server IP address
username
password
ASCII
CD UAT\outgoing
GET filename.dat 'xxxx.yyyy.zzzz ' (REPLACE
QUIT |
Error:
Code: |
125 Data connection already open; Transfer starting.
226 Transfer complete.
EZA1617I 600 bytes transferred in 0.010 seconds. Transfer rate 60.00 Kbytes/se
EZA2802I Data was truncated.
EZA1460I Command:
EZA1736I QUIT
EZA1701I >>> QUIT
221 Goodbye. |
Coded for you - do it yourself next time |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Just way too much information missing from your post. |
|
Back to top |
|
|
sathyajes
New User
Joined: 02 Mar 2006 Posts: 35 Location: Chennai
|
|
|
|
Hi Expat, thanks for your reply!!
Could you please let me know what information you want based on that I will share. I thought I had shared all required information. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
What is the record format, length for both datasets.
I also recall using parameters to set RECFM, LRECL on the mainframe for received files. |
|
Back to top |
|
|
sathyajes
New User
Joined: 02 Mar 2006 Posts: 35 Location: Chennai
|
|
|
|
We are receiving file with record length as 300 including CRLF(which I was not aware)from windows server.
We have already created dataset before FTP step with length as 300 and recfm as FB
Code: |
Device type . . . . : 3390
Data class . . . . . : DEFAULT
Organization . . . : PS Current Utilization
[b]Record format . . . : FB Used tracks . . . . : 1
Record length . . . : 300 Used extents . . . : 1 [/b]
Block size . . . . : 27900
1st extent tracks . : 1
Secondary tracks . : 10 Dates
Data set name type : Creation date . . . : 2016/07/20
Referenced date . . : 2016/07/20
Expiration date . . : ***None*** |
Coded for you - do it yourself next time |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Hmmmmmmmmmmmmmmmm,
Doesn't windows have a default record length of 256 ?
I know that one of my guys had a whole heap of problems reading in a file longer than 256 - until he specified a much longer LRECL |
|
Back to top |
|
|
sathyajes
New User
Joined: 02 Mar 2006 Posts: 35 Location: Chennai
|
|
|
|
Thanks for your reply..
No, We have requirement to keep 300 length to receive data from windows server. Is there any solution for this |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3077 Location: NYC,USA
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
sathyajes wrote: |
Thanks for your reply..
No, We have requirement to keep 300 length to receive data from windows server. Is there any solution for this |
Yes, I know that. And I wasn't suggesting that you change the record length.
That is why I suggested that you looked at ways of letting the process know to overwrite what may be a default value.
Take a look at what Rohit has posted |
|
Back to top |
|
|
sathyajes
New User
Joined: 02 Mar 2006 Posts: 35 Location: Chennai
|
|
|
|
Thanks Rohit/Expat,
I was trying with below, still I am getting data truncation error. Please help with sample code
Code: |
Server IP address
username
password
ASCII
CD UAT\outgoing
LOCSITE RECFM=FB LRECL=300 BLKSIZE=0
GET filename.dat 'xxxx.yyyy.zzzz ' (REPLACE
QUIT |
Coded for you - do it yourself next time |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
I would guess that you are running the ftp process from the mainframe.
The possible problematic default length exists on windows.
What have you done to address this at the windows end.
i.e. telling the process to use your record length at the windows end. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
The FTP code you are executing is perfectly acceptable. Your problem is NOT with FTP -- your problem is a data problem. Asking for sample code will NOT in any way help you, even if you got it.
Is the data being transferred from a Unix machine to a Windows machine before going to the mainframe? If so, I would guess that Unix line terminators are being used instead of Windows line terminators. Or, the data might not be in ASCII but a different code page (or even UTF-8).
Your easiest -- and best -- way to fix this is to stop asking questions on this forum, create a data set with 600 LRECL (since your original post said 600 bytes were transferred), FTP your data into this data set, and use TSO/ISPF edit to look at the data in hexadecimal. This should tell you if your line terminator is Unix or not. If you still have troubles with it after doing this, you can post (using the Code tag) your data in hex format so we can look at it and probably see the issue. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Quote: |
EZA2802I Data was truncated. |
There are several misunderstandings here.- When FTP transfers data in ASCII mode, the data that it transfers uses only *nix style end of line characters. In other words, if you transfer a mainframe style text data set which does not use end of line characters, what FTP sends on the line is textNLtextNL...textNL. If a Windoze FTP receives this it builds a Windoze file as textCRLFtextCRLF...textCRLF. The text on the line is always ASCII. Similarly, FTP on Windoze would send textCRLFtextCRLF...textCRLF as textNLtextNL...textNL.
- I think the message is saying the mainframe FTP received more than 300 bytes (or whatever the LRECL of the output data set is) before end of data or an NL character, so it truncated the line.
- To the best of my knowledge there is no default "LRECL" or even the concept of an "LRECL," for a text file in either *nix or Windoze. I routinely build several hundred byte and sometimes longer logical lines in Windoze notepad.
As Mr. Sample and expat both say, you must review your data. I see at least two possibilities.- The Windoze file does not use CRLF as a line terminator or even have line terminators.
- As the message says, you have a logical line greater than the LRECL of the mainframe data set.
|
|
Back to top |
|
|
sathyajes
New User
Joined: 02 Mar 2006 Posts: 35 Location: Chennai
|
|
|
|
Hi Robert,
Thanks for your valuable information. Initially the file is created in Linux server and moved to windows server. from there, mainframe FTP job is trying to pick the file.
Already we have tried with LRECL as 600 and data was written without truncate. We put hex on, and found that X'25' in end of each line. Please help us. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
sathyajes wrote: |
Hi Robert,
Thanks for your valuable information. Initially the file is created in Linux server and moved to windows server. from there, mainframe FTP job is trying to pick the file.
Already we have tried with LRECL as 600 and data was written without truncate. We put hex on, and found that X'25' in end of each line. Please help us. |
OK. It appears the data was from the *nix system as a "binary" file. It does not have Windoze style line terminators. This means you cannot send it to a mainframe FTP as an "ASCII" transfer. As I see it you have four options.- Send the data from the *nix system to the Windoze system as an "ASCII" transfer so the Windoze FTP will build a proper Windoze text file.
- Send the data to the mainframe as is as a "binary" transfer and convert the data to mainframe style data yourself.
- On the Windoze system, rebuild the data using Windoze style line separator in place of the *nix line separators, and send the resulting data to the mainframe as an "ASCII" transfer.
- Get the Windoze system out of the loop and transfer the data directly from the *nix system. Personal opinion: this is the simplest option. Why was the Windoze system in the loop anyway?
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Have you tried SBSENDEOL? If not, try this:
Code: |
Server IP address
username
password
ASCII
QUOTE LOCSITE SBSENDEOL=LF
CD UAT\outgoing
GET filename.dat 'xxxx.yyyy.zzzz ' (REPLACE
QUIT
|
It may work for your problem. If you were connecting from the Windows machine to z/OS, you would use
Code: |
QUOTE SITE SBSENDEOL=LF |
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3077 Location: NYC,USA
|
|
Back to top |
|
|
sathyajes
New User
Joined: 02 Mar 2006 Posts: 35 Location: Chennai
|
|
|
|
Thanks all for your support.
Still the issue is reported. I have followed the above mentioned solution.
Server IP address
username
password
ASCII
LOCSITE SBSENDEOL=LF
CD UAT\outgoing
GET filename.dat 'xxxx.yyyy.zzzz ' (REPLACE
QUIT
QUOTE is not working in mainframe side. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
You are still not using the code tags. Why should I not lock the topic?
Quote: |
QUOTE is not working in mainframe side. |
This is meanung less unless you tell us how it is not working! |
|
Back to top |
|
|
sathyajes
New User
Joined: 02 Mar 2006 Posts: 35 Location: Chennai
|
|
|
|
The error is saying that 'Data was truncated'.
additionally QUOTE LOCSITE SBSENDEOL=LF is not worked. so I removed the QUOTE and below error is not coming
Code: |
EZA1736I QUOTE LOCSITE SBSENDEOL=LF
EZA1701I >>> LOCSITE SBSENDEOL=LF
500 'LOCSITE SBSENDEOL=LF': command not understood.
|
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
You need to talk to your site support group and get their assistance. If you cannot do this or they cannot help you, your choices are to FTP from the Unix machine to z/OS, or to give up on FTP and find a different way to transfer the data. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
Quote: |
QUOTE is not working in mainframe side. |
Is incorrect. It worked but just didn't do what you wanted. The transfer happened but with data truncated. Removing the command "QUOTE" but leaving its parameters is bound to give you
Quote: |
500 'LOCSITE SBSENDEOL=LF': command not understood. |
Garry |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
I did NOT say that QUOTE LOCSITE SBSENDEOL=LF would fix your problem; I asked if you had tried it since it can fix some line terminator issues. Since you won't post any data for us to look at, and you keep saying things "don't work" -- which is a TOTALLY USELESS phrase since it doesn't provide any information about the problem -- I see no reason to continue attempting to help. You would benefit from finding the IP User's Guide manual in the Communications Server bookshelf for your release of z/OS and reading up on FTP along with its sub-commands and options.
I don't provide extraneous information in my code, generally. If I write QUOTE LOCSITE ... then I mean QUOTE LOCSITE ... and leaving off the QUOTE, as you did, does not really make sense.
Contact your site support group. Or, FTP directly from the Unix machine to the z/OS machine so the line terminator issue becomes moot. Or, realize that FTP won't do what you want from the Windows machine and use a different method (depending upon your site, you could have a number of options -- but only your site support group can tell you for sure) to transfer the data. |
|
Back to top |
|
|
sathyajes
New User
Joined: 02 Mar 2006 Posts: 35 Location: Chennai
|
|
|
|
Hi Robert and Rest
Thanks lot for your help. it's helped me a lot. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3077 Location: NYC,USA
|
|
|
|
Please post us back the resolution you will have ,so that others in the same situation can be benefited. |
|
Back to top |
|
|
|