View previous topic :: View next topic
|
Author |
Message |
AJAYREDDY
New User
Joined: 17 Feb 2007 Posts: 52 Location: USA
|
|
|
|
Hi, I have 2 text files that are doing FTP from PC to Mainframe. Both the text files are in tabular column format (Heading and Detail rows). But 1 of the text file (see MYFILE.TEST.CODE1) is coming as data in only 1 line continuous. Whereas the other file (see MYFILE.TEST.CODE2) is coming as in tabular column. I need the MYFILE.TEST.CODE1 also to be in tabular column. Please let me know what could be the reason behind it. I tried putting spaces manually in text file after heading, deleting some chars in first line etc etc but still it is not working.
Both the files after FTP are generating as 256 VB.
Here are FTP parms and data in each file.
Code: |
IP address
userid
password
cd myfolder\Invoices
get CODE1.txt 'MYFILE.TEST.CODE1' (REPLACE
quit
BROWSE MYFILE.TEST.CODE1 Line 0000000000 Col 001 080
Command ===> Scroll ===> CSR
********************************* Top of Data *********************************
Line #.Source.Org #.Company Vendor Name.Company Vendor Site.Invoice Number.Invoice
******************************** Bottom of Data *******************************
IP address
userid
password
cd myfolder\Invoices
get CODE2.txt 'MYFILE.TEST.CODE2' (REPLACE
quit
BROWSE MYFILE.TEST.CODE2 Line 0000000000 Col 001 080
Command ===> Scroll ===> CSR
********************************* Top of Data **********************************
Line.Source.Org.Vendor.Site.Inv #.Date.Inv Sign.Inv Amt.Line Sign.Line Amt.Tax.P
1.BR.222.EXPRESS SOMETHING ABC818299323.ISDO322815.20150320.+.139.85.+.13
2.MR.333.EXPRESS SOMETHING DEF818299323.ISDO322815.20150320.+.139.85.+.13
3.VR.444.EXPRESS SOMETHING GHI818299323.ISDO322815.20150320.+.139.85.+.13
4.UR.555.EXPRESS SOMETHING MNO818299323.ISDO322815.20150320.+.139.85.+.13 |
Coded..which after ten years the user should know to do himself |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
The issue is with CR LF NL conversion.
On the PC, look at the HEX data of the two files.
Notepad++ has Hex plugin which lets you view the hex data.
Check if both the files have CRLF charaters at the end of each record. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
One possible reason is different line terminators. Unix uses the LF (line feed) as a new line indicator, while Windows uses CRLF (carriage return / line feed) and mainframes use record length instead of line terminators. Your problem, for example, could be caused if your FTP assumes CRLF for both files but CODE1.txt has Unix LF terminators only -- so as far as FTP is concerned, you are retrieving a single line from the other server. There are other possibilities, but that's usually the first place to look. There is a LOCSITE parameter that can be set for the appropriate line terminator. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Robert, I win! |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
LOL, so you did! |
|
Back to top |
|
|
AJAYREDDY
New User
Joined: 17 Feb 2007 Posts: 52 Location: USA
|
|
|
|
Thanks Vasanth and Robert. The issue was CR LF. The Notepad ++ showed LF for CODE1 and CR LF for CODE2. The txt files are created by Company A on our server. We pick them up by Mainframe by FTP. So is there any Windows tool that converts automatically to CR LF format or else can we convert LF to CR LF by FTP parms? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
If the mainframe is doing the FTP, add
Code: |
QUOTE LOCSITE SBSENDEOL=LF |
to your FTP subcommands before the GET. If the other system is doing the FTP, add
Code: |
QUOTE SITE SBSENDEOL=LF |
to its FTP subcommands before the PUT. LOCSITE is used when z/OS is driving the FTP; SITE when the other system drives the FTP -- the commands are otherwise the same. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
There is a utility, DOS2UNIX, that will convert LF to CRLF or the other way around. I do not know if this runs under windows or unix or both or under Cygwin.
But the true solution is to get both files created with the same characters. |
|
Back to top |
|
|
AJAYREDDY
New User
Joined: 17 Feb 2007 Posts: 52 Location: USA
|
|
|
|
Thanks to all for responses. I will try and let you know. |
|
Back to top |
|
|
|