View previous topic :: View next topic
|
Author |
Message |
robinpmathew
New User
Joined: 15 Mar 2007 Posts: 2 Location: Brazil
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
robinpmathew
New User
Joined: 15 Mar 2007 Posts: 2 Location: Brazil
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
|