Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
FTP data transfer from PC to Mainframe why different format.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
AJAYREDDY

New User


Joined: 17 Feb 2007
Posts: 50
Location: USA

PostPosted: Wed Aug 23, 2017 9:59 pm    Post subject: FTP data transfer from PC to Mainframe why different format.
Reply with quote

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

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1521
Location: Chennai

PostPosted: Wed Aug 23, 2017 10:10 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8154
Location: East Dubuque, Illinois, USA

PostPosted: Wed Aug 23, 2017 10:10 pm    Post subject: Reply to: FTP data transfer from PC to Mainframe why different format.
Reply with quote

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

Global Moderator


Joined: 28 Aug 2007
Posts: 1521
Location: Chennai

PostPosted: Wed Aug 23, 2017 10:19 pm    Post subject:
Reply with quote

Robert, I win!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8154
Location: East Dubuque, Illinois, USA

PostPosted: Wed Aug 23, 2017 10:53 pm    Post subject: Reply to: FTP data transfer from PC to Mainframe why different format.
Reply with quote

LOL, so you did!
Back to top
View user's profile Send private message
AJAYREDDY

New User


Joined: 17 Feb 2007
Posts: 50
Location: USA

PostPosted: Thu Aug 24, 2017 12:23 am    Post subject: CR LF
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8154
Location: East Dubuque, Illinois, USA

PostPosted: Thu Aug 24, 2017 2:00 am    Post subject:
Reply with quote

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

Global Moderator


Joined: 10 May 2007
Posts: 1868
Location: UK

PostPosted: Thu Aug 24, 2017 2:46 pm    Post subject:
Reply with quote

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

New User


Joined: 17 Feb 2007
Posts: 50
Location: USA

PostPosted: Fri Aug 25, 2017 1:22 am    Post subject:
Reply with quote

Thanks to all for responses. I will try and let you know.
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Looking for Mainframe job Chandan1993 Mainframe Jobs 0 Sun Sep 24, 2017 1:06 am
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts How do I create a mainframe monitorin... anjali.bisht All Other Mainframe Topics 4 Fri Sep 01, 2017 2:20 pm
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us