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

FTP data transfer from PC to Mainframe why different format.


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

New User


Joined: 17 Feb 2007
Posts: 52
Location: USA

PostPosted: Wed Aug 23, 2017 9:59 pm
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: 1689
Location: Tiruppur, India

PostPosted: Wed Aug 23, 2017 10:10 pm
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: 8569
Location: Dubuque, Iowa, USA

PostPosted: Wed Aug 23, 2017 10:10 pm
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: 1689
Location: Tiruppur, India

PostPosted: Wed Aug 23, 2017 10:19 pm
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: 8569
Location: Dubuque, Iowa, USA

PostPosted: Wed Aug 23, 2017 10:53 pm
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: 52
Location: USA

PostPosted: Thu Aug 24, 2017 12:23 am
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: 8569
Location: Dubuque, Iowa, USA

PostPosted: Thu Aug 24, 2017 2:00 am
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: 2449
Location: Hampshire, UK

PostPosted: Thu Aug 24, 2017 2:46 pm
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: 52
Location: USA

PostPosted: Fri Aug 25, 2017 1:22 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Secondary index error while loading d... IMS DB/DC 2
No new posts Converting a file from PD to display ... SYNCSORT 4
No new posts SKIP LOCKED DATA in UPDATE statement DB2 9
No new posts Looking for mainframe system programmers Mainframe Jobs 0
No new posts Proc print in Mainframe All Other Mainframe Topics 4
Search our Forums:

Back to Top