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

Unix - Mainframe FTP


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

New User


Joined: 15 Mar 2007
Posts: 2
Location: Brazil

PostPosted: Thu Nov 04, 2010 7:32 pm
Reply with quote

I have a file in an FTP site which is on a unix server. I was trying to FTP that file to a mainframe dataset. When i FTP that file to Mainframe, we are getting only single line of the file. We checked the file at FTP site and could see that it is having proper line breaks.

I tried with providing LRECL, CRLF options while getting this file from FTP site and it did not work. Provided ASCII option also while transferring this file.

I manually copied the file from FTP site to my windows desktop and uploaded to mainframe. This time also i got only one line in the mainframe dataset

I logged into FTP server from another UNIX server and FTPed file to this UNIX server. From unix i FTPed this file to my windows desktop and uploaded file to mainframe. This time it worked and file uploaded to mainframe with correct line breaks. I found this as little weird.

I search in the forum for similar topic and couldn't find any. Please help me out here.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Nov 04, 2010 7:40 pm
Reply with quote

Hello,

Post the ftp commands used.

One thing that often helps is to pre-allocate the file with the proper dcb info and space on the mainframe.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Nov 04, 2010 7:51 pm
Reply with quote

Are you starting the FTP on the mainframe or the Unix machine? And what does this mean:
Quote:
I tried with providing LRECL, CRLF options while getting this file from FTP site and it did not work
Did the job not run at all?
Did the job run and generate an abend?
Did the job run and generate a bad return code?
Saying something "did not work" is useless and provides none of the information that answering these questions would give us.

What were the FTP codes returned?

As Dick said, what are the exact FTP commands used?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Nov 04, 2010 7:55 pm
Reply with quote

AFAIK, Unix Systems typically, by default, do not include the necessary Carriage-Return/Line-Feed (CR/LF) pair. You should verify if the data is missing these.
Back to top
View user's profile Send private message
robinpmathew

New User


Joined: 15 Mar 2007
Posts: 2
Location: Brazil

PostPosted: Thu Nov 04, 2010 9:41 pm
Reply with quote

Robert Sample wrote:
Are you starting the FTP on the mainframe or the Unix machine? And what does this mean:
Quote:
I tried with providing LRECL, CRLF options while getting this file from FTP site and it did not work
Did the job not run at all?
Did the job run and generate an abend?
Did the job run and generate a bad return code?
Saying something "did not work" is useless and provides none of the information that answering these questions would give us.

What were the FTP codes returned?

As Dick said, what are the exact FTP commands used?



I Aplogize for the confusions caused. Thanks for replying to me

We are running job from Mainframe. The job ran successfully. It FTPed only the first line of file. Below is the code i used. Ijust masked servername, user id and Password.

Code:
cd test                                       
ASCII                                         
locsite lrecl=1000 rec=fb                     
get test.Trigger.file                                     +     
    'TEST.ABC.TEST.TRIGGER.CFILE' (REPLACE     
close                                         
quit

FTP code returned is zero. I provided LRECL in the FTP card.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Nov 04, 2010 10:06 pm
Reply with quote

Have you tried
Code:
get test.Trigger.file +
'TEST.ABC.TEST.TRIGGER.CFILE' (REPLACE
quit
as your FTP commands? Since you are using (REPLACE the data set 'TEST.ABC.TEST.TRIGGER.CFILE' exists and therefore there is no reason to use the LOCSITE command. And since you're not doing an FTP to multiple sites, there's no reason to use the close command. If the data set did not exist and you used the LOCSITE command, you should specify either RECFM=F LRECL=100 or RECFM=FB LRECL=1000 BLKSIZE=27000. In other words, be consistent with your file definition parameters.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Nov 04, 2010 10:20 pm
Reply with quote

If I were trying to debug this issue, I'd do it this way:

setup a job to pull the file into the largest possible record:

Code:

//FTPSTEP  EXEC PGM=FTP,PARM='server....'
//NETRC    DD  DSN=HLQ.NETRC,DISP=SHR
//FILEIN   DD  DSN=TEST.ABC.TEST.TRIGGER.CFILE,DISP=(,CATLG,DELETE),
//         UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE),
//         RECFM=FB,LRECL=32760
//OUTPUT   DD  SYSOUT=*
//INPUT    DD  *
sendsite
binary
get test.Trigger.file //dd:filein
qui
/*


then browse or edit the resulting dataset, with hex on, and look for how the record delimiters are coded, and/or how they've been structured in ASCII. Then, I'd go from there depending on what I've found ...
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts Creating Unix Directory using COBOL i... COBOL Programming 2
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
No new posts How to Reformat a file using File Man... All Other Mainframe Topics 14
Search our Forums:

Back to Top