MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

FTP JCL ( Unix to Mainframe)

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
anaik
Beginner


Joined: 31 Jan 2007
Posts: 20
Topics: 6

PostPosted: Thu Feb 01, 2007 10:16 am    Post subject: FTP JCL ( Unix to Mainframe) Reply with quote

Hi

I want to FTP a file from Unix box to Host side. The file is of variable size length. i use the below JCL
Code:

//STEPFTP  EXEC PGM=FTP,PARM='/(EXIT',REGION=7000K
//SYSPRINT DD SYSOUT=*                             
//SYSIN    DD *                                   
server name               
user password
Binary                   
site lrecl=32756 recfm=vb blksize=32760             
cd /clrcmpdwnload/afp/hold             
get Unix file 'host file'
quit                                   
/*                                     
//                                   

but the file that gets created on the host has blksize=6233 and lrecl=252

I needed help so that i can modify or use some other utitlity to ftp JCL
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Thu Feb 01, 2007 10:46 am    Post subject: Reply with quote

I'd create the job thus

Code:

//STEPFTP EXEC PGM=FTP,PARM='/(EXIT',REGION=7000K
//SYSUT1 DD DSN=<host file>,RECFM=VB,LRECL=32756,BLKSIZE=32760,...
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
server name
user password
Binary
cd /clrcmpdwnload/afp/hold
get Unix file //dd:sysut1
quit
/*
//


or

Code:

//STEPFTP EXEC PGM=FTP,PARM='/(EXIT',REGION=7000K
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
server name
user password
Binary
locsite lrecl=32756 recfm=vb blksize=32760
cd /clrcmpdwnload/afp/hold
get Unix file 'host file'
quit
/*
//


or, I'd use the SYSFTPD DD (FTP.DATA) to provide the default values for recfm, lrecl, and blksize
Back to top
View user's profile Send private message
anaik
Beginner


Joined: 31 Jan 2007
Posts: 20
Topics: 6

PostPosted: Thu Feb 01, 2007 11:29 am    Post subject: Reply with quote

thanks superk
Back to top
View user's profile Send private message
anaik
Beginner


Joined: 31 Jan 2007
Posts: 20
Topics: 6

PostPosted: Thu Feb 01, 2007 11:55 am    Post subject: Reply with quote

I have another problem..
The file which i am trying to FTP from Unix to Host is having a problem with structure.

Original file
=======
!..Ly
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Thu Feb 01, 2007 12:18 pm    Post subject: Reply with quote

Since you're receving the file in binary mode to a rather large dataset, I'm not sure what you expect it to look like. If you could post both files as they appear in hexadecimal, I think you'd see that there's really no difference content-wise.
Back to top
View user's profile Send private message
anaik
Beginner


Joined: 31 Jan 2007
Posts: 20
Topics: 6

PostPosted: Sat Feb 10, 2007 12:28 pm    Post subject: Reply with quote

The original variable file the contents are as below

LINE1
LINE2
LINE3

the variable file which is created after FTPing on the host is

LINE1LINE2LINE3

does it help in understnading my query
Back to top
View user's profile Send private message
anaik
Beginner


Joined: 31 Jan 2007
Posts: 20
Topics: 6

PostPosted: Mon Feb 12, 2007 10:49 am    Post subject: Reply with quote

any help guys
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Mon Feb 12, 2007 11:44 am    Post subject: Reply with quote

anaik,

you are missing CRLF in the input file. Create the file with CRLF and then FTP the dataset.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Mon Feb 12, 2007 12:55 pm    Post subject: Reply with quote

That still will not do it, as far as I know. The reason is that binary transfers do not respect crlf (or actually, Unix only uses one of those, cr or lf, I forget which one), since there is no such thing in the MVS file system. Maybe if you FTP the file to the Unix side of MVS and then use cp or OCOPY to move the file to the MVS file system you will get what you want, but even then I'm not sure.
Back to top
View user's profile Send private message Visit poster's website
prasanth_thavva
Beginner


Joined: 14 May 2006
Posts: 40
Topics: 18

PostPosted: Fri Feb 16, 2007 2:57 am    Post subject: Reply with quote

HI,

Can any body explain in details each step in This JCL.

Code:

//STEPFTP EXEC PGM=FTP,PARM='/(EXIT',REGION=7000K
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
server name
user password
Binary
locsite lrecl=32756 recfm=vb blksize=32760
cd /clrcmpdwnload/afp/hold
get Unix file 'host file'
quit
/*
//


Thanks&Regards
Venkata Prasanth Thavva
_________________
Thanks&Regards
Prasanth Thavva
Back to top
View user's profile Send private message Send e-mail
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Feb 16, 2007 4:42 am    Post subject: Reply with quote

If you have line input then it is not a binary file, surely? so should not be sent as a binary file
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group