Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

FTP from windows server into Mainframe - Data truncation
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
sathyajes

New User


Joined: 02 Mar 2006
Posts: 24
Location: Chennai

PostPosted: Wed Jul 20, 2016 1:33 pm    Post subject: FTP from windows server into Mainframe - Data truncation
Reply with quote

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

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 20, 2016 2:06 pm    Post subject:
Reply with quote

Just way too much information missing from your post.
Back to top
View user's profile Send private message
sathyajes

New User


Joined: 02 Mar 2006
Posts: 24
Location: Chennai

PostPosted: Wed Jul 20, 2016 2:55 pm    Post subject: FTP from windows server into Mainframe - Data truncation
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 20, 2016 3:34 pm    Post subject:
Reply with quote

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

New User


Joined: 02 Mar 2006
Posts: 24
Location: Chennai

PostPosted: Wed Jul 20, 2016 3:45 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 20, 2016 3:49 pm    Post subject:
Reply with quote

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

New User


Joined: 02 Mar 2006
Posts: 24
Location: Chennai

PostPosted: Wed Jul 20, 2016 3:54 pm    Post subject:
Reply with quote

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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Wed Jul 20, 2016 4:02 pm    Post subject:
Reply with quote

SITE/LOCSITE
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 20, 2016 4:12 pm    Post subject:
Reply with quote

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

New User


Joined: 02 Mar 2006
Posts: 24
Location: Chennai

PostPosted: Wed Jul 20, 2016 4:56 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 20, 2016 6:22 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 7912
Location: Bellevue, IA

PostPosted: Wed Jul 20, 2016 6:25 pm    Post subject:
Reply with quote

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

Active User


Joined: 30 Nov 2013
Posts: 461
Location: The Universe

PostPosted: Wed Jul 20, 2016 8:06 pm    Post subject:
Reply with quote

Quote:
EZA2802I Data was truncated.

There are several misunderstandings here.
  1. 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.
  2. 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.
  3. 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
View user's profile Send private message
sathyajes

New User


Joined: 02 Mar 2006
Posts: 24
Location: Chennai

PostPosted: Wed Jul 20, 2016 8:18 pm    Post subject:
Reply with quote

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

Active User


Joined: 30 Nov 2013
Posts: 461
Location: The Universe

PostPosted: Wed Jul 20, 2016 10:36 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 7912
Location: Bellevue, IA

PostPosted: Wed Jul 20, 2016 11:52 pm    Post subject:
Reply with quote

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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Thu Jul 21, 2016 12:14 am    Post subject:
Reply with quote

PSPad
Back to top
View user's profile Send private message
sathyajes

New User


Joined: 02 Mar 2006
Posts: 24
Location: Chennai

PostPosted: Thu Jul 21, 2016 2:45 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 10 May 2007
Posts: 1714
Location: UK

PostPosted: Thu Jul 21, 2016 3:00 pm    Post subject:
Reply with quote

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

New User


Joined: 02 Mar 2006
Posts: 24
Location: Chennai

PostPosted: Thu Jul 21, 2016 3:53 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
This topic is locked: you cannot edit posts or make replies. Urgent Mainframe Requirments (2-10 yr... Shankar779 Mainframe Jobs 0 Sun Nov 27, 2016 1:48 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
This topic is locked: you cannot edit posts or make replies. Mainframe Developer requirement in Ku... capricorn Mainframe Jobs 0 Sun Oct 23, 2016 3:49 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us