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

Need FTP JCL which sends the dataset in text format


IBM Mainframe Forums -> JCL & VSAM
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
shakti

New User


Joined: 20 Jan 2004
Posts: 42

PostPosted: Thu Feb 26, 2004 10:28 am
Reply with quote

Guru's!

Can you please give some idea about the FTP jcl which sends the dataset in text format to remote server.

Thanks and Refards!

Shakti
Back to top
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 150
Location: Tokyo, Japan

PostPosted: Thu Feb 26, 2004 1:30 pm
Reply with quote

Hi Sakti,

Following is the code we use in our shop -
Code:
//STEP1    EXEC PGM=FTP,REGION=8M,
//           PARM='cengprod.dcs.citicorp.com'   <== Destination
//STEPLIB  DD DSN=As your shop
//SYSTCPD  DD DSN=As your shop
//SYSFTPD  DD DSN=As your shop
//SYSPRINT DD SYSOUT=*
//OUTPUT   DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//INPUT    DD *
ceftpjp august07    <=== userid and password
Your Dataset name and destination file/directory
QUIT


Regards,
Sandip.
Back to top
View user's profile Send private message
shakti

New User


Joined: 20 Jan 2004
Posts: 42

PostPosted: Thu Feb 26, 2004 2:13 pm
Reply with quote

sandip_datta wrote:
Hi Sakti,

Following is the code we use in our shop -
Code:
//STEP1    EXEC PGM=FTP,REGION=8M,
//           PARM='cengprod.dcs.citicorp.com'   <== Destination
//STEPLIB  DD DSN=As your shop
//SYSTCPD  DD DSN=As your shop
//SYSFTPD  DD DSN=As your shop
//SYSPRINT DD SYSOUT=*
//OUTPUT   DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//INPUT    DD *
ceftpjp august07    <=== userid and password
Your Dataset name and destination file/directory
QUIT


Regards,
Sandip.




Thanks you very much sandip

Shakthi
Back to top
View user's profile Send private message
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 237
Location: USA

PostPosted: Thu Feb 26, 2004 3:16 pm
Reply with quote

Hello shakti,

Below is the FTP jcl you may require.
I have not tested it...but it should work.

Code:

//FTP00001 EXEC PGM=IKJEFT01,DYNAMNBR=50         
//OUT      DD   SYSOUT=*                         
//AMSDUMP  DD   SYSOUT=*                         
//SYSTSPRT DD   SYSOUT=*                         
//SYSIN    DD   DUMMY                             
//SYSPRINT DD   DUMMY                             
//OUTPUT   DD   SYSOUT=*                         
//SYSTSIN  DD  *                                 
FTP (EXIT
IP Address
Userid
password
pwd
ascii
cd <path where you need to put the file>
pwd
PUT '<host file name>' <destination file name>
QUIT
/*


Hope this helps,

Regards
Mayuresh Tendulkar
Back to top
View user's profile Send private message
mrar_160

New User


Joined: 14 Sep 2005
Posts: 48

PostPosted: Wed Sep 14, 2005 12:44 pm
Reply with quote

Which one can be use?
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Wed Sep 14, 2005 1:38 pm
Reply with quote

HI Mrar,

Quote:
Which one can be use?



JCL given by mdtendulkar works fine.

Regards
Rupesh
Back to top
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Thu Sep 15, 2005 2:07 am
Reply with quote

Some things I think you should consider for an FTP job:

- Use a secured dataset for the NETRC DD to securely store the user id's and passwords so they aren't visible to anyone.

- Use of the (EXIT or (EXIT= parameter. You need to determine how you want to handle and report on FTP errors. Personally, I'd want the job to always end with RC=0, but the I'd check the content of the OUTPUT to make sure things worked as planned.

- I prefer to PUT or GET to/from DD's, rather than datasets:
Code:

//NETRC DD DISP=SHR,DSN=HLQ.NETRC
//SYSUT1 DD DISP=SHR,DSN=MY.OUTBOUND.DATA
//SYSUT2 DD DSN=MY.INBOUND.DATA,DISP=(,CATLG,DELETE),...
//INPUT DD *
>sendsite
>ascii
>get filename //DD:SYSUT2
>put //DD:SYSUT1 filename
>quit
Back to top
View user's profile Send private message
nitin_agr

New User


Joined: 06 Sep 2005
Posts: 28
Location: Minneapolis US

PostPosted: Thu Sep 15, 2005 5:12 am
Reply with quote

It will also work fine and will store user id password path etc in another data set.

//STEP010 EXEC PGM=FTP,PARM=' ( EXIT'
//*
//INPUT DD DSN= <name of data set contains details.> ,
// DISP=SHR
//SYSPRINT DD SYSOUT=*
//OUTPUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*


It works fine and also secured way of doing do.
Back to top
View user's profile Send private message
Sarfraz S

New User


Joined: 28 Jun 2008
Posts: 1
Location: Chennai, INDIA

PostPosted: Mon Nov 17, 2008 3:12 pm
Reply with quote

mdtendulkar wrote:
Hello shakti,

Below is the FTP jcl you may require.
I have not tested it...but it should work.

Code:

//FTP00001 EXEC PGM=IKJEFT01,DYNAMNBR=50         
//OUT      DD   SYSOUT=*                         
//AMSDUMP  DD   SYSOUT=*                         
//SYSTSPRT DD   SYSOUT=*                         
//SYSIN    DD   DUMMY                             
//SYSPRINT DD   DUMMY                             
//OUTPUT   DD   SYSOUT=*                         
//SYSTSIN  DD  *                                 
FTP (EXIT
IP Address
Userid
password
pwd
ascii
cd <path where you need to put the file>
pwd
PUT '<host file name>' <destination file name>
QUIT
/*


Hope this helps,

Regards
Mayuresh Tendulkar


Hi tendulkar,

Can you please explain the parameters you've used in your code as it's not working for me. What does the IP address refer to? Does it refer to Mainframe IP address or server IP address?
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon Nov 17, 2008 3:24 pm
Reply with quote

First, a link to the z/OS V1R9.0 Comm Svr: IP User's Guide and Commands manual.

Second, the IP address given is the address of the remote FTP Server. You will always need to provide a userid and password for that Server. The ascii sub-command indicates that the data needs to be translated to ASCII for that remote Server.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
No new posts batch SFTP job using AOPBATCH unable ... All Other Mainframe Topics 7
No new posts Reading Empty Dataset DFSORT/ICETOOL 5
No new posts Format Binary file to EBCDIC JCL & VSAM 4
Search our Forums:

Back to Top