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
 

 

Unix - Mainframe FTP

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: Unix - Mainframe FTP
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

Site Director


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

PostPosted: Thu Nov 04, 2010 7:40 pm    Post subject:
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: 7931
Location: Bellevue, IA

PostPosted: Thu Nov 04, 2010 7:51 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Nov 04, 2010 7:55 pm    Post subject: Reply to: Unix - Mainframe FTP
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    Post subject:
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: 7931
Location: Bellevue, IA

PostPosted: Thu Nov 04, 2010 10:06 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Nov 04, 2010 10:20 pm    Post subject: Reply to: Unix - Mainframe FTP
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    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 Produce Mainframe Dash Board Reports ... sdcarlson53 All Other Mainframe Topics 2 Thu Jan 05, 2017 11:01 pm
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 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
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
No new posts Interface from Mainframe to Confluenc... hblun CLIST & REXX 4 Tue Sep 20, 2016 5:47 pm


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